:py:mod:`wolfhece.lifewatch` ============================ .. py:module:: wolfhece.lifewatch Module Contents --------------- .. py:data:: YEARS :value: [2006, 2010, 2015, 2018, 2019, 2020, 2021, 2022] .. py:data:: PIXEL_SIZE :value: 2 .. py:data:: MAP_LW :value: 'LW_ecotopes_lc_hr_raster' .. py:data:: MAX_PIXELS :value: 2048 .. py:class:: LifeWatch_Legend Bases: :py:obj:`enum.Enum` .. autoapi-inheritance-diagram:: wolfhece.lifewatch.LifeWatch_Legend :parts: 1 :private-bases: https://www.mdpi.com/2306-5729/8/1/13 Map Class Map Code Related EAGLE Code Percentage of Land Area [%] Based on 2018 Product Water 10 LCC-3 0.73 Natural Material Surfaces with less than 10% vegetation 15 LCC-1_2 0.32 Artificially sealed ground surface 20 LCC-1_1_1_3 5.75 Building, specific structures and facilities 21 LCC-1_1_1_1 || LCC-1_1_1_2 1.99 Herbaceous in rotation during the year (e.g., crops) 30 LCC-2_2 23.94 Grassland with intensive management 35 LCC-2_2 27.57 Grassland and scrub of biological interest 40 LCC-2_2 1.82 Inundated grassland and scrub of biological interest 45 LCC-2_2 & LCH-4_4_2 0.22 Vegetation of recently disturbed area (e.g., clear cut) 48 LCC-2_2 & LCH-3_8 2.64 Coniferous trees (≥3 m) 50 LCC-2_1_1 & LCH-3_1_1 11.24 Small coniferous trees (<3 m) 51 LCC-2_1_2 & LCH-3_1_1 0.40 Broadleaved trees (≥3 m) 55 LCC-2_1_1 & LCH-3_1_2 21.63 Small broadleaved trees (<3 m) and shrubs 56 LCC-2_1_2 & LCH-3_1_2 1.75 Color Table (RGB with 256 entries) from tiff file 10: 10,10,210 15: 210,210,210 20: 20,20,20 21: 210,0,0 30: 230,230,130 35: 235,170,0 40: 240,40,240 45: 145,245,245 48: 148,118,0 50: 50,150,50 51: 0,151,151 55: 55,255,0 56: 156,255,156 46: 246,146,246,255 11: 254,254,254,255 .. py:property:: code :type: int .. py:attribute:: NODATA_WHITE :value: (0, (255, 255, 255), 'Nodata', '') .. py:attribute:: WATER :value: (10, (10, 10, 210)) .. py:attribute:: NATURAL_MATERIAL_SURFACES :value: (15, (210, 210, 210)) .. py:attribute:: ARTIFICIALLY_SEALED_GROUND_SURFACE :value: (20, (20, 20, 20)) .. py:attribute:: BUILDING :value: (21, (210, 0, 0)) .. py:attribute:: HERBACEOUS_ROTATION :value: (30, (230, 230, 130)) .. py:attribute:: GRASSLAND_INTENSIVE_MANAGEMENT :value: (35, (235, 170, 0)) .. py:attribute:: GRASSLAND_SCRUB_BIOLOGICAL_INTEREST :value: (40, (240, 40, 240)) .. py:attribute:: INUNDATED_GRASSLAND_SCRUB_BIOLOGICAL_INTEREST :value: (45, (145, 245, 245)) .. py:attribute:: VEGETATION_RECENTLY_DISTURBED_AREA :value: (48, (148, 118, 0)) .. py:attribute:: CONIFEROUS_TREES :value: (50, (50, 150, 50)) .. py:attribute:: SMALL_CONIFEROUS_TREES :value: (51, (0, 151, 151)) .. py:attribute:: BROADLEAVED_TREES :value: (55, (55, 255, 0)) .. py:attribute:: SMALL_BROADLEAVED_TREES_SHRUBS :value: (56, (156, 255, 156)) .. py:attribute:: NODATA_BLACK :value: (100, (0, 0, 0), 'Nodata', '') .. py:method:: reference() -> str :classmethod: Return the reference .. py:method:: colors(rgba: bool = False) -> list[tuple[int, int, int] | tuple[int, int, int, int]] :classmethod: Return the color of the class as a tuple (R, G, B) .. py:method:: codes() :classmethod: Return the code of the class as integer .. py:method:: plot_legend(figax=None) :classmethod: Return the color of the class as a tuple (R, G, B) .. py:method:: cmap() -> matplotlib.pyplot.cm :classmethod: Return the colormap of the class .. py:method:: norm() -> matplotlib.colors.BoundaryNorm :classmethod: Return the norm of the class .. py:method:: texts() :classmethod: Return the text of the class as a string .. py:method:: EAGLE_codes() :classmethod: Return the EAGLE code of the class as string .. py:method:: colors2codes(array: numpy.ndarray | PIL.Image.Image, aswolf: bool = True) -> numpy.ndarray :classmethod: Convert the color of the class to the code of the class :param array: numpy array or PIL image .. py:method:: codes2colors(array: numpy.ndarray, asimage: bool = False) -> numpy.ndarray | PIL.Image.Image :classmethod: Convert the code of the class to the color of the class :param array: numpy array or PIL image .. py:method:: getwolfpalette() -> wolfhece.wolf_array.wolfpalette :classmethod: Get the wolf palette for the class .. py:function:: get_LifeWatch_bounds(year: int, xmin: float, ymin: float, xmax: float, ymax: float, format: Literal[wolfhece.wolf_array.WolfArray, NUMPY, RGB, RGBA, Palette] = 'WolfArray', force_size: bool = True) -> wolfhece.wolf_array.WolfArray | numpy.ndarray | PIL.Image.Image .. py:function:: get_LifeWatch_Wallonia(year: int, format: Literal[wolfhece.wolf_array.WolfArray, NUMPY, RGB, RGBA, Palette] = 'WolfArray') -> wolfhece.wolf_array.WolfArray | numpy.ndarray | PIL.Image.Image Get the Wallonia LifeWatch map for the given year :param year: year of the map :param asimage: if True, return the image as PIL image, else return numpy array :return: numpy array or PIL image .. py:function:: get_LifeWatch_center_width_height(year: int, x: float, y: float, width: float = 2000, height: float = 2000, format: Literal[wolfhece.wolf_array.WolfArray, NUMPY, RGB, RGBA, Palette] = 'WolfArray') -> wolfhece.wolf_array.WolfArray | numpy.ndarray | PIL.Image.Image Get the LifeWatch map for the given year and center :param year: year of the map :param x: x coordinate of the center :param y: y coordinate of the center :param asimage: if True, return the image as PIL image, else return numpy array :return: numpy array or PIL image .. py:function:: count_pixels(array: numpy.ndarray | wolfhece.wolf_array.WolfArray) -> dict[int, int] Count the number of pixels for each code in the array :param array: numpy array or WolfArray :return: dictionary with the code as key and the number of pixels as value .. py:function:: get_areas(array: numpy.ndarray | wolfhece.wolf_array.WolfArray) -> dict[int, float] Get the areas of each code in the array :param array: numpy array or WolfArray :return: dictionary with the code as key and the area in m² as value