This package contains the base class for metrics. It’s an abstract class with a abstract method “analyze”. MSSS and CRPSS are child classes of this one. Most methods use CDO commands.
Abstract class for calculating any metric of decadal runs with CDO Every reusable function which uses CDO commands should go in here.
Multiprocessing for remapping files remap observations and model files
| Parameters: | ensList – list of files |
|---|---|
| Returns: | list of remapped files |
| Todo : | Multiprocessing |
|---|
Should do ensmean in multiprocessing!!! At the moment only single approach
| Parameters: | fileList – dict of filelists |
|---|---|
| Returns: | dict of ensemble means |
Calculates ensemble Mean
| Parameters: | fileList – list of files |
|---|---|
| Returns: | ensemble mean file |
Multiprocessing approach for temporal smoothing Starts a process for every file in ensList
| Parameters: |
|
|---|---|
| Returns: | list of temporal smoothed files |
Temporal smoothing. I.e. timmean over year 2-9
| Parameters: |
|
|---|---|
| Returns: | temp smoothed file |
Subtracts cross-validated mean from ensembles
| Parameters: |
|
|---|---|
| Returns: | dict width cross-validated anomalies |
Calculates cross-validated means (averages through forecast times, excluding the forecast in question)
| Parameters: |
|
|---|---|
| Returns: | dict with cross-validated means |
Calculate “variance”
| Deprecated : | Not used in goddard metrics –> should not be used |
|---|---|
| Parameters: |
|
| Returns: | kind of standard deviation of anomalies |
Creates a constant field with value 1
| Parameters: | gridFile – grid description file (txt) |
|---|---|
| Returns: | filename |
Calculates the mean ensemble STD for a given dictionary Keys in dict have to be the starting years
| Parameters: | ensList – dict with ensembles |
|---|---|
| Returns: | file with mean ensemble std |
Calculates the ensemble Variance of a given file list (ensembles)
| Note : | CDO norally divides by n here this is changed to n-1 |
|---|---|
| Parameters: | fileList – List of files |
| Returns: | file with ensemble variance |
Method for debugging. Prints our values of a list, dict or file.
| Note : | Printing is only activated for TESTDATA |
|---|---|
| Todo : | Maybe extend for numpy arrays |
| Parameters: |
|
Method for debugging. Prints a specific value of a given netCDF File.
| Parameters: |
|
|---|
Calculates a missing value mask using the observations. At the moment all gridpoints are masked at missing value where at least one value is missing
| Todo : | find a less strict solution. Maybe 10% available? |
|---|
DONE!
| Parameters: | observations – dict with all observations |
|---|
:return netcdf file with missing values mask 1/0
Method to select a lon-lat-box using CDO
| Parameters: | fileList – list with files of single file |
|---|---|
| Returns: | new filelist |
Single process for selecting lon-lat-box with cdo
| Param : | file |
|---|---|
| Returns: | new file |
Multiprocess Method to calc fieldmean
| Parameters: | fileList – |
|---|---|
| Returns: | fieldmean list |
Single process calculating fieldmean using CDO
| Parameters: | fn – |
|---|---|
| Returns: | fieldmean fn |
Multi Process Wrapper for “single” cdo commands like “fldmeam” with 1 input and 1 output file
Single Process Wrapper for “single” cdo commands like “fldmeam” with 1 input and 1 output file
@deprecated: use the static Plotter class instead Plot any field variable
| Parameters: |
|
|---|
Multiply results with a missing value mask
| Todo : | At the moment all files in the outputdir are multiplied. This should be changed |
|---|---|
| Parameters: |
|
| Returns: | list of changed files |
Subtracts trend of a timeseries. If keepMean is True the mean is kept
If we calculate field mean we have to take the missing values of the observations into account. In this method the missing field mask of all observations is calculated. DON’T mix it up with calcMissingValueMask
Apply missing value mask to a list of files
Apply missing value mask to a file
Takes 2 3d netcdf files and calculates common levels
| Returns: | list of common levels |
|---|