Skip to content

Commit

Permalink
Multiple statistics annotations on one plot (#80)
Browse files Browse the repository at this point in the history
* restructure eva stats method to use emcpy add text function

* multistats working

* update test files and emcpy commit

* pep8

* update emcpy hash

---------

Co-authored-by: danholdaway <[email protected]>
  • Loading branch information
danholdaway and danholdaway authored Mar 8, 2023
1 parent 2506383 commit 7f93ee9
Show file tree
Hide file tree
Showing 6 changed files with 198 additions and 286 deletions.
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
'cartopy>=0.18.0',
'scikit-learn>=1.0.2',
'xarray>=0.11.3',
# 'seaborn==0.12',
'emcpy @ git+https://github.com/NOAA-EMC/' +
'emcpy@dcdc868e7f48bb1ff55507f34c0548742af8bec1#egg=emcpy',
'emcpy@471cb60c44c51a7e07dfbd0173c276ecdc1b46f1#egg=emcpy',
# Option dependency for making density plots
# 'seaborn==0.12',
],
package_data={
Expand Down
5 changes: 2 additions & 3 deletions src/eva/eva_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,11 @@
# imports
import argparse
import os
import nbformat
from nbconvert.preprocessors import ExecutePreprocessor

# local imports
from eva.eva_path import return_eva_path
from eva.utilities.logger import Logger, textcolors
from eva.utilities.utils import load_yaml_file, replace_vars_dict, replace_vars_notebook

from eva.plot_tools import figure_driver
from eva.plot_tools.figure_driver import FigureDriver

Expand Down Expand Up @@ -64,6 +61,8 @@ def application_tests(logger):
def notebook_tests(logger):

from eva.eva_base import eva
import nbformat
from nbconvert.preprocessors import ExecutePreprocessor

# Write some messaging
logger.info(f'Running Eva notebook tests ...')
Expand Down
17 changes: 10 additions & 7 deletions src/eva/tests/config/testGsiObsSpaceAmsuaMetop-A.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,21 @@ diagnostics:
add_legend:
loc: 'upper left'
statistics:
data:
variable: experiment::GsiNcDiag::Obs_Minus_Forecast_adjusted
channel: ${channel}
statistic list:
fields:
- field_name: experiment::GsiNcDiag::Obs_Minus_Forecast_adjusted
channel: ${channel}
xloc: 0.5
yloc: -0.10
kwargs:
color: 'black'
fontsize: 8
fontfamily: monospace
statistics_variables:
- n
- min
- mean
- max
- std
- name
kwargs:
fontsize: 6
layers:
- type: Histogram
data:
Expand Down
22 changes: 16 additions & 6 deletions src/eva/tests/config/testIodaObsSpaceAircraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -221,17 +221,27 @@ diagnostics:
add_legend:
loc: 'upper left'
statistics:
data:
variable: experiment::ObsValueMinusHofx::${variable}
statistic list:
fields:
- field_name: experiment::ObsValueMinusGsiHofXBc::${variable}
xloc: 0.5
yloc: -0.10
kwargs:
color: 'blue'
fontsize: 8
fontfamily: monospace
- field_name: experiment::ObsValueMinusHofx::${variable}
xloc: 0.5
yloc: -0.13
kwargs:
color: 'red'
fontsize: 8
fontfamily: monospace
statistics_variables:
- n
- min
- mean
- max
- std
- name
kwargs:
fontsize: 6
layers:
- type: Histogram
data:
Expand Down
78 changes: 54 additions & 24 deletions src/eva/tests/config/testIodaObsSpaceAmsuaN19.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,18 +97,29 @@ diagnostics:
add_legend:
loc: 'upper left'
statistics:
data:
variable: experiment::hofx::${variable}
channel: ${channel}
statistic list:
fields:
- field_name: experiment::hofx::${variable}
channel: ${channel}
xloc: 0.5
yloc: -0.10
kwargs:
color: 'black'
fontsize: 8
fontfamily: monospace
- field_name: experiment::hofxPassedQc::${variable}
channel: ${channel}
xloc: 0.5
yloc: -0.13
kwargs:
color: 'red'
fontsize: 8
fontfamily: monospace
statistics_variables:
- n
- min
- mean
- max
- std
- name
kwargs:
fontsize: 6
layers:
- type: Scatter
x:
Expand Down Expand Up @@ -249,18 +260,29 @@ diagnostics:
add_legend:
loc: 'upper left'
statistics:
data:
variable: experiment::ObsValueMinusHofx::${variable}
channel: ${channel}
statistic list:
fields:
- field_name: experiment::ObsValueMinusGsiHofXBc::${variable}
channel: ${channel}
xloc: 0.5
yloc: -0.10
kwargs:
color: 'blue'
fontsize: 8
fontfamily: monospace
- field_name: experiment::ObsValueMinusHofx::${variable}
channel: ${channel}
xloc: 0.5
yloc: -0.13
kwargs:
color: 'red'
fontsize: 8
fontfamily: monospace
statistics_variables:
- n
- min
- mean
- max
- std
- name
kwargs:
fontsize: 6
layers:
- type: Histogram
data:
Expand Down Expand Up @@ -296,18 +318,29 @@ diagnostics:
add_legend:
loc: 'upper left'
statistics:
data:
variable: experiment::ObsValueMinusHofx::${variable}
channel: ${channel}
statistic list:
fields:
- field_name: experiment::ObsValueMinusGsiHofXBc::${variable}
channel: ${channel}
xloc: 0.5
yloc: -0.10
kwargs:
color: 'blue'
fontsize: 8
fontfamily: monospace
- field_name: experiment::ObsValueMinusHofx::${variable}
channel: ${channel}
xloc: 0.5
yloc: -0.13
kwargs:
color: 'red'
fontsize: 8
fontfamily: monospace
statistics_variables:
- n
- min
- mean
- max
- std
- name
kwargs:
fontsize: 6
layers:
- type: Density
data:
Expand All @@ -328,7 +361,6 @@ diagnostics:

# Map plots
# ---------

# Observations
- batch figure:
variables: *variables
Expand Down Expand Up @@ -365,7 +397,6 @@ diagnostics:
cmap: ${dynamic_cmap}
vmin: ${dynamic_vmin}
vmax: ${dynamic_vmax}

# Observations over north polar region
- batch figure:
variables: *variables
Expand Down Expand Up @@ -402,7 +433,6 @@ diagnostics:
cmap: ${dynamic_cmap}
vmin: ${dynamic_vmin}
vmax: ${dynamic_vmax}

# omb jedi
- batch figure:
variables: *variables
Expand Down
Loading

0 comments on commit 7f93ee9

Please sign in to comment.