Create climate data

AUTHORS: Julien Ruffault (julien.ruff@gmail.com), Nicolas Martin-StPaul (nicolas.martin@inrae.fr)

source

create_climate_data

 create_climate_data (simulation_parameters:Dict, modeling_options:Dict,
                      file_path:pathlib.Path, sep:str=';')

Create a climate data.frame to run SureauR. Read input climate data select the desired period and put it in the right format to run run.SurEauR Also check data consistency and input variables according to modeling options (see and simulation parameters (see \code{create.simulation.parameters)

Type Default Details
simulation_parameters typing.Dict Dictionary created using the create_simulation_parameters function
modeling_options typing.Dict Dictionary created using the create_modeling_options function
file_path Path Path to the input CSV climate file. i.e. path/to/file/climate.csv
sep str ; CSV file separator can be ‘,’ or ‘;’
Returns pandera.typing.pandas.DataFrame[main.ClimateDataValidation]

source

ClimateDataValidation

 ClimateDataValidation (*args, **kwargs)

Schema for validating the climate data

Example: Create climate dataframe

simulation_parameters_dict = create_simulation_parameters(
    main_dir="./sample_data",
    start_year_simulation=1991,
    end_year_simulation=1991,
    output_type=None,
    output_path="./sample_data",
    overwrite=True,
    resolution_output="subdaily",
)
modeling_options_dict = create_modeling_options(
    time_step_for_evapo=2,
    reset_swc=True,
    avoid_water_soil_transfer=True,
    constant_climate=False,
    defoliation=True,
    soil_evapo=True,
    threshold_mortality=51,
    etp_formulation="pt",
    rn_formulation="linear",
    comp_options_for_evapo="custom",
    stomatal_reg_formulation="turgor",
    transpiration_model="jarvis",
    numerical_scheme="implicit",
    pedo_transfer_formulation="vg",
)
create_climate_data(
    modeling_options=modeling_options_dict,
    simulation_parameters=simulation_parameters_dict,
    file_path="./sample_data/climat_example.csv",
    sep=";",
)
365 days were selected in the input climate file, covering the period: 1991 - 1991
DATE Tair_min Tair_max Tair_mean RG_sum RHair_min RHair_max RHair_mean WS_mean PPT_sum day_of_year day_of_month month year
365 1991-01-01 2.6 7.3 4.95 3.20 95.160421 95.160421 95.160421 3.1 1.2 1 1 1 1991
366 1991-01-02 3.5 9.0 6.25 0.76 90.403122 95.000000 92.701561 5.8 9.8 2 2 1 1991
367 1991-01-03 8.5 10.7 9.60 1.16 92.731052 95.000000 93.865526 4.8 4.8 3 3 1 1991
368 1991-01-04 3.4 9.6 6.50 1.16 96.644009 96.644009 96.644009 2.6 5.0 4 4 1 1991
369 1991-01-05 2.3 6.3 4.30 3.25 96.915145 96.915145 96.915145 5.4 1.0 5 5 1 1991
... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
725 1991-12-27 4.1 6.6 5.35 2.23 85.326980 95.000000 90.163490 1.9 0.2 361 27 12 1991
726 1991-12-28 -1.5 5.9 2.20 4.19 96.915145 96.915145 96.915145 1.4 0.0 362 28 12 1991
727 1991-12-29 -2.6 4.0 0.70 4.72 96.915145 96.915145 96.915145 1.4 0.0 363 29 12 1991
728 1991-12-30 2.4 4.4 3.40 1.19 96.915145 96.915145 96.915145 1.8 0.0 364 30 12 1991
729 1991-12-31 -0.2 2.7 1.25 0.71 96.915145 96.915145 96.915145 1.7 0.0 365 31 12 1991

365 rows × 14 columns