Expt
Class
- class DAPyr.Expt(name: str, params: dict = None)
Initialize a Data Assimilation experiment and configurable parameters.
- basicParams
A dictionary containing all parameters initializing basic experimental set-up.
- Type:
- miscParams
A dictionary containing all parameters initializing output and other miscellaneous parameters.
- Type:
- states
A dictionary containing all state vectors (model truth, observations, and initial ensemble states).
- Type:
- copyStates(expt)
Copy the states (model truth, initial ensemble, and observations) from another experiment
- Parameters:
expt (Expt) – The experiment to copy the states from.
- Raises:
TypeError – Experiment instance not provided.
dapExceptions.MismatchModelSize – Model flags do not match between experiments.
dapExceptions.MismatchTimeSteps – Attempting to copy from experiment with less time steps than current experiment.
dapExceptions.MismatchObs – Number of assimilated observations do not match between experiments.
dapExceptions.MismatchEnsSize – Attempting to copy from experiment with less ensemble members than current experiment.
dapExceptions.MismatchOperator – Measurement operator flags do not match between experiments.
- getBasicParams() tuple
Retrieve the basic parameters describing the experiment (Ne, Nx, T, and dt).
- Returns:
Ne (int) – Number of ensemble members
Nx (int) – Number of model states
T (int) – Number of time steps the experiment will run for
dt (float) – The model time increment
- getParam(param: str)
Retrieve the value of a parameter stored in the Expt class.
Note
getParam returns immutable instances of the state vectors xt, Y, and xf_0, meaning that modifying instances returned by getParam will not modifying the instances stored in the Expt object itself. To modify the states of an experiment after spinup, access them directly through the expt.states dictionary.
- Parameters:
param (str) – Name of parameter to retrieve
- Returns:
Value of the requested parameter
- Return type:
param_value
- getParamNames() list
Retrieve all modifiable parameters in the Expt class.
- Parameters:
None
- Returns:
a list of available parameters to modify
- Return type:
- getStates() tuple
- Returns:
xf_0 (numpy.ndarray) – Initial ensemble state that begins the experiment. Size (Nx, Ne)
xt (numpy.ndarray) – Model truth states throughout the experiment. Size (T, Nx)
Y (numpy.ndarray) – Observations throughout the experiment. Size (Ny, T, 1)
- modExpt(params: dict, reqUpdate: bool = False)
Modify a parameter in the Expt class, recalculating new initial states if necessary.
Note
Modifying most parameters will cause a recalculation of all state vectors. To maintain consistent ensemble states across modification, consider setting the seed parameter in your experiment.
- modExptName(exptname: str) None
Modify the name of the Experiment
- Parameters:
exptname (str) – New experiment name
- resetParams()
Reset all Expt parameters to their default values.
Configurable Paramters
basicParams
Paramter |
Default |
Description |
---|---|---|
T |
100 |
Total number of time steps in experiment |
dt |
Model Specific |
Model time step increment |
Ne |
10 |
Number of ensemble members |
expt_flag |
0 |
|
seed |
-1 |
Seed for random number generator. Set to -1 to turn off. |