rwgen.RainfallModel.perturb_statistics
- RainfallModel.perturb_statistics(change_factors, change_factor_names='default', easting_name='projection_x_coordinate', northing_name='projection_y_coordinate', month_variable='month_number', write_output=True, output_filename='perturbed_statistics.csv')
Perturb reference statistics using a set of change factors.
Updates self.reference_statistics in preparation for fitting.
- Parameters:
change_factors (dict) – Paths to NetCDF files containing change factors for each required duration (e.g. 1H, 24H).
change_factor_names (dict) – Mapping of statistic names used in rwgen to change factor variable names in NetCDF files. See notes for ‘default’ mapping.
easting_name (str) – Name of easting variable in NetCDF files.
northing_name (str) – Name of northing variable in NetCDF files.
month_variable (str) – Name of variable indicating month number associated with each time in the NetCDF files.
write_output (bool) – Flag to write output file containing perturbed statistics.
output_filename (str) – Name of output file
Notes
Change factors are read from NetCDF files. The files should be specified via the
change_factors
argument using e.g.:change_factors={'1H': 'C:/Path/To/1H_ChangeFactors.nc', '24H': 'C:/Path/To/24H_ChangeFactors.nc'}
The default names for mapping rwgen statistics to the change factors in the NetCDF files are specified by the following dictionary:
change_factor_names = { 'mean': 'mean_changefactor_ts1_to_ts3', 'variance': 'variance_changefactor_ts1_to_ts3', 'skewness': 'skewness_changefactor_ts1_to_ts3', 'probability_dry_0.2mm': 'pd_0p2_changefactor_ts1_to_ts3', 'autocorrelation_lag1': 'l1ac_changefactor_ts1_to_ts3', }
Other points to note are:
Perturbation currently works for the point (single site) version of the model only.
Change factors can also only be specified monthly at present.
Only a 0.2mm threshold for dry probability is supported currently.
Only lag-1 autocorrelation is supported.