pycif.plugins.controlvects.standard — API reference

pycif.plugins.controlvects.standard — API reference#

Configuration reference: standard plugin

pycif.plugins.controlvects.standard.build_full_b.build_b_block(controlvect, tracer)[source]#

Build the B matrix block corresponding to ‘tracer’

Parameters:
  • controlvect (ControlVect) – the controlvector plugin

  • tracer (tracer plugin) – the tracer to compute the corresping B block

Returns:

B matrix block

Return type:

2D array

pycif.plugins.controlvects.standard.build_full_b.build_b(controlvect, component=None, parameter=None)[source]#

Compute the full B matrix

Parameters:
  • controlvect (ControlVect) – the controlvector plugin

  • component (str, optional) – only compute B block for a given tracer (‘component’, ‘tracer’). Must be used with the ‘tracer’ argument. Defaults to None.

  • parameter (str, optional) – only compute B block for a given tracer (‘component’, ‘tracer’). Must be used with the ‘component’ argument. Defaults to None.Defaults to None.

Returns:

B matrix

Return type:

2D array

pycif.plugins.controlvects.standard.crop.crop(self, datei, datef)[source]#

Crop the control vector temporally

Parameters:
  • self

  • datei

  • datef

pycif.plugins.controlvects.standard.dump.dump(self, cntrl_file, to_netcdf=False, dir_netcdf=None, ensemble=False, **kwargs)[source]#

Dumps a control vector into a pickle file. Does not save large correlations.

Parameters:
  • self (pycif.utils.classes.controlvects.ControlVect) – the Control Vector to dump

  • cntrl_file (str) – path to the file to dump as pickle

  • to_netcdf (bool) – save to netcdf files if True

  • dir_netcdf (str) – root path for the netcdf directory

pycif.plugins.controlvects.standard.dump.load(self, cntrl_file, component2load=None, tracer2load=None, target_tracer=None, ensemble=False, **kwargs)[source]#
pycif.plugins.controlvects.standard.init_bprod.init_bprod(cntrlv, options={}, **kwargs)[source]#

Initilializes the product of chi by sqrt-B. It allows translating information from the minimization space to the control space. This first needs to initialize correlation matrices

Parameters:

cntrlv (dict) – definition of the control vector

Return type:

updated control vector

pycif.plugins.controlvects.standard.init_structure.init_structure(cntrlv, **kwargs)[source]#

Initializes the prior control vector. Loops over all components and tracers and process temporal and horizontal resolution.

Parameters:
  • cntrlv (Plugin) – definition of the control vector.

  • datei (datetime) – initial date of the inversion window

  • datei – end date of the inversion window

pycif.plugins.controlvects.standard.init_xb.init_xb(cntrlv, trid, **kwargs)[source]#

Initializes the prior control vector. Loops over all components and tracers and process temporal and horizontal resolution.

Parameters:
  • cntrlv (Plugin) – definition of the control vector.

  • datei (datetime) – initial date of the inversion window

  • datei – end date of the inversion window

pycif.plugins.controlvects.standard.sqrtbprod.sqrtbprod(cntrlv, chi, inverse=False, ensemble=False, **kwargs)[source]#

Multiplies Chi by B**0.5.

pycif.plugins.controlvects.standard.sqrtbprod.sqrtbprod_ad(cntrlv, dx, inverse=False, compute_sqrt=True, **kwargs)[source]#