sup3r.bias.bias_calc_vortex.BiasCorrectUpdate#

class BiasCorrectUpdate[source]#

Bases: object

Class for bias correcting existing files and writing corrected files.

Methods

get_bc_factors(bc_file, dset, month[, ...])

Get bias correction factors for the given dset and month

run(in_file, out_file, dset, bc_file[, ...])

Run bias correction update.

update_file(in_file, out_file, dset, bc_file)

Update the in_file with bias corrected values for the given dset and write to out_file.

classmethod get_bc_factors(bc_file, dset, month, global_scalar=1)[source]#

Get bias correction factors for the given dset and month

Parameters:
  • bc_file (str) – Name of h5 file containing bias correction factors

  • dset (str) – Name of dataset to apply bias correction factors for

  • month (int) – Index of month to bias correct

  • global_scalar (float) – Optional global scalar to multiply all bias correction factors. This can be used to improve systemic bias against observation data.

Returns:

factors (ndarray) – Array of bias correction factors for the given dset and month.

classmethod update_file(in_file, out_file, dset, bc_file, global_scalar=1, max_workers=None)[source]#

Update the in_file with bias corrected values for the given dset and write to out_file.

Parameters:
  • in_file (str) – Name of h5 file containing data to bias correct

  • out_file (str) – Name of h5 file containing bias corrected data

  • dset (str) – Name of dataset to bias correct

  • bc_file (str) – Name of file containing bias correction factors for the given dset

  • global_scalar (float) – Optional global scalar to multiply all bias correction factors. This can be used to improve systemic bias against observation data.

  • max_workers (int | None) – Number of workers to use for parallel processing.

classmethod run(in_file, out_file, dset, bc_file, overwrite=False, global_scalar=1, max_workers=None)[source]#

Run bias correction update.

Parameters:
  • in_file (str) – Name of h5 file containing data to bias correct

  • out_file (str) – Name of h5 file containing bias corrected data

  • dset (str) – Name of dataset to bias correct

  • bc_file (str) – Name of file containing bias correction factors for the given dset

  • overwrite (bool) – Whether to overwrite the output file if it already exists.

  • global_scalar (float) – Optional global scalar to multiply all bias correction factors. This can be used to improve systemic bias against observation data.

  • max_workers (int | None) – Number of workers to use for parallel processing.