Skip to content

Module fordead.steps.step1_compute_masked_vegetationindex

Functions

compute_masked_vegetationindex

def compute_masked_vegetationindex(
    input_directory,
    data_directory,
    start_date='2015-01-01',
    lim_perc_cloud=0.4,
    interpolation_order=0,
    sentinel_source='theia',
    apply_source_mask=False,
    soil_detection=True,
    formula_mask='(B2 >= 700)',
    vi='CRSWIR',
    compress_vi=False,
    ignored_period=None,
    extent_shape_path=None,
    path_dict_vi=None,
    progress=True
)
Computes masks and masked vegetation index for each SENTINEL date under a cloudiness threshold.
Masks include shadows, clouds, soil, pixels ouside satellite swath, and the mask from SENTINEL data provider if the option is chosen.
Results are written in the chosen directory.
See details here : https://fordead.gitlab.io/fordead_package/docs/user_guides/english/01_compute_masked_vegetationindex/

Parameters
----------
input_directory : str
    Path of the directory with Sentinel dates
data_directory : str
    Path of the output directory
start_date : str
    First date to process, dates before this date will be ignored. Format : 'YYYY-MM-DD'
lim_perc_cloud : float
    Maximum cloudiness at the tile scale, used to filter used SENTINEL dates. Set parameter as -1 to not filter based on cloudiness
interpolation_order : int
    interpolation order for bands at 20m resolution : 0 = nearest neighbour, 1 = linear, 2 = bilinéaire, 3 = cubique
sentinel_source : str
    Source of data, can be 'theia' et 'scihub' et 'peps'
apply_source_mask : bool
    If True, applies the mask from SENTINEL-data supplier
soil_detection : bool
    If True, bare ground is detected and used as mask, but the process has not been tested on other data than THEIA data in France (see https://fordead.gitlab.io/fordead_package/docs/user_guides/english/01_compute_masked_vegetationindex/). If False, mask from formula_mask is applied.
formula_mask : str
    formula whose result would be binary, as described here https://fordead.gitlab.io/fordead_package/reference/fordead/masking_vi/#compute_vegetation_index. Is only used if soil_detection is False.
vi : str
    Chosen vegetation index
compress_vi : bool
    If True, stores the vegetation index as low-resolution floating-point data as small integers in a netCDF file. Uses less disk space but can lead to very small difference in results as the vegetation index is rounded to three decimal places
ignored_period : list of two strings
    Period whose Sentinel dates to ignore (format 'MM-DD', ex : ["11-01","05-01"])
extent_shape_path : str
    Path of shapefile used as extent of detection, if None, the whole tile is used
path_dict_vi : str
    Path of text file to add vegetation index formula, if None, only built-in vegetation indices can be used (CRSWIR, NDVI)
progress : bool, optional
    Whether to show a progress bar. Defaults to True.