How the SAMIR functions works
- modspa_pixel.source.modspa_samir.run_samir(csv_param_file: str, ndvi_cube_path: str, weather_path: str, soil_params_path: str, land_cover_path: str, Kcb_max_obs_path: str, save_path: str, scaling_dict: Dict[str, int] = {'DP': 100, 'E': 1000, 'Irr': 100, 'SWCe': 1000, 'SWCr': 1000, 'Tr': 1000}, additional_outputs: Dict[str, int] | None = None, available_ram: int = 8, available_cpu: int = 4) None [source]
Run the SAMIR model on the prepared inputs. Calls the
samir_daily()
in a time loop. Maximizes memory usage with given limits to run faster.Arguments
- csv_param_file:
str
SAMIR csv parameter file
- csv_param_file:
- ndvi_cube_path:
str
path to ndvi cube
- ndvi_cube_path:
- weather_path:
str
path to weather cube
- weather_path:
- soil_params_path:
str
path to soil dataset
- soil_params_path:
- land_cover_path:
str
path to land cover raster
- land_cover_path:
- Kcb_max_obs_path:
str
path to netCDF containing a single array of maximum observed Kcb values
- Kcb_max_obs_path:
- save_path:
str
path to save the model outputs
- save_path:
- scaling_dict:
Dict[str, int]
default = {'E': 1000, 'Tr': 1000, 'SWCe': 1000, 'SWCr': 1000, 'DP': 100, 'Irr': 100}
scaling dictionnary for the nominal outputs
- scaling_dict:
- additional_outputs:
Dict[str, int]
default = None
dictionnary containing the names and scale factors of potential additional outouts
- additional_outputs:
available_ram:
int
default = 8
available RAM in GiB for the modelavailable_cpu:
int
default = 4
number of available physical CPU cores
Returns
None
- modspa_pixel.source.modspa_samir.samir_daily(NDVI: ndarray, ET0: ndarray, Rain: ndarray, Wfc: ndarray, Wwp: ndarray, Kcb_max_obs: ndarray, Irrig_test: ndarray, params: Dict[str, ndarray], Dr0: ndarray, Dd0: ndarray, Zr0: ndarray, E0: ndarray, Tr0: ndarray, Dei0: ndarray, Dep0: ndarray, iday: int, scaling_dict: Dict[str, int], additional_outputs: Dict[str, int], additional_outputs_data: List[ndarray], time_slice: int) Tuple[ndarray] [source]
Run the SAMIR model on a single day. Inputs and outputs are numpy.ndarray. Calls functions compiled with numba for intermediary calculations.
Arguments
- NDVI:
np.ndarray
input NDVI
- NDVI:
- ET0:
np.ndarray
input ET0
- ET0:
- Rain:
np.ndarray
input Rain
- Rain:
- Wfc:
np.ndarray
field capacity
- Wfc:
- Wwp:
np.ndarray
field wilting point
- Wwp:
- Kcb_max_obs:
np.ndarray
observed maximum value of Kcb
- Kcb_max_obs:
- Irrig_test:
np.ndarray
boolean array that is true after the Kcb has reached 80% of its maximum
- Irrig_test:
- params:
Dict[str, np.ndarray]
dictionnary containing the rasterized samir parameters and their scale factors
- params:
- Dr0:
np.ndarray
previous day root layer depletion
- Dr0:
Dd0:
np.ndarray
previous day deep layer depletionZr0:
np.ndarray
previous day root depthE0:
np.ndarray
previous day surface evaporationTr0:
np.ndarray
previous day plant transpirationDei0:
np.ndarray
previous day surface layer depletion for irrigation partDep0:
np.ndarray
previous day surface layer depletion for precipitation partiday:
int
current loop counterscaling_dict:
Dict[str, int]
scaling dictionnary for the nominal outputsadditional_outputs:
Dict[str, int]
dictionary containing the names of additional output data and their integer scaleadditional_outputs_data:
List[np.ndarray]
list of numpy arrays containing the scaled values of the additional outputstime_slice:
int
value of the current time slice, used to correctly write additional output data
Returns
- current_day_outouts: Tuple[np.ndarray]
multiple numpy.ndarray arrays are returned as a tuple for current day