Weather Model API

class rwgen.WeatherModel(spatial_model, input_timeseries, output_folder, latitude, longitude, predictors='default', input_variables='default', output_variables='default', season_length='month', wet_threshold=0.2, dem=None, residual_method='default', wind_height=10.0, xmin=None, xmax=None, ymin=None, ymax=None, point_metadata=None)
__init__(spatial_model, input_timeseries, output_folder, latitude, longitude, predictors='default', input_variables='default', output_variables='default', season_length='month', wet_threshold=0.2, dem=None, residual_method='default', wind_height=10.0, xmin=None, xmax=None, ymin=None, ymax=None, point_metadata=None)

Initialise weather model to simulate temperature, potential evapotranspiration and other weather variables.

Parameters:
  • spatial_model (bool) – Flag to indicate whether point or spatial model.

  • input_timeseries (str) – Path to file containing timeseries data (for point model) or folder containing timeseries data files (for spatial model). Currently compulsory.

  • output_folder (str) – Root folder for model output.

  • latitude (int or float) – Latitude in decimal degrees (negative for southern hemisphere).

  • longitude (int or float) – Longitude in decimal degrees (negative for western hemisphere).

  • predictors (dict or str) – Predictors for each variable for each (wet/dry) transition state. Leave as ‘default’ for now.

  • input_variables (list of str) – List of input variables for weather/PET simulation (corresponding with column names in input file(s)). Leave as ‘default’ for now, which is ['temp_avg', 'dtr', 'vap_press', 'wind_speed', 'sun_dur'].

  • output_variables (list or str) – List of output variables. If ‘default’ then the list is [‘pet’, ‘tas’].

  • season_length (str) – Default is to run the weather model on a monthly basis, with ‘half-month’ under development as an option.

  • wet_threshold (float) – Threshold used to identify wet days (in mm/day).

  • wind_height (int or float) – Measurement height for wind speed data (metres above ground).

  • dem (str) – Only None acceptable currently.

  • residual_method (str) – Only ‘default’ available currently.

  • xmin (int or float) – Minimum easting (in metres) of domain bounding box for spatial model.

  • xmax (int or float) – Maximum easting (in metres) of domain bounding box for spatial model.

  • ymin (int or float) – Minimum northing (in metres) of domain bounding box for spatial model.

  • ymax (int or float) – Maximum northing (in metres) of domain bounding box for spatial model.

  • point_metadata (pandas.DataFrame or str) – Metadata (or path to metadata file) on point (site/gauge) locations to use for fitting, simulation and/or evaluation for a spatial model only.

Methods

__init__(spatial_model, input_timeseries, ...)

Initialise weather model to simulate temperature, potential evapotranspiration and other weather variables.

preprocess([max_buffer, min_points, ...])

Read and transform reference series in preparation for model fitting.

fit()

Fit regression models for weather variables.

simulate(rainfall, n_timesteps, year, month, ...)

Simulate weather and potential evapotranspiration variables for one month.