Module fordead.steps.step4_compute_forest_mask
Functions
compute_forest_mask
def compute_forest_mask(
data_directory,
forest_mask_source=None,
list_forest_type=['FF2-00-00', 'FF2-90-90', 'FF2-91-91', 'FF2G61-61'],
dep_path=None,
bdforet_dirpath=None,
path_oso=None,
list_code_oso=[17],
vector_path=None,
path_example_raster=None
)
Compute forest mask
Parameters
----------
data_directory : str
Path of the output directory
forest_mask_source : str
Source of the forest mask, can be 'vector' to use a vector file at vector_path, or the path to a binary raster of 10m resolution with the value 1 on the pixels of interest, 'BDFORET' to use the BD Foret of the IGN, 'OSO' to use the CESBIO's land use map, or None to not use a forest mask and to extend the area of interest to all pixels
list_forest_type : list
List of forest types to be kept in the forest mask, corresponds to the CODE_TFV of the BD FORET. Optionnal, only used if forest_mask_source equals 'BDFORET'
dep_path : str
Path to shapefile containg departements with code insee. Optionnal, only used if forest_mask_source equals 'BDFORET'
bdforet_dirpath : str
Path to directory containing BD FORET. Optionnal, only used if forest_mask_source equals 'BDFORET'
path_oso : str
Path to soil occupation raster, only used if forest_mask_source = 'OSO'
list_code_oso : list
List of values used to filter the soil occupation raster. Only used if forest_mask_source = 'OSO'
vector_path : str
path of shapefile whose polygons will be rasterized as a binary raster with resolution, extent and crs of the raster at path_example_raster. Only used if forest_mask_source = "vector"
path_example_raster : str
Path to raster from which to copy the extent, CRS...
Returns
-------