sup3r.bias.utilities.bias_correct_feature

sup3r.bias.utilities.bias_correct_feature#

bias_correct_feature(source_feature, input_handler, bc_method, bc_kwargs, time_slice=None)[source]#

Bias correct data using a method defined by the bias_correct_method input to ForwardPassStrategy

Parameters:
  • source_feature (str) – The source feature name corresponding to the output feature name

  • input_handler (DataHandler) – DataHandler storing raw input data previously used as input for forward passes. This is assumed to have data with shape (lats, lons, time, features), which can be accessed through the handler with handler[feature, lat_slice, lon_slice, time_slice]

  • bc_method (Callable) – Bias correction method from bias_transforms.py

  • bc_kwargs (dict) – Dictionary of keyword arguments for bc_method

  • time_slice (slice | None) – Optional time slice to restrict bias correction domain

Returns:

data (Union[np.ndarray, da.core.Array]) – Data corrected by the bias_correct_method ready for input to the forward pass through the generative model.