Choosing the run mode
The modspa_pixel scripts can run in two different modes:
pixel mode: this mode is the default running mode. All the inputs (NDVI, weather, land cover and soil data) are rasterized on the same grid (same projection, resolution, input rasters perfeclty overlap) and the model is run independently for each pixel (vectorized with
numpy
andnumba
). The output is anetCDF4
datacube (1 time and 2 space dimensions) containing by default 6 variables (evaporation, transpiration, soil water content of the evaporative and root zone, simulated irrigation and deep percolation), additionnal variables can be written in that datacube.parcel mode: this is the original running mode of the modspa script. A shapefile containing the field geometries and land covers is used to generate dataframes for the inputs: input values are averaged on the parcel for each date. Those dataframes are converted to
netCDF4
datasets (of dimensions{time, 1, number of parcels}
) in order to have the same format as the pixel mode. The ouput dataset is then converted back to a dataframe for plotting or analysis.
In both running modes, the same function is used to run the model, only the input preparation and the output processing change.
The running mode can be choosen in the json config file, given correct inputs the script manages the rest of the conversions. Output plotting scripts also exist for the two modes.