wolfhece.lifewatch

Module Contents

wolfhece.lifewatch.YEARS = [2006, 2010, 2015, 2018, 2019, 2020, 2021, 2022][source]
wolfhece.lifewatch.PIXEL_SIZE = 2[source]
wolfhece.lifewatch.MAP_LW = 'LW_ecotopes_lc_hr_raster'[source]
wolfhece.lifewatch.MAX_PIXELS = 2048[source]
class wolfhece.lifewatch.LifeWatch_Legend[source]

Bases: enum.Enum

Inheritance diagram of wolfhece.lifewatch.LifeWatch_Legend

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

property code: int[source]
NODATA_WHITE = (0, (255, 255, 255), 'Nodata', '')[source]
WATER = (10, (10, 10, 210))[source]
NATURAL_MATERIAL_SURFACES = (15, (210, 210, 210))[source]
ARTIFICIALLY_SEALED_GROUND_SURFACE = (20, (20, 20, 20))[source]
BUILDING = (21, (210, 0, 0))[source]
HERBACEOUS_ROTATION = (30, (230, 230, 130))[source]
GRASSLAND_INTENSIVE_MANAGEMENT = (35, (235, 170, 0))[source]
GRASSLAND_SCRUB_BIOLOGICAL_INTEREST = (40, (240, 40, 240))[source]
INUNDATED_GRASSLAND_SCRUB_BIOLOGICAL_INTEREST = (45, (145, 245, 245))[source]
VEGETATION_RECENTLY_DISTURBED_AREA = (48, (148, 118, 0))[source]
CONIFEROUS_TREES = (50, (50, 150, 50))[source]
SMALL_CONIFEROUS_TREES = (51, (0, 151, 151))[source]
BROADLEAVED_TREES = (55, (55, 255, 0))[source]
SMALL_BROADLEAVED_TREES_SHRUBS = (56, (156, 255, 156))[source]
NODATA_BLACK = (100, (0, 0, 0), 'Nodata', '')[source]
classmethod reference() str[source]

Return the reference

classmethod colors(rgba: bool = False) list[tuple[int, int, int] | tuple[int, int, int, int]][source]

Return the color of the class as a tuple (R, G, B)

classmethod codes()[source]

Return the code of the class as integer

classmethod plot_legend(figax=None)[source]

Return the color of the class as a tuple (R, G, B)

classmethod cmap() matplotlib.pyplot.cm[source]

Return the colormap of the class

classmethod norm() matplotlib.colors.BoundaryNorm[source]

Return the norm of the class

classmethod texts()[source]

Return the text of the class as a string

classmethod EAGLE_codes()[source]

Return the EAGLE code of the class as string

classmethod colors2codes(array: numpy.ndarray | PIL.Image.Image, aswolf: bool = True) numpy.ndarray[source]

Convert the color of the class to the code of the class :param array: numpy array or PIL image

classmethod codes2colors(array: numpy.ndarray, asimage: bool = False) numpy.ndarray | PIL.Image.Image[source]

Convert the code of the class to the color of the class :param array: numpy array or PIL image

classmethod getwolfpalette() wolfhece.wolf_array.wolfpalette[source]

Get the wolf palette for the class

wolfhece.lifewatch.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[source]
wolfhece.lifewatch.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[source]

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

wolfhece.lifewatch.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[source]

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

wolfhece.lifewatch.count_pixels(array: numpy.ndarray | wolfhece.wolf_array.WolfArray) dict[int, int][source]

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

wolfhece.lifewatch.get_areas(array: numpy.ndarray | wolfhece.wolf_array.WolfArray) dict[int, float][source]

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