pycif.plugins.modes.analytic — API reference#
Configuration reference: analytic plugin
- pycif.plugins.modes.analytic.basefunctions.check_base_functions(base_dir, statedim)[source]#
Return the list of base-function indices that have not yet been computed.
- Parameters:
base_dir (str) – directory where base function obs-vectors are stored (
obsvect_NNNNsub-directories).statedim (int) – total number of control-vector dimensions.
- Returns:
indices
iinrange(statedim)for whichobsvect_NNNNis absent from base_dir.- Return type:
list[int]
- pycif.plugins.modes.analytic.basefunctions.compute_base_functions(self, controlvect, list_base_functions, dryrun, sequential)[source]#
Submit one forward pyCIF run per missing base-function dimension.
For each index in list_base_functions, sets the prior control vector to a Dirac vector (all zeros except dimension i = 1), dumps a tailored YAML configuration, and submits the run via the platform plugin. Waits for all jobs to finish, then moves the resulting obs-vector directories into the H-matrix sub-directory.
- Parameters:
self (Plugin) – mode plugin providing
workdir,platform, anddump_nc_base_controlattributes.controlvect – control vector plugin (modified in-place; restored to its original
xbon return).list_base_functions (list[int]) – indices of the control-vector dimensions for which base functions must be (re-)computed.
dryrun (bool) – if
True, submit only the first dimension to estimate the forward run cost, then return.sequential (bool) – if
True, wait for each job to finish before submitting the next one.
- pycif.plugins.modes.analytic.build_H.build_H(controlvect, obsvect, base_dir)[source]#
Assemble the full observation operator matrix H from pre-computed base functions.
Reads each base-function obs-vector from base_dir and fills the corresponding column of the H matrix. Dumps the result as a pickle file (
H.pickle) in base_dir.- Parameters:
controlvect – control vector plugin providing
dimand component metadata.obsvect – observation vector plugin providing
dimand per-tracer pointer / dimension attributes.base_dir (str) – directory containing
obsvect_NNNNsub-directories (one per control-vector dimension) and whereH.picklewill be written.
- Returns:
H matrix of shape
(obs_dim, control_dim).- Return type:
np.ndarray
- Raises:
Exception – if the datavect has no
componentsattribute (no observations configured).