API¶
This page provides a list of pyPDAF functions that are intended for users. They are grouped by functionalities. Clicking on a function name will lead to its documentation page.
These are not all available functions in pyPDAF. Similar to PDAF, pyPDAF maintains backward compatible legacy functions used prior to PDAF 3.0. For a complete list of functions, please refer to the [hidden and legacy function page](hidden_functions.md)
Initialisation and finalisation¶
Initialise the PDAF system. |
|
Set MPI communicators and parallelisation in PDAF. |
|
The routine PDAF_init_forecast has to be called once at the end of the initialization of PDAF/start of DA cycles. |
|
Allocating an array of obs_f derived types instances. |
|
|
Allocating an array of obs_l derived types instances. |
|
Finalise the PDAF systems including freeing some of the memory used by PDAF. |
DA algorithms¶
Sequential DA¶
diagnoal observation matrix¶
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. |
non-diagnoal observation 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 DA¶
diagnoal observation 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. |
non-diagnoal observation 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-diagnoal observation error covariance matrix. |
|
Offline 3DEnVar for a single DA step using non-diagnoal 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-diagnoal observation error covariance matrix. |
|
Offline hybrid 3DEnVar for a single DA step using non-diagonal observation error covariance matrix. |
OMI functions¶
setter functions¶
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 |
|
Gather the dimension of a given type of observation across multiple local domains/filter processors. |
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 |
|
This function is used to implement custom observation operators. |
Interpolations¶
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. |
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. |
|
Set the domain limits for domain decomposed local domain. |
|
Set the domain limits for unstructured domain decomposed local domain. |
|
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. |
Custom local observation initialisation¶
Stores the isotropic localization parameters (cradius, sradius, locweight) in OMI. |
|
Stores the non-isotropic localization parameters (cradius, sradius, locweight) in OMI. |
|
Stores the local number of observations for OMI-internal initialisations. |
|
Save local observation information in PDAF. |
|
Save local observation information for 2+1D factorized localization in the vertical direction in PDAF. |
Diagnostics¶
This function returns the value of the PDAF-OMI internal error flag. |
|
Activate the debug output of the PDAFomi. |
|
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. |
Localisation functions¶
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 |
|
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. |
Utilities¶
PDAF state and setup information¶
Return the number of time steps, current model time, and a flag whether the forecasting should be exited. |
|
|
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 the smoothed ensemble in earlier time steps. |
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. |
Observation MPI handling¶
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. |
Synthetic experiments¶
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. |
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. |
Statistical diagnostics¶
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. |
|
Computing the rank histogram of an ensemble. |
|
Obtain a continuous rank probability score for an ensemble. |
|
Obtain a continuous rank probability score for an ensemble without MPI. |
Ensemble generation¶
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. |
PDAF debug options¶
Activate the debug output of the PDAF. |
Advanced manipulation¶
Set integer parameters for PDAF. |
|
Set floating-point parameters for PDAF. |
|
Set the MPI communicator used by PDAF. |
|
|
Return the ensemble in a numpy array. |
Set the ensemble member index to given value. |
|
Activate offline mode of PDAF. |
|
Choose a seedset for the random number generator used in PDAF. |
|
Get a pointer to smoother ensemble. |
|
|
Perform assimilation after this function call. |
Reset the forgetting factor manually during the assimilation process. |