-
Notifications
You must be signed in to change notification settings - Fork 37
Useful scripts
It is generally easier to write data into the Verif text format. However the NetCDF format is quicker when using Verif. The ./scripts/text2nc.py
script converts a Verif text file to a Verif NetCDF file:
python scripts/text2nc.py file.txt file.nc
Note that since version 1.3, accumulation can be done by the verif program on the fly. See the section on Aggregating in time.
In some cases, it can be useful to verify forecasts for accumulated values. For example, your file may contain hourly precipitation values, but you wish to verify 24-hour accumulated precipitation forecasts and observations. To do this, a script has been provided (in ./scripts/) that will create accumulated values for any window length.
python scripts/accumulate.py file.nc accumulated_file.nc -w 24
Verif can then be run on the new file. Both deterministic forecasts and observations have been accumulated. However, since not enough information is available in the files, the probabilistic forecasts are not included in the output file.
Converts observations and forecasts into weather windows: A window is the length of time that a parameter is below a certain threshold, for example a dry-spell is the length (along the leadtime axis) that precipitation is 0 mm.
python scripts/window.py file.nc window_file.nc -r 0.5
The Verif input file format supports ensemble information (i.e. forecasts for different ensemble members). However, verif itself does currently not support computing probabilistic information (such as CDF for a given threshold) based on the ensemble information.
As a work around, you can use the ens2prob.py script, which will generate the CDF information that Verif needs for plots such as the reliability diagram:
python scripts/ens2prob.py ensfile.nc probfile.nc -r 0:10 -q 0.1:0.1:0.9 -p
The -r
flag specifies what thresholds to compute CDF values for and the -q
flag specifies what CDF values to compute thresholds for. The -p
flag computes PIT-values. To use this script, your input file must contain ensemble information (see instructions).
- Introduction
- Installation
- Basic usage
- Metrics and diagrams
- Visualization options
- Data manipulation options
- Datasets
- Other