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, save_path: str, scaling_dict: dict = {'DP': 100, 'E': 1000, 'Irr': 100, 'SWCe': 1000, 'SWCr': 1000, 'Tr': 1000}, additional_outputs: dict | 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. save_path: str

    path to save the model outputs

  7. scaling_dict: dict default = {'E': 1000, 'Tr': 1000, 'SWCe': 1000, 'SWCr': 1000, 'DP': 100, 'Irr': 100}

    scaling dictionnary for the nominal outputs

  8. additional_outputs: dict default = None

    dictionnary containing the names and scale factors of potential additional outouts

  9. available_ram: int default = 8

    available RAM in GiB for the model

  10. 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, params: dict, Dr0: ndarray, Dd0: ndarray, Zr0: ndarray, E0: ndarray, Tr0: ndarray, Dei0: ndarray, Dep0: ndarray, iday: int, scaling_dict: dict) 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. params: dict

    dictionnary containing the rasterized samir parameters and their scale factors

  7. Dr0: np.ndarray

    previous day root layer depletion

  8. Dd0: np.ndarray

    previous day deep layer depletion

  9. Zr0: np.ndarray

    previous day root depth

  10. E0: np.ndarray previous day surface evaporation

  11. Tr0: np.ndarray previous day plant transpiration

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

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

  14. iday: int current loop counter

  15. scaling_dict: dict scaling dictionnary for the nominal outputs

Returns

  1. current_day_outouts: Tuple[np.ndarray]

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