Understanding the json config file

All the global paramters for the modspa processing chain are located in the json (/modspa_pixel/config/config_modspa.json).

This allows you to choose where and how to run the modspa_pixel processing chain. Different parts of the processing chain are detailed in the inputs and samir sections.

Example of a configuration file:

{
    "_comment": "Sart date of the period on which the model will run",
    "start_date": "2020-01-01",

    "_comment": "End date of the period on which the model will run",
    "end_date": "2020-12-31",

    "_comment": "Path to eodag configuration file for sentinel-2 image download",
    "path_to_eodag_config_file": "/home/auclairj/.config/eodag/eodag.yml",

    "_comment": "Path to the shapefile to run the model on",
    "shapefile_path": "/mnt/e/DATA/SCIHUB/boundary.shp",

    "_comment": "Path to the directory on which the satellite image data will be downloaded",
    "download_path": "/mnt/e/DATA",

    "_comment": "output path for netcdf era5 files (Weather)",
    "era5_path": "/mnt/e/DATA/WEATHER",

    "_comment": "Name of the current run, all output files will be saved under a subdirectory of Saves/ with that name, log file will also have that name",
    "run_name": "TEST",

    "_comment": "Prefered S2 data provider, choices = theia, copernicus",
    "preferred_provider": "copernicus",

    "_comment": "Overwrite NDVI images or not (set to true if you want the code to rewrite NDVI images, takes longer)",
    "ndvi_overwrite": false,

    "_comment": "Maximum cloud cover percentage to download data, images with higher cloud cover will not be downloaded",
    "cloud_cover_limit": 80,

    "_comment": "Max number of processor cores to use for multiprocessing calculations",
    "max_cpu": 4,

    "_comment": "Max amount of RAM memory (in GiB) to use for calculations",
    "max_ram": 16
}

Parameter detail:

  1. start_date: str, start date of the simulation in YYYY-MM-DD format.

  2. end_date: str, end date of the simulation in YYYY-MM-DD format.

  3. path_to_eodag_config_file: str, path to the configuration file of the eodag module. This is needed to download sentinel-2 images to your machine.

  4. shapefile_path: str, path to open the shapefile that defines your parcels (in parcel mode) or delimits the window on which you want to run the model (in pixel mode).

  5. download_path: str, path to directory where the raw input data will be downloaded. Subdirectories will be created for each input type (optical imagery, weather data, soil data, land cover data).

Warning

For large spatial windows or over long time windows, make sure to have enough disk space for all the input (raw and preprocessed).

  1. run_name: all preprocessed input files and output files will be saved in a directory with this name. Files will also carry the run_name in their name.

  2. preferred_provider: str, choose between Copernicus or Theia sentinel-2 images (the atmospheric corrections are different for the two providers).

  3. ndvi_overwrite: bool, choose weather to rewrite the NDVI data cube (true = rewrite, false = don't rewrite).

Warning

The calculation of the NDVI data cube can take some time for large spatial windows and long time windows depending on your machine (up to an hour or more).

  1. cloud_cover_limit: int, the eodag module has an option to filter out images with more than a certain percentage of cloud cover (0 % is no clouds). These images will not be downloaded.

  2. max_cpu: int, maximum number of processor cores to use for calculation, the more the faster operations will be completed. Beware not to overload your machine. Set wisely when using the chain on a high performance cluster.

  3. max_ram: int, maximum amount of RAM memory (in GiB) to allocate for calculation, the more the faster operations will be completed. Large spatial windows or long time windows can make the chain very hungry for RAM, make sure to set an amount that your machine/cluster can support.

Note

A graphical interface to modify the json configuration file is planned for later versions.