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

  1. csv_param_file: str

    SAMIR csv parameter file

  2. ndvi_cube_path: str

    path to ndvi cube

  3. weather_path: str

    path to weather cube

  4. soil_params_path: str

    path to soil dataset

  5. land_cover_path: str

    path to land cover raster

  6. Kcb_max_obs_path: str

    path to netCDF containing a single array of maximum observed Kcb values

  7. save_path: str

    path to save the model outputs

  8. scaling_dict: Dict[str, int] default = {'E': 1000, 'Tr': 1000, 'SWCe': 1000, 'SWCr': 1000, 'DP': 100, 'Irr': 100}

    scaling dictionnary for the nominal outputs

  9. additional_outputs: Dict[str, int] default = None

    dictionnary containing the names and scale factors of potential additional outouts

  10. available_ram: int default = 8 available RAM in GiB for the model

  11. available_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

  1. NDVI: np.ndarray

    input NDVI

  2. ET0: np.ndarray

    input ET0

  3. Rain: np.ndarray

    input Rain

  4. Wfc: np.ndarray

    field capacity

  5. Wwp: np.ndarray

    field wilting point

  6. Kcb_max_obs: np.ndarray

    observed maximum value of Kcb

  7. Irrig_test: np.ndarray

    boolean array that is true after the Kcb has reached 80% of its maximum

  8. params: Dict[str, np.ndarray]

    dictionnary containing the rasterized samir parameters and their scale factors

  9. Dr0: np.ndarray

    previous day root layer depletion

  10. Dd0: np.ndarray previous day deep layer depletion

  11. Zr0: np.ndarray previous day root depth

  12. E0: np.ndarray previous day surface evaporation

  13. Tr0: np.ndarray previous day plant transpiration

  14. Dei0: np.ndarray previous day surface layer depletion for irrigation part

  15. Dep0: np.ndarray previous day surface layer depletion for precipitation part

  16. iday: int current loop counter

  17. scaling_dict: Dict[str, int] scaling dictionnary for the nominal outputs

  18. additional_outputs: Dict[str, int] dictionary containing the names of additional output data and their integer scale

  19. additional_outputs_data: List[np.ndarray] list of numpy arrays containing the scaled values of the additional outputs

  20. time_slice: int value of the current time slice, used to correctly write additional output data

Returns

  1. current_day_outouts: Tuple[np.ndarray]

    multiple numpy.ndarray arrays are returned as a tuple for current day