API Reference¶
This page lists the functions exported by the public pyPDAF
__init__.py files. The top-level namespace contains the functions most
users need for a PDAF3 workflow. The subpackages expose lower-level PDAF,
PDAFomi, localisation, diagnostic, and compatibility routines.
The function names follow PDAF closely. See Variable naming conventions for the
meaning of suffixes such as _p, _l, and _f.
Top-Level Workflow Functions¶
Initialisation and finalisation¶
|
Initialise the PDAF system. |
|
Initialize PDAF3's flexible parallelization layout. |
|
The routine PDAF_init_forecast has to be called once at the end of the initialization of PDAF/start of DA cycles. |
|
Set MPI communicators and parallelisation in PDAF. |
Finalise the PDAF systems including freeing some of the memory used by PDAF. |
Assimilation drivers¶
|
Online ensemble filters and smoothers except for 3DVars for a single DA step using diagnoal observation error covariance matrix. |
|
Offline ensemble filters and smoothers except for 3DVars for a single DA step using diagnoal observation error covariance matrix. |
Online assimilation of domain local filters for a single DA step using non-diagnoal observation error covariance matrix. |
|
Online assimilation of global filters except for 3DVar and stochastic EnKF for a single DA step using non-diagnoal observation error covariance matrix. |
|
Online assimilation of LNETF for a single DA step using non-diagnoal observation error covariance matrix. |
|
Online assimilation of LKNETF for a single DA step using non-diagonal observation error covariance matrix. |
|
Online assimilation of global or Covariance localised stochastic EnKF for a single DA step using non-diagonal observation error covariance matrix. |
|
Online assimilation of global nonlinear filters for a single DA step using non-diagonal observation error covariance matrix. |
|
Offline assimilation of domain local filters for a single DA step using non-diagnoal observation error covariance matrix. |
|
Offline assimilation of global filters except for 3DVar and stochastic EnKF for a single DA step using non-diagnoal observation error covariance matrix. |
|
Offline assimilation of LNETF for a single DA step using non-diagnoal observation error covariance matrix. |
|
Offline assimilation of LKNETF for a single DA step using non-diagonal observation error covariance matrix. |
|
Offline assimilation of global or Covariance localised stochastic EnKF for a single DA step using non-diagonal observation error covariance matrix. |
|
Online assimilation of covariance localised stochastic EnKF for a single DA step using non-diagonal observation error covariance matrix. |
|
Offline assimilation of global nonlinear filters for a single DA step using non-diagonal observation error covariance matrix. |
Variational and hybrid drivers¶
Online assimilation for all types of 3DVar DA for a single DA step using diagonal observation error covariance matrix. |
|
Offline assimilation for all types of 3DVar DA for a single DA step using diagonal observation error covariance matrix. |
|
3DVar DA for a single DA step using non-diagnoal observation error covariance matrix. |
|
3DEnVar for a single DA step using non-diagnoal observation error covariance matrix. |
|
3DEnVar for a single DA step where the ensemble anomaly is generated by LESTKF using non-diagonal observation error covariance matrix. |
|
Hybrid 3DEnVar for a single DA step using non-diagnoal observation error covariance matrix. |
|
Hybrid 3DEnVar for a single DA step using non-diagonal observation error covariance matrix. |
|
Offline 3DVar DA for a single DA step using non-diagonal observation error covariance matrix. |
|
Offline 3DEnVar for a single DA step using non-diagonal observation error covariance matrix. |
|
Offline 3DEnVar for a single DA step where the ensemble anomaly is generated by LESTKF using non-diagonal observation error covariance matrix. |
|
Offline hybrid 3DEnVar for a single DA step using non-diagonal observation error covariance matrix. |
|
Offline hybrid 3DEnVar for a single DA step using non-diagonal observation error covariance matrix. |
Observation generation and hooks¶
|
Generation of synthetic observations based on given error statistics and observation operator. |
Generation of synthetic observations based on given error statistics and observation operator in offline setup. |
|
|
Run PDAF3 pre/post processing in an externally managed model loop. |
|
Run PDAF3 offline pre/post processing. |
Top-level utilities¶
|
Return the number of time steps, current model time, and a flag whether the forecasting should be exited. |
Display version information for PDAF |
|
|
Print the list of available named filter types and their IDs. |
|
Print configuration info of the active filter given subtype |
|
The overview of options for the selected DA method. |
Flush the Fortran standard output buffer. |
|
|
Global error handler that aborts MPI jobs on uncaught exceptions. |
pyPDAF.PDAF Utilities and Legacy Interface¶
Core setup, execution, and information¶
|
Initialise the PDAF system. |
The routine PDAF_init_forecast has to be called once at the end of the initialization of PDAF/start of DA cycles. |
|
Finalise the PDAF systems including freeing some of the memory used by PDAF. |
|
Finalize PDAF and release PDAF-internal resources. |
|
|
Abort the parallel program through PDAF/MPI. |
|
Distribute analysis state vector to an array. |
|
Return the number of time steps, current model time, and a flag whether the forecasting should be exited. |
Perform assimilation after this function call. |
|
Display version information for PDAF |
|
|
Print the list of available named filter types and their IDs. |
|
Print the list of available named DA method types and their IDs. |
|
Print PDAF timing and memory information. |
|
Print configuration info of the active filter given subtype |
|
The overview of options for the selected DA method. |
Flush the Fortran standard output buffer. |
Observation gathering¶
|
Gather the dimension of observation vector across multiple local domains/filter processors. |
|
In the local filters (LESKTF, LETKF, LSEIK, LNETF) this function returns the total observation vector from process-local observations. |
|
In the local filters (LESKTF, LETKF, LSEIK, LNETF) this function returns the full observation coordinates from process-local observation coordinates. |
|
Gather full observation from processor local observation without PDAF-internal info. |
|
Gather full observation coordinates from processor local observation coordinates without PDAF-internal info. |
Localisation helpers¶
|
The value of the chosen correlation function according to the specified length scale. |
|
Get localisation weight for given distance, cut-off radius, support radius, weighting type, and weighting function. |
|
Get a vector of localisation weights for given distances, cut-off radius, support radius, weighting type, and weighting function. |
Random numbers and ensemble generation¶
|
Generate random perturbations with PDAF's random-vector helper. |
|
EOF analysis of an ensemble of state vectors by singular value decomposition. |
|
Generate an ensemble from singular values and their vectors (EOF modes) of an ensemble anomaly matrix. |
|
Reset the forgetting factor manually during the assimilation process. |
Setters¶
|
Set the MPI communicator used by PDAF. |
|
Activate the debug output of the PDAF. |
Return the ensemble in a numpy array. |
|
|
Set integer parameters for PDAF. |
|
Set the ensemble member index to given value. |
|
Activate offline mode of PDAF. |
|
Set floating-point parameters for PDAF. |
|
Set a real-valued GENOBS parameter. |
|
Choose a seedset for the random number generator used in PDAF. |
|
Set PDAF's four-integer random seed vector. |
|
Set PDAF's four-integer random seed vector. |
|
Get a pointer to smoother ensemble. |
Getters and state flags¶
Return the flag that indicates if the DA is performed in the last time step. |
|
Return whether a local filter is used. |
|
The routine returns the information on the localization type of the selected filter. |
|
|
Return the ensemble member id on the current process. |
|
Return the ensemble member id when observation operator is being applied. |
Return PDAF's current four-integer random seed vector. |
|
Return PDAF's current four-integer random seed vector. |
|
Return PDAF's random-number generation counter. |
|
Return PDAF's forecast-time reset flag. |
|
Return the smoothed ensemble in earlier time steps. |
Incremental analysis update¶
|
Initialise parameters for incremental analysis updates, IAU. |
|
Modify the IAU type and the number of IAU time steps during a run |
Set a pointer to the ensemble increments array. |
Diagnostics¶
|
Compute the ensemble mean of the state ensemble. |
|
Compute ensemble standard deviation and ensemble mean without MPI. |
|
Compute ensemble standard deviation and ensemble mean. |
|
Compute ensemble variance/standard deviation and mean without MPI. |
|
Compute ensemble variance/standard deviation and mean. |
|
Compute the root mean squared distance between two vectors without MPI. |
|
Compute the root mean squared distance between two vectors. |
|
Obtain a continuous rank probability score for an ensemble. |
|
Obtain a continuous rank probability score for an ensemble without MPI. |
|
Compute the continuous ranked probability score (CRPS). |
|
Calculating the effective sample size of a particle filter. |
|
Computing the skewness and kurtosis of the ensemble of a given element of the state vector. |
|
Computes the mean, the unbiased variance, the unbiased skewness, and the unbiased excess kurtosis from an ensemble. |
|
Computing the rank histogram of an ensemble. |
|
Compute ensemble reliability budget |
|
Compare two vectors with Taylor-diagram style statistics. |
pyPDAF.PDAF3 Assimilation Interface¶
|
Initialise the PDAF system. |
|
Initialize PDAF3's flexible parallelization layout. |
The routine PDAF_init_forecast has to be called once at the end of the initialization of PDAF/start of DA cycles. |
|
|
Set MPI communicators and parallelisation in PDAF. |
Online ensemble filters and smoothers except for 3DVars for a single DA step using diagnoal observation error covariance matrix. |
|
Offline ensemble filters and smoothers except for 3DVars for a single DA step using diagnoal observation error covariance matrix. |
|
Online assimilation for all types of 3DVar DA for a single DA step using diagonal observation error covariance matrix. |
|
Offline assimilation for all types of 3DVar DA for a single DA step using diagonal observation error covariance matrix. |
|
Online assimilation of domain local filters for a single DA step using non-diagnoal observation error covariance matrix. |
|
Online assimilation of global filters except for 3DVar and stochastic EnKF for a single DA step using non-diagnoal observation error covariance matrix. |
|
Online assimilation of LNETF for a single DA step using non-diagnoal observation error covariance matrix. |
|
Online assimilation of LKNETF for a single DA step using non-diagonal observation error covariance matrix. |
|
Online assimilation of global or Covariance localised stochastic EnKF for a single DA step using non-diagonal observation error covariance matrix. |
|
Online assimilation of global nonlinear filters for a single DA step using non-diagonal observation error covariance matrix. |
|
3DVar DA for a single DA step using non-diagnoal observation error covariance matrix. |
|
3DEnVar for a single DA step using non-diagnoal observation error covariance matrix. |
|
3DEnVar for a single DA step where the ensemble anomaly is generated by LESTKF using non-diagonal observation error covariance matrix. |
|
Hybrid 3DEnVar for a single DA step using non-diagnoal observation error covariance matrix. |
|
Hybrid 3DEnVar for a single DA step using non-diagonal observation error covariance matrix. |
|
Offline assimilation of domain local filters for a single DA step using non-diagnoal observation error covariance matrix. |
|
Offline assimilation of global filters except for 3DVar and stochastic EnKF for a single DA step using non-diagnoal observation error covariance matrix. |
|
Offline assimilation of LNETF for a single DA step using non-diagnoal observation error covariance matrix. |
|
Offline assimilation of LKNETF for a single DA step using non-diagonal observation error covariance matrix. |
|
Offline assimilation of global or Covariance localised stochastic EnKF for a single DA step using non-diagonal observation error covariance matrix. |
|
Online assimilation of covariance localised stochastic EnKF for a single DA step using non-diagonal observation error covariance matrix. |
|
Offline assimilation of global nonlinear filters for a single DA step using non-diagonal observation error covariance matrix. |
|
Offline 3DVar DA for a single DA step using non-diagonal observation error covariance matrix. |
|
Offline 3DEnVar for a single DA step using non-diagonal observation error covariance matrix. |
|
Offline 3DEnVar for a single DA step where the ensemble anomaly is generated by LESTKF using non-diagonal observation error covariance matrix. |
|
Offline hybrid 3DEnVar for a single DA step using non-diagonal observation error covariance matrix. |
|
Offline hybrid 3DEnVar for a single DA step using non-diagonal observation error covariance matrix. |
|
Generation of synthetic observations based on given error statistics and observation operator. |
|
Generation of synthetic observations based on given error statistics and observation operator in offline setup. |
|
|
Run PDAF3 pre/post processing in an externally managed model loop. |
|
Run PDAF3 offline pre/post processing. |
pyPDAF.PDAFomi Observation Module Interface¶
Setup and error handling¶
|
Allocating an array of obs_f derived types instances. |
This function returns the value of the PDAF-OMI internal error flag. |
|
|
Activate the debug output of the PDAFomi. |
Observation storage and metadata¶
|
Gather the dimension of a given type of observation across multiple local domains/filter processors. |
|
This function is used to implement custom observation operators. |
|
Setting the doassim attribute of obs_f for i-th observation type. |
|
Setting the observation localisation distance calculation method for i-th observation type. |
|
Setting the number of spatial dimensions of observations for i-th observation type. |
|
Setting the type of observation error distribution for i-th observation type. |
|
Switch for only use process-local observations for i-th observation type. |
|
Setting innovation threshold for removing observation outliers. |
|
Setting the inverse of observation error variance for omitted observations. |
|
Setting the id_obs_p attribute of obs_f for i-th observation type. |
|
Setting the observation interpolation coefficient for i-th observation type. |
|
Setting the domain periodicity attribute of obs_f for i-th observation type. |
|
Set a name for given observation type |
|
Select the OMI local-observation search algorithm and sort direction. |
Interpolation coefficients¶
|
The coefficient for linear interpolation in 2D on unstructure triangular grid. |
|
The coefficient for linear interpolation in 1D. |
|
The coefficient for linear interpolation up to 3D. |
get_interp_coeff_tri(gpc: np.ndarray, oc: np.ndarray, icoeff: np.ndarray) -> np.ndarray |
|
get_interp_coeff_lin1d(gpc: np.ndarray, oc: float, icoeff: np.ndarray) -> np.ndarray |
|
get_interp_coeff_lin(num_gp: int, n_dim: int, gpc: np.ndarray, oc: np.ndarray, icoeff: np.ndarray) -> np.ndarray |
Observation operators¶
|
A (partial) identity observation operator |
|
Observation operator that average values on given model grid points. |
|
Observation operator for given observed model state. |
|
Observation operator that linearly interpolates model grid values to observation location. |
|
The adjoint observation operator of |
|
The adjoint observation operator of |
|
The adjoint observation operator of |
Local observations and localisation¶
|
Initialize the observation information corresponding to an isotropic local analysis domain. |
|
Initialize the observation information corresponding to a non-isotropic local analysis domain. |
Initialize the observation information corresponding to a non-isotropic local analysis domain. |
|
Returns a vector of observation localisation weights. |
|
|
Store local observation counts for OMI local-initialization workflows. |
|
Stores the isotropic localization parameters (cradius, sradius, locweight) in OMI. |
Stores the non-isotropic localization parameters (cradius, sradius, locweight) in OMI. |
|
|
Initialise local observation information for isotropic covariance localisation. |
Initialise local observation information for non-isotropic covariance localisation. |
|
Initialise local observation information for non-isotropic covariance localisation. |
|
|
Set the domain limits for domain decomposed local domain. |
Set the domain limits for unstructured domain decomposed local domain. |
|
|
Save local observation information in PDAF. |
Save local observation information for 2+1D factorized localization in the vertical direction in PDAF. |
Observation diagnostics¶
Activate or deactivate the observation diagnostics. |
|
Observation dimension for each observation type. |
|
|
Observed ensemble for given observation type. |
|
Observed ensemble mean for given observation type. |
|
Inverse of observation error variance for given observation type. |
|
Observation vector and corresponding coordinates for specified observation type. |
The number of observation types that are active in an assimilation run. |
|
|
Root mean squared distance between observation and obseved model state for each observation type. |
|
A selection of 6 statistics comparing the observations and the observed ensemble mean for each observation type. |
|
Compute RMSD between observations and observed ensemble means. |
|
Compare observations with observed ensemble means by observation type. |
|
Compute CRPS diagnostics between observations and observed ensembles. |
pyPDAF.PDAFlocal Localisation Helpers¶
|
Set index vector to map local state vector to global state vectors. |
Initialises a PDAF_internal local array of increment weights. |
|
Deallocates the local increment weight vector in |
pyPDAF.PDAFlocalomi¶
pyPDAF.PDAFlocalomi is exported as a namespace package, but it currently
does not expose functions from its __init__.py.