gcpy.examples.diagnostics.compare_diags
Example script that can compare diagnostics from two different netCDF collections. Similar to compute_diagnostics.ipynb, but can be used without having to open a Jupyter notebook. The parameters for the configuration are specified in a YAML file whose name is passed as an argument.
Examples
Copy the
compare_diags.ymlfile to a different folderIn your copy of
compare_diags.yml, edit labels, file paths, etc. for the Ref and Dev versions. Also select the types of output that you desire.Run the following commands:
$ conda activate gcpy_env
(gcpy_env) $ python -m gcpy.examples.diagnostics.compare_diags \
/path/to/yaml/file
Functions
|
Compares data from two different xarray datasets. |
|
Create directories for plots and weights if they do not exist. |
|
Main program, reads data and calls compare_data to make plots. |
|
Prints totals and differences of data. |
|
Read data from the Ref and Dev datasets. |
- gcpy.examples.diagnostics.compare_diags.create_dirs(config)[source]
Create directories for plots and weights if they do not exist.
- Parameters:
config (
dict) – Configuration information read from a YAML file.
- gcpy.examples.diagnostics.compare_diags.read_data(config)[source]
Read data from the Ref and Dev datasets.
- gcpy.examples.diagnostics.compare_diags.print_totals_and_diffs(config, refdata, devdata, varlist)[source]
Prints totals and differences of data. This is a quick way to see if there are nonzero differences between Ref and Dev datasets.
- Parameters:
config (
dict) – Configuration information read from a YAML file.refdata (
xarray.Dataset) – Contains data from the Ref model run.devdata (
xarray.Dataset) – Contains data from the Dev model run.