sup3r.utilities.utilities

sup3r.utilities.utilities#

Miscellaneous utilities shared across multiple modules

Functions

generate_random_string(length)

Generate random string with given length.

nn_fill_array(array)

Fill any NaN values in an np.ndarray from the nearest non-nan values.

pd_date_range(*args, **kwargs)

A simple wrapper on the pd.date_range() method that handles the closed vs.

preprocess_datasets(dset)

Standardization preprocessing applied before datasets are concatenated by xr.open_mfdataset

safe_cast(o)

Cast to type safe for serialization.

safe_serialize(obj, **kwargs)

json.dumps with non-serializable object handling.

spatial_coarsening(data[, s_enhance, obs_axis])

Coarsen data according to s_enhance resolution

temporal_coarsening(data[, t_enhance, method])

Coarsen data according to t_enhance resolution

xr_open_mfdataset(files, **kwargs)

Wrapper for xr.open_mfdataset with default opening options.

Classes

Timer()

Timer class for timing and storing function call times.