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

Contents

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

Configuration reference: vertical_interpolation plugin

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

Adjoint vertical interpolation: scatter observation sensitivities back to model levels.

Dispatches to the sparse or array adjoint implementation. For sparse output (observation-indexed data), scatters adj_out from each observation back to the model level(s) it corresponds to. For array output, applies the transposed interpolation weights.

Parameters:
  • transf (Plugin) – vertical_interpolation instance (carries sparse_out, sampled_out).

  • 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) – if True (array path), return immediately.

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

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

Vertically interpolate model fields to observation pressure/height levels.

Dispatches to either the sparse/sampled or gridded (array) implementation:

  • Sparse/sampled outputsparse_forward(): extracts model values at the observation vertical coordinate.

  • Array outputarray_forward(): applies the configured interpolation method (static-levels, linear, closest, match-layer, or layer-weighted) to the full gridded field.

Parameters:
  • transf (Plugin) – vertical_interpolation instance (carries method, coord_in, coord_out, ignore_level, and optional file_statlev).

  • inout_datastore (dict) – mutable datastore.

  • controlvect – unused.

  • obsvect – unused.

  • mapper (dict) – transform mapper (carries sparse_data, sampled, and domain objects).

  • 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.

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