pycif.plugins.transforms.basic.time_interpolation — API reference

Contents

pycif.plugins.transforms.basic.time_interpolation — API reference#

Configuration reference: time_interpolation plugin

pycif.plugins.transforms.basic.time_interpolation.adjoint.adjoint(transf, inout_datastore, controlvect, obsvect, mapper, di, df, mode, runsubdir, workdir, onlyinit=False, **kwargs)[source]#

Adjoint temporal interpolation: transpose time weights to input grid.

Dispatches to the sparse or array adjoint implementation based on the sampled_out / sparse_out flags.

Parameters:
  • transf (Plugin) – time_interpolation instance.

  • inout_datastore (dict) – mutable datastore.

  • controlvect – unused.

  • obsvect – unused.

  • mapper (dict) – transform mapper.

  • di (datetime) – sub-simulation start date.

  • df (datetime) – sub-simulation end date.

  • mode (str) – 'adj'.

  • runsubdir (str) – unused.

  • workdir (str) – unused.

  • onlyinit (bool) – passed to the sparse/array implementations.

  • **kwargs – forwarded to the sparse/array implementations.

pycif.plugins.transforms.basic.time_interpolation.forward.forward(transf, inout_datastore, controlvect, obsvect, mapper, di, df, mode, runsubdir, workdir, onlyinit=False, save_debug=True, **kwargs)[source]#

Temporally interpolate or re-index data to the output time grid.

Dispatches to either the sparse (observation-indexed DataFrame) or array (gridded xarray) implementation based on the sampled_out and sparse_out flags in the mapper:

  • Sparse/sampled outputforward(): resamples or re-indexes observation DataFrames to the output dates.

  • Array outputforward(): applies linear temporal interpolation to gridded xarray fields.

Parameters:
  • transf (Plugin) – time_interpolation instance (carries method, nthreads, and interpolation index metadata).

  • inout_datastore (dict) – mutable datastore.

  • controlvect – unused.

  • obsvect – unused.

  • mapper (dict) – transform mapper (carries sparse_data, sampled, and date index metadata per tracer).

  • di (datetime) – sub-simulation start date.

  • df (datetime) – sub-simulation end date.

  • mode (str) – 'fwd' or 'tl'.

  • runsubdir (str) – unused.

  • workdir (str) – unused.

  • onlyinit (bool) – passed to the sparse/array implementations.

  • save_debug (bool) – if True, save intermediate results for debugging.

  • **kwargs – forwarded to the sparse/array implementations.