ISH-LITE and UFS-CHEM

Our first example will demonstrate the basics available in MELODIES MONET to compare UFS-CHEM results against ISH-LITE surface observations for temperature, wind speed, and dewpoint.

ISH is a particularly useful for model evaluations because it is a global dataset. As you will see in the YAML file, we can create plots globally, for individual countries, and states. NOTE: MELODIES-MONET examples that use ISH will take longer to finish running due to the larger amount of data.

First, we import the melodies_monet.driver module.

from melodies_monet import driver

Analysis driver class

Now, lets create an instance of the analysis driver class, melodies_monet.driver.analysis. It consists of these main parts:

  • model instances

  • observation instances

  • a paired instance of both

an = driver.analysis()

Initially, most of our analysis object’s attributes are set to None, though some have meaningful defaults:

an
analysis(
    control='control.yaml',
    control_dict=None,
    models={},
    obs={},
    paired={},
    start_time=None,
    end_time=None,
    time_intervals=None,
    download_maps=True,
    output_dir=None,
    output_dir_save=None,
    output_dir_read=None,
    debug=False,
    save=None,
    read=None,
    regrid=False,
)

Control file

We set the YAML control file and begin by reading the file.

Note

Check out the Description of All YAML Options for info on how to create and modify these files.

an.control = "control_ish_lite_ufschem-example.yaml"
an.read_control()
an.control_dict

Hide code cell output

{'analysis': {'start_time': '2017-07-01-00:00:00',
  'end_time': '2017-07-03-00:00:00',
  'output_dir': './output/ish_lite_ufschem',
  'debug': True},
 'model': {'ufschem_v1': {'files': 'example:ufschem:2017-07',
   'files_surf': 'example:ufschem:2017-07_sfc',
   'mod_type': 'ufs',
   'is_global': True,
   'mod_kwargs': {'surf_only': True,
    'sfc_varlist': ['tmp2m', 'spfh2m', 'ugrd10m', 'vgrd10m']},
   'radius_of_influence': 100000,
   'extra_calc': {'dewpoint': {'pres_calc': 'surfpres_pa',
     'specific_hum': 'spfh2m'},
    'rel_hum': {'pres_calc': 'surfpres_pa',
     'specific_hum': 'spfh2m',
     'temp_calc': 'tmp2m'},
    'windspeed': {'u_comp': 'ugrd10m', 'v_comp': 'vgrd10m'},
    'winddir': {'u_comp': 'ugrd10m', 'v_comp': 'vgrd10m'},
    'wind_barb': {'u_comp': 'ugrd10m', 'v_comp': 'vgrd10m'},
    'rose_plot': {'model_wdir': 'winddir', 'model_wspd': 'windspeed'}},
   'mapping': {'ish_lite': {'tmp2m': 'temp',
     'windspeed': 'ws',
     'dewpoint': 'dew_pt_temp'}},
   'projection': None,
   'plot_kwargs': {'color': 'magenta', 'marker': 's', 'linestyle': '-'}}},
 'obs': {'ish_lite': {'filename': 'example:ish-lite:2017-07',
   'obs_type': 'pt_sfc',
   'variables': {'temp': {'unit_scale': 273.15,
     'unit_scale_method': '+',
     'nan_value': -1.0,
     'ylabel_plot': 'Temperature 2m (K)',
     'xlabel_plot': 'Temperature 2m (K)',
     'vmin_plot': 273.15,
     'vmax_plot': 313,
     'vdiff_plot': 20.0,
     'nlevels_plot': 21},
    'ws': {'unit_scale': 1,
     'unit_scale_method': '*',
     'nan_value': -1.0,
     'ylabel_plot': 'Windspeed 10m (m/s)',
     'xlabel_plot': 'Windspeed 10m (m/s)',
     'vmin_plot': 0,
     'vmax_plot': 15,
     'vdiff_plot': 4,
     'nlevels_plot': 18},
    'wdir': {'unit_scale': 1,
     'unit_scale_method': '*',
     'nan_value': -1.0,
     'ylabel_plot': 'Wind Direction 10m (deg)',
     'xlabel_plot': 'Wind Direction 10m (deg)',
     'vmin_plot': 0,
     'vmax_plot': 370,
     'vdiff_plot': 4,
     'nlevels_plot': 18},
    'dew_pt_temp': {'unit_scale': 273.15,
     'unit_scale_method': '+',
     'nan_value': -1.0,
     'ylabel_plot': 'Dewpoint 2m (K)',
     'xlabel_plot': 'Dewpoint 2m (K)',
     'vmin_plot': 273.15,
     'vmax_plot': 313,
     'vdiff_plot': 4,
     'nlevels_plot': 18}},
   'extra_calc': {'rose_plot': {'obs_wdir': 'wdir', 'obs_wspd': 'ws'}}}},
 'plots': {'plot_grp1': {'type': 'timeseries',
   'fig_kwargs': {'figsize': [12, 6]},
   'default_plot_kwargs': {'linewidth': 2.0, 'markersize': 10.0},
   'text_kwargs': {'fontsize': 24.0},
   'domain_type': ['country', 'state'],
   'domain_name': ['US', 'MI'],
   'data': ['ish_lite_ufschem_v1'],
   'data_proc': {'rem_obs_nan': True,
    'ts_select_time': 'time_local',
    'ts_avg_window': 'h',
    'set_axis': True,
    'filter_string': '24 < latitude < 50 and -130 < longitude < -60'}},
  'plot_grp1a': {'type': 'timeseries',
   'fig_kwargs': {'figsize': [12, 6]},
   'default_plot_kwargs': {'linewidth': 2.0, 'markersize': 10.0},
   'text_kwargs': {'fontsize': 24.0},
   'domain_type': ['country', 'state'],
   'domain_name': ['US', 'MI'],
   'data': ['ish_lite_ufschem_v1'],
   'data_proc': {'rem_obs_nan': True,
    'ts_select_time': 'time_local',
    'ts_avg_window': 'h',
    'set_axis': True,
    'filter_string': '24 < latitude < 50 and -130 < longitude < -60 and ws != 0 and wdir != 0'}},
  'plot_grp2': {'type': 'taylor',
   'fig_kwargs': {'figsize': [8, 8]},
   'default_plot_kwargs': {'linewidth': 2.0, 'markersize': 10.0},
   'text_kwargs': {'fontsize': 16.0},
   'domain_type': ['state'],
   'domain_name': ['MI'],
   'data': ['ish_lite_ufschem_v1'],
   'data_proc': {'rem_obs_nan': True, 'set_axis': True}},
  'plot_grp3': {'type': 'spatial_overlay',
   'fig_kwargs': {'states': True, 'figsize': [10, 5]},
   'text_kwargs': {'fontsize': 16.0},
   'domain_type': ['country', 'state'],
   'domain_name': ['US', 'MI'],
   'data': ['ish_lite_ufschem_v1'],
   'data_proc': {'rem_obs_nan': True,
    'set_axis': True,
    'wind_barb': True,
    'wind_barb_step': 2,
    'filter_string': '24 < latitude < 50 and -130 < longitude < -60'}},
  'plot_grp3a': {'type': 'spatial_overlay',
   'fig_kwargs': {'states': True, 'figsize': [10, 5]},
   'text_kwargs': {'fontsize': 16.0},
   'domain_type': ['country', 'state'],
   'domain_name': ['US', 'MI'],
   'data': ['ish_lite_ufschem_v1'],
   'data_proc': {'rem_obs_nan': True,
    'set_axis': True,
    'wind_barb': True,
    'wind_barb_step': 2,
    'wind_barb_kwargs': {'length': 6, 'linewidth': 0.85, 'color': 'magenta'},
    'filter_string': '24 < latitude < 50 and -130 < longitude < -60 and ws != 0 and wdir != 0'}},
  'plot_grp4': {'type': 'boxplot',
   'fig_kwargs': {'figsize': [8, 6]},
   'text_kwargs': {'fontsize': 20.0},
   'domain_type': ['state'],
   'domain_name': ['MI'],
   'data': ['ish_lite_ufschem_v1'],
   'data_proc': {'rem_obs_nan': True, 'set_axis': False}},
  'plot_grp4a': {'type': 'boxplot',
   'fig_kwargs': {'figsize': [8, 6]},
   'text_kwargs': {'fontsize': 20.0},
   'gridlines': True,
   'domain_type': ['all'],
   'domain_name': ['Filter_Box_Midwest'],
   'data': ['ish_lite_ufschem_v1'],
   'data_proc': {'rem_obs_nan': True,
    'set_axis': False,
    'filter_string': '37 < latitude < 49 and -104 < longitude < -80',
    'set_stat_sig': True}},
  'plot_grp5': {'type': 'multi_boxplot',
   'fig_kwargs': {'figsize': [10, 8]},
   'text_kwargs': {'fontsize': 20.0},
   'gridlines': True,
   'xlabel': 'Binned by Observed Wind Speed (m/s)',
   'domain_type': ['state'],
   'domain_name': ['MI'],
   'interval_list': [0, 3, 5, 8, 11, 14],
   'interval_var': 'ws',
   'interval_labels': ['[0, 3)', '[3, 5)', '[5, 8)', '[8, 11)', '[11, 14)'],
   'model_name_list': ['ISH', 'ufschem_v1'],
   'data': ['ish_lite_ufschem_v1'],
   'data_proc': {'rem_obs_nan': True, 'set_axis': False}},
  'plot_grp6': {'type': 'scatter_density',
   'fig_kwargs': {'figsize': [10, 10]},
   'default_plot_kwargs': {'linewidth': 4.0, 'markersize': 10.0},
   'text_kwargs': {'fontsize': 24.0},
   'gridlines': True,
   'domain_type': ['state'],
   'domain_name': ['MI'],
   'data': ['ish_lite_ufschem_v1'],
   'data_proc': {'rem_obs_nan': True, 'set_axis': False},
   'fill': True,
   'shade_lowest': True,
   'vcenter': None,
   'extensions': ['min', 'max']},
  'plot_grp7': {'type': 'rose_plot',
   'text_kwargs': {'fontsize': 16.0},
   'domain_type': ['state', 'siteid'],
   'domain_name': ['MI', '72539614815'],
   'data': ['ish_lite_ufschem_v1'],
   'data_proc': {'rem_obs_nan': True, 'set_axis': True, 'wr_calm_limit': 0.5}},
  'plot_grp8': {'type': 'diurnal',
   'fig_kwargs': {'figsize': [12, 6]},
   'default_plot_kwargs': {'linewidth': 2.0, 'markersize': 10.0},
   'text_kwargs': {'fontsize': 24.0},
   'domain_type': ['state', 'siteid'],
   'domain_name': ['MI', '72539614815'],
   'data': ['ish_lite_ufschem_v1'],
   'data_proc': {'rem_obs_nan': True,
    'ts_select_time': 'time_local',
    'ts_avg_window': 'h',
    'set_axis': True}}},
 'stats': {'stat_list': ['MB', 'MdnB', 'R2', 'RMSE', 'MAE', 'MSE'],
  'round_output': 2,
  'output_table': True,
  'output_table_kwargs': {'figsize': [7, 3],
   'fontsize': 12.0,
   'xscale': 1.4,
   'yscale': 1.4,
   'edges': 'horizontal'},
  'domain_type': ['state'],
  'domain_name': ['MI'],
  'data': ['ish_lite_ufschem_v1']}}

Now, some of our analysis object’s attributes are populated:

an
analysis(
    control='control_ish_lite_ufschem-example.yaml',
    control_dict=...,
    models={},
    obs={},
    paired={},
    start_time=Timestamp('2017-07-01 00:00:00'),
    end_time=Timestamp('2017-07-03 00:00:00'),
    time_intervals=None,
    download_maps=True,
    output_dir='./output/ish_lite_ufschem',
    output_dir_save='./output/ish_lite_ufschem',
    output_dir_read='./output/ish_lite_ufschem',
    debug=True,
    save=None,
    read=None,
    regrid=False,
)

Load the model data

The driver will automatically loop through the “models” found in the model section of the YAML file and create an instance of melodies_monet.driver.model for each that includes the

  • label

  • mapping information

  • file names (can be expressed using a glob expression)

  • xarray object

an.open_models()
ufs
example:ufschem:2017-07
**** Reading UFS-AQM or UFS-Chem model output...
Performing extra model calculations...
Calculating modeled Dewpoint...
Calculating modeled relative humidity...
Calculating modeled windspeed...
Calculating modeled wind direction...

Applying open_models() populates the models attribute.

an.models
{'ufschem_v1': model(
     model='ufs',
     is_global=True,
     radius_of_influence=100000,
     mod_kwargs={'surf_only': True, 'sfc_varlist': ['tmp2m', 'spfh2m', 'ugrd10m', 'vgrd10m'], 'fname_sfc': ['/home/rschwantes/.cache/pooch/5207e0e702072b5e37fd507da111f78d-2017_07_01_03_ufschemv1_sfc.nc'], 'var_list': ['lat', 'lon', 'phalf', 'tmp', 'pressfc', 'dpres', 'hgtsfc', 'delz']},
     file_str='example:ufschem:2017-07',
     label='ufschem_v1',
     obj=...,
     extra_calc={'dewpoint': {'pres_calc': 'surfpres_pa', 'specific_hum': 'spfh2m'}, 'rel_hum': {'pres_calc': 'surfpres_pa', 'specific_hum': 'spfh2m', 'temp_calc': 'tmp2m'}, 'windspeed': {'u_comp': 'ugrd10m', 'v_comp': 'vgrd10m'}, 'winddir': {'u_comp': 'ugrd10m', 'v_comp': 'vgrd10m'}, 'wind_barb': {'u_comp': 'ugrd10m', 'v_comp': 'vgrd10m'}, 'rose_plot': {'model_wdir': 'winddir', 'model_wspd': 'windspeed'}},
     mapping={'ish_lite': {'tmp2m': 'temp', 'windspeed': 'ws', 'dewpoint': 'dew_pt_temp'}},
     variable_dict={'surfpres_pa': 'None', 'spfh2m': 'None', 'tmp2m': 'None', 'ugrd10m': 'None', 'vgrd10m': 'None', 'winddir': 'None', 'windspeed': 'None'},
     label='ufschem_v1',
     ...
 )}

We can access the underlying dataset with the obj attribute.

an.models['ufschem_v1'].obj
<xarray.Dataset> Size: 320MB
Dimensions:        (y: 192, x: 384, time: 72, z: 1)
Coordinates:
    latitude       (y, x) float64 590kB dask.array<chunksize=(192, 384), meta=np.ndarray>
    longitude      (y, x) float64 590kB dask.array<chunksize=(192, 384), meta=np.ndarray>
  * time           (time) datetime64[ns] 576B 2017-07-01T01:00:00 ... 2017-07-04
  * x              (x) float64 3kB 0.0 0.9375 1.875 2.812 ... 357.2 358.1 359.1
  * y              (y) float64 2kB 89.28 88.36 87.42 ... -87.42 -88.36 -89.28
Dimensions without coordinates: z
Data variables: (12/14)
    temperature_k  (time, z, y, x) float32 21MB dask.array<chunksize=(1, 1, 192, 384), meta=np.ndarray>
    surfpres_pa    (time, z, y, x) float32 21MB dask.array<chunksize=(1, 1, 192, 384), meta=np.ndarray>
    dp_pa          (time, z, y, x) float32 21MB dask.array<chunksize=(1, 1, 192, 384), meta=np.ndarray>
    surfalt_m      (time, z, y, x) float32 21MB dask.array<chunksize=(1, 1, 192, 384), meta=np.ndarray>
    dz_m           (time, z, y, x) float32 21MB dask.array<chunksize=(1, 1, 192, 384), meta=np.ndarray>
    pres_pa_mid    (time, z, y, x) float64 42MB dask.array<chunksize=(1, 1, 192, 384), meta=np.ndarray>
    ...             ...
    ugrd10m        (time, z, y, x) float32 21MB dask.array<chunksize=(1, 1, 192, 384), meta=np.ndarray>
    vgrd10m        (time, z, y, x) float32 21MB dask.array<chunksize=(1, 1, 192, 384), meta=np.ndarray>
    dewpoint       (time, z, y, x) float32 21MB dask.array<chunksize=(1, 1, 192, 384), meta=np.ndarray>
    rel_hum        (time, z, y, x) float32 21MB dask.array<chunksize=(1, 1, 192, 384), meta=np.ndarray>
    windspeed      (time, z, y, x) float32 21MB dask.array<chunksize=(1, 1, 192, 384), meta=np.ndarray>
    winddir        (time, z, y, x) float32 21MB 243.3 244.2 ... 352.7 351.9
Attributes:
    grid:         gaussian
    grid_id:      1
    hydrostatic:  non-hydrostatic
    im:           384
    jm:           192
    ncnsto:       139
    source:       FV3GFS
    NCO:          netCDF Operators version 5.0.7 (Homepage = http://nco.sf.ne...
    ak:           [0. 0.]
    bk:           [0.99467119 1.        ]
    history:      Fri Feb 27 09:53:22 2026: ncrcat 20170701_dynf001.nc 201707...

Load the observational data

As with the model data, the driver will loop through the “observations” found in the obs section of the YAML file and create an instance of melodies_monet.driver.observation for each.

an.open_obs()
Performing extra calculations for obs...
an.obs
{'ish_lite': observation(
     obs='ish_lite',
     label='ish_lite',
     file='example:ish-lite:2017-07',
     obj=...,
     extra_calc={'rose_plot': {'obs_wdir': 'wdir', 'obs_wspd': 'ws'}},
     type='pt_src',
     sat_type=None,
     sat_method=None,
     data_proc=None,
     variable_dict={'temp': {'unit_scale': 273.15, 'unit_scale_method': '+', 'nan_value': -1.0, 'ylabel_plot': 'Temperature 2m (K)', 'xlabel_plot': 'Temperature 2m (K)', 'vmin_plot': 273.15, 'vmax_plot': 313, 'vdiff_plot': 20.0, 'nlevels_plot': 21}, 'ws': {'unit_scale': 1, 'unit_scale_method': '*', 'nan_value': -1.0, 'ylabel_plot': 'Windspeed 10m (m/s)', 'xlabel_plot': 'Windspeed 10m (m/s)', 'vmin_plot': 0, 'vmax_plot': 15, 'vdiff_plot': 4, 'nlevels_plot': 18}, 'wdir': {'unit_scale': 1, 'unit_scale_method': '*', 'nan_value': -1.0, 'ylabel_plot': 'Wind Direction 10m (deg)', 'xlabel_plot': 'Wind Direction 10m (deg)', 'vmin_plot': 0, 'vmax_plot': 370, 'vdiff_plot': 4, 'nlevels_plot': 18}, 'dew_pt_temp': {'unit_scale': 273.15, 'unit_scale_method': '+', 'nan_value': -1.0, 'ylabel_plot': 'Dewpoint 2m (K)', 'xlabel_plot': 'Dewpoint 2m (K)', 'vmin_plot': 273.15, 'vmax_plot': 313, 'vdiff_plot': 4, 'nlevels_plot': 18}},
     resample=None,
     time_var=None,
     regrid_method=None,
 )}
an.obs['ish_lite']
observation(
    obs='ish_lite',
    label='ish_lite',
    file='example:ish-lite:2017-07',
    obj=...,
    extra_calc={'rose_plot': {'obs_wdir': 'wdir', 'obs_wspd': 'ws'}},
    type='pt_src',
    sat_type=None,
    sat_method=None,
    data_proc=None,
    variable_dict={'temp': {'unit_scale': 273.15, 'unit_scale_method': '+', 'nan_value': -1.0, 'ylabel_plot': 'Temperature 2m (K)', 'xlabel_plot': 'Temperature 2m (K)', 'vmin_plot': 273.15, 'vmax_plot': 313, 'vdiff_plot': 20.0, 'nlevels_plot': 21}, 'ws': {'unit_scale': 1, 'unit_scale_method': '*', 'nan_value': -1.0, 'ylabel_plot': 'Windspeed 10m (m/s)', 'xlabel_plot': 'Windspeed 10m (m/s)', 'vmin_plot': 0, 'vmax_plot': 15, 'vdiff_plot': 4, 'nlevels_plot': 18}, 'wdir': {'unit_scale': 1, 'unit_scale_method': '*', 'nan_value': -1.0, 'ylabel_plot': 'Wind Direction 10m (deg)', 'xlabel_plot': 'Wind Direction 10m (deg)', 'vmin_plot': 0, 'vmax_plot': 370, 'vdiff_plot': 4, 'nlevels_plot': 18}, 'dew_pt_temp': {'unit_scale': 273.15, 'unit_scale_method': '+', 'nan_value': -1.0, 'ylabel_plot': 'Dewpoint 2m (K)', 'xlabel_plot': 'Dewpoint 2m (K)', 'vmin_plot': 273.15, 'vmax_plot': 313, 'vdiff_plot': 4, 'nlevels_plot': 18}},
    resample=None,
    time_var=None,
    regrid_method=None,
)

Pair model and observational data

Now, we create a melodies_monet.driver.pair for each model–obs pair using the pair_data() routine.

%%time

an.pair_data()

Hide code cell output

1, in pair data
After pairing:               time    temp  dew_pt_temp   press   wdir   ws  sky_condition  \
0      2017-07-01     NaN          NaN     NaN    NaN  NaN            9.0   
1      2017-07-01     NaN          NaN     NaN    NaN  NaN            NaN   
2      2017-07-01  271.95       271.75  1019.5  320.0  4.0            NaN   
3      2017-07-01  275.15       272.95  1018.2   80.0  2.0            2.0   
4      2017-07-01  274.25       271.05  1019.6  330.0  2.0            NaN   
...           ...     ...          ...     ...    ...  ...            ...   
598334 2017-07-03  298.15       290.05     NaN  360.0  3.6            NaN   
598335 2017-07-03  295.85       284.55     NaN    0.0  0.0            NaN   
598336 2017-07-03  293.35       287.75     NaN  280.0  3.1            NaN   
598337 2017-07-03  301.55       295.45     NaN  340.0  1.5            NaN   
598338 2017-07-03  301.15       296.15     NaN   90.0  1.5            NaN   

        precip_1hr  precip_6hr       siteid  ...        end  \
0              NaN         NaN  01001099999  ... 2025-06-25   
1              NaN         NaN  01001499999  ... 2025-06-25   
2              NaN         NaN  01002099999  ... 2025-06-25   
3              NaN         0.0  01003099999  ... 2025-05-22   
4              NaN         NaN  01006099999  ... 2025-06-25   
...            ...         ...          ...  ...        ...   
598334         NaN         NaN  A0735500241  ... 2025-06-26   
598335         NaN         NaN  A0735700182  ... 2025-06-26   
598336         NaN         NaN  A0735900240  ... 2025-06-26   
598337         NaN         NaN  A5125500445  ... 2025-06-27   
598338         NaN         NaN  A5125600451  ... 2025-06-26   

                time_local       tmp2m windspeed    dewpoint    surfpres_pa  \
0      2017-07-01 01:00:00         NaN       NaN         NaN            NaN   
1      2017-07-01 01:00:00         NaN       NaN         NaN            NaN   
2      2017-07-01 01:00:00         NaN       NaN         NaN            NaN   
3      2017-07-01 01:00:00         NaN       NaN         NaN            NaN   
4      2017-07-01 01:00:00         NaN       NaN         NaN            NaN   
...                    ...         ...       ...         ...            ...   
598334 2017-07-02 18:00:00  298.115448  3.982688  290.651276   97900.859375   
598335 2017-07-02 18:00:00  296.508728  2.021883  284.787537   97245.101562   
598336 2017-07-02 19:00:00  297.586121  4.401100  290.402740   98487.718750   
598337 2017-07-02 18:00:00  305.124634  1.187236  298.060455  100835.375000   
598338 2017-07-02 18:00:00  305.778809  1.674726  294.957031   97393.554688   

          spfh2m   ugrd10m   vgrd10m     winddir  
0            NaN       NaN       NaN         NaN  
1            NaN       NaN       NaN         NaN  
2            NaN       NaN       NaN         NaN  
3            NaN       NaN       NaN         NaN  
4            NaN       NaN       NaN         NaN  
...          ...       ...       ...         ...  
598334  0.012797 -0.319284 -3.969869    4.598221  
598335  0.008799 -0.932796 -1.793852   27.474243  
598336  0.012520  4.279436  1.027672  256.496582  
598337  0.019665  0.411652 -1.113585  339.712494  
598338  0.016850 -0.772506  1.485914  152.530701  

[598339 rows x 31 columns]
saving pair
CPU times: user 5.19 s, sys: 2.81 s, total: 8.01 s
Wall time: 5.62 s
an.paired
{'ish_lite_ufschem_v1': pair(
     type='pt_sfc',
     radius_of_influence=1000000.0,
     obs='ish_lite',
     model='ufschem_v1',
     model_vars=['tmp2m', 'windspeed', 'dewpoint'],
     obs_vars=['temp', 'ws', 'dew_pt_temp'],
     filename='ish_lite_ufschem_v1.nc',
 )}
an.paired['ish_lite_ufschem_v1']
pair(
    type='pt_sfc',
    radius_of_influence=1000000.0,
    obs='ish_lite',
    model='ufschem_v1',
    model_vars=['tmp2m', 'windspeed', 'dewpoint'],
    obs_vars=['temp', 'ws', 'dew_pt_temp'],
    filename='ish_lite_ufschem_v1.nc',
)

MELODIES-MONET now contains several meteorological capabilities

In addition to previous capabilites and plots, users can now:

  • Specify wind barbs

    • Note: users may experience longer wait times if they wish to plot wind barbs

  • Create rose plots for pollution and wind speed

    • Rose plots can be aggregated at the CONUS-, EPA region-, and MSA-scale

  • Create boxplots on given intervals for any of the supported meteorological variables

  • Mark statistical significance on boxplots

Plot

The plotting() routine produces plots.

NOTE: That ISH-lite data for calm wind sets windspeed = 0 and wind direction = 0. In the wind-rose plots, calm winds are plotted as an inner circle for wind direction and data is removed for pollution rose plots based on the threshold set in your yaml file.

All other plots, it’s up to the user on what to consider for these calm winds. Plots below and corresponding yaml file demonstrates how to remove all calm winds from the calculation for the timeseries plots (second set of plots plot_grp1a) and the spatial overlay plots (second set of plots plot_grp3a). You can see that windspeed biases go down when removing these calm winds. Additional processing and consideration for calm winds is under development.

%%time

an.plotting()
Warning: ty_scale not specified for temp, so default used.
Reference std: 4.161763427919396
Warning: ty_scale not specified for ws, so default used.
Reference std: 2.1283981253197726
Warning: ty_scale not specified for dew_pt_temp, so default used.
Reference std: 2.59924379404348
p-value annotation legend:
      ns: 5.00e-02 < p <= 1.00e+00
       *: 1.00e-02 < p <= 5.00e-02
      **: 1.00e-03 < p <= 1.00e-02
     ***: 1.00e-04 < p <= 1.00e-03
    ****: p <= 1.00e-04

ish_lite vs. ufschem_v1: Custom statistical test, P_val:6.102e-02
p-value annotation legend:
      ns: 5.00e-02 < p <= 1.00e+00
       *: 1.00e-02 < p <= 5.00e-02
      **: 1.00e-03 < p <= 1.00e-02
     ***: 1.00e-04 < p <= 1.00e-03
    ****: p <= 1.00e-04

ish_lite vs. ufschem_v1: Custom statistical test, P_val:3.069e-205
p-value annotation legend:
      ns: 5.00e-02 < p <= 1.00e+00
       *: 1.00e-02 < p <= 5.00e-02
      **: 1.00e-03 < p <= 1.00e-02
     ***: 1.00e-04 < p <= 1.00e-03
    ****: p <= 1.00e-04

ish_lite vs. ufschem_v1: Custom statistical test, P_val:1.517e-19
Value of fill after reading from scatter_density_config: True
Saving scatter density plot to ./output/ish_lite_ufschem/plot_grp6.scatter_density.temp.2017-07-01_00.2017-07-03_00.state.MI_ish_lite_vs_ufschem_v1.png...
Processing scatter density plot for model 'ufschem_v1' and observation 'ish_lite'...
Saving scatter density plot to ./output/ish_lite_ufschem/plot_grp6.scatter_density.temp.2017-07-01_00.2017-07-03_00.state.MI_ish_lite_vs_ufschem_v1.png...
../_images/38270474eb1314a65c720f509fc6a07aa4067f652e14e55144db6ba8c510daaa.png ../_images/8220bff016247943e2a68a0a1ed445f6dc1d82e319e42d6d8ef097b2eac4ddf5.png ../_images/c86add2609cfb0d1077ddb03b906013ef810b5c1dd9984775f9bb328f8d9308e.png ../_images/a33bcb67eeddd8c7cf236ae33524283aedfdcb037473d6e3c102ae49589cc3b6.png ../_images/4cc4137c6b66dd81ce1c26915a3dd6db83fef6722263b15bcd0074691984f5bb.png ../_images/ea0c73b807400af0a44a07e81dc950a08bd2f25f7a7acb74a91e6c2fad4e13e6.png ../_images/d6dea3fb3426c9c2243d4558aa6bb73a176d65d684869916e1f4a43c25d17bd7.png ../_images/4ebb3b147ec4f0d39829e3bafc80f4f5f8f05e768e2882423250b8152a765a24.png ../_images/bc3e09b3d78a890d639f13120f98dbf5c656d06bd41054421eb7b06e8f867d03.png ../_images/27c602151ca8d8252941181e46a1c0ebe39d63f1618fc4b881e838de57221a58.png ../_images/4053507707d504f5f89bff9240df1d099f028f4da3150341a562367fc328067f.png ../_images/25405873f3cbc7ff72f7aaba2c22d3444ea45dd3f409e22810a833af3870673d.png ../_images/8e062f2b33b80316c372f29fc055169975367641b353959293390a29bddeba36.png ../_images/c3c433f2f75be83228c5bd7e0368c01924caee3529850354380bb3e0122a5307.png ../_images/efe591cd0f5bcafa3d7dcf0f6ad3ce8768ee2c2d406e0a161efe5a023e9df958.png ../_images/c65d04811df67b3a8514794d84f174db4e19f930ce859723386c8d5a43cc1c91.png ../_images/015367bcf90a2f4782852e8637b5bc7f85a1f892eaf27271a119b2561cf9b8cc.png ../_images/a0fd743bc64ba35cb571c493730b559b356261963068a70ca97f2dd9c764f76e.png ../_images/e5108a4ab8d9fc0282fc8521ce2e86a3de73b3385500d6bb640f04d3ae406ca8.png ../_images/9c14fa7f4f72f70aec6a38b48629510a3cd9d56d00eb4a52422cbc36c26eaf4a.png ../_images/f03cff1074854c9999c532e28bf27f88e5c57037a174c5da9800e48f62f62982.png ../_images/d6b4b61490bdd43ac120a1370759cdd5211868fee74fda1a05048c9b62917eb0.png ../_images/c231c29baf4caa8ee343e0d22f692a1dab7b78fbe273f23efb3dbb97e3a22471.png ../_images/b900b0c68ff2b107b8caaad31c78fa42a5b04600d7ab9f47fb95b8beff26aeda.png ../_images/db7502cd38ade905958bc047f02b0345693fd20dd79a5dd38a7438554f5323d0.png ../_images/711ab720ac64e7d141d584cd85f094e330f6fc9670a91050236a7f5a49caab70.png ../_images/06ccc992e6b7dbfcbbdec997fe74c3822ec7c00279b8f7ec5751982ac835745b.png ../_images/68339ee7d531be85264109ce55822ff835a06290e74d30896330e22387d2b767.png ../_images/4b7d87e2434e7fd763a682e2f8cc6af17c63946a79ca832c32c9cae4b41fa28b.png ../_images/873555c624a482512b7c13de46210760d33f4ef9a49d006d7745f21c85967fd7.png ../_images/c08d2108095a68f4bb06768d9991b829f64dbdad7123dab3ebb9a277033c6b2f.png ../_images/02d47b0ce3850068f6c3ae7d3fe06167ccb6b047bf76563416a7c4ed00e16d49.png ../_images/34a7fc352a146a6750593595f3d7b921cd054300b3a091f609dea2784994884d.png ../_images/ada8a84699a56fcd36c52e39dae3ff36edd9a144906b0bc17e2a3dcb6fd01990.png ../_images/a96d723ebd7fb4f383f51730c62ce502c706618d5d3dd1c0b7f566ac7e681d0c.png ../_images/918c452a0b122b34d50046bebe7fbbfaba0640e178c13b27878836f2834042f2.png ../_images/e94974772db518c5fc40be71cdcbb7484411b59dd1c7afe81c175be3326c8724.png
Value of fill after reading from scatter_density_config: True
Saving scatter density plot to ./output/ish_lite_ufschem/plot_grp6.scatter_density.ws.2017-07-01_00.2017-07-03_00.state.MI_ish_lite_vs_ufschem_v1.png...
Processing scatter density plot for model 'ufschem_v1' and observation 'ish_lite'...
Saving scatter density plot to ./output/ish_lite_ufschem/plot_grp6.scatter_density.ws.2017-07-01_00.2017-07-03_00.state.MI_ish_lite_vs_ufschem_v1.png...
../_images/2e5503f59b037b8bb8fdf051c8817b3a4e2d8afe27130c6adb4d2db06f7f3880.png
Value of fill after reading from scatter_density_config: True
Saving scatter density plot to ./output/ish_lite_ufschem/plot_grp6.scatter_density.dew_pt_temp.2017-07-01_00.2017-07-03_00.state.MI_ish_lite_vs_ufschem_v1.png...
Processing scatter density plot for model 'ufschem_v1' and observation 'ish_lite'...
Saving scatter density plot to ./output/ish_lite_ufschem/plot_grp6.scatter_density.dew_pt_temp.2017-07-01_00.2017-07-03_00.state.MI_ish_lite_vs_ufschem_v1.png...
../_images/122a43fe65286c6bf4d59b033f270412e4f1921a7234e0cea5f4fb3737d9b08b.png
Saving rose plot to ./output/ish_lite_ufschem/plot_grp7.rose_plot.temp.2017-07-01_00.2017-07-03_00.state.MI...
../_images/cb6d9a2797dd792812011c9f8be521aa2283d0970e717b53d8b6e57eb4f65be8.png
Saving rose plot to ./output/ish_lite_ufschem/plot_grp7.rose_plot.temp.2017-07-01_00.2017-07-03_00.siteid.72539614815...
../_images/5f69a373420502c2dd00711c9fd3b39529b038096ca9fddfdcf4a89e056e721e.png
Saving rose plot to ./output/ish_lite_ufschem/plot_grp7.rose_plot.ws.2017-07-01_00.2017-07-03_00.state.MI...
../_images/6228018439cf97daf39980045c27dce938e8396f3478091c8fe14e7a5698d7ad.png
Saving rose plot to ./output/ish_lite_ufschem/plot_grp7.rose_plot.ws.2017-07-01_00.2017-07-03_00.siteid.72539614815...
../_images/53c2cbeeb72bc16defacac6d5714d0e4f0e739f33c0b3426660f96685a22e270.png
Saving rose plot to ./output/ish_lite_ufschem/plot_grp7.rose_plot.dew_pt_temp.2017-07-01_00.2017-07-03_00.state.MI...
../_images/a4ee7e1dc553a0ad016cddef7f8843c5e7cdc6a2192fa7e9414ec513229389c4.png
Saving rose plot to ./output/ish_lite_ufschem/plot_grp7.rose_plot.dew_pt_temp.2017-07-01_00.2017-07-03_00.siteid.72539614815...
../_images/5c2405b93256b2cca66ea97130141286202946deb0f5167356ad637bc8a7d76c.png
CPU times: user 2min 54s, sys: 15.8 s, total: 3min 10s
Wall time: 2min 25s
../_images/f677130c041b3e3e2586def2f7ffe448836cc736fbe8f456fd2cafb1372bcc0d.png ../_images/92e5481180090fb4c5cd70e9fb91aaeaa830d0186cfedd35daea2d906eb24ac4.png ../_images/c906b7637dfef7acdf0e4d49b2d5eff565cf333e014893914663f347f4a45f77.png ../_images/a1984fe22d9507e896d4710813c4ff8a9af25c2f55af5f1602628ca761f08c9b.png ../_images/7913eb450389507dc20e79b304c1336bf0477ba7df05650a78badd65622d3e2d.png ../_images/82b78c9403990d0e82a009847158d64e99c913e5787ae14a4b7a542b328ebb56.png
%%time

an.stats()
CPU times: user 6.22 s, sys: 7.81 s, total: 14 s
Wall time: 14.1 s
../_images/eb0787c60bd43e7b3eadb2f8dc47e3d869e57f9320fd3816d6b04807434b18e9.png ../_images/5c89922e62349f17e32441816d0a1cc6f2081719e992927fd6a4fb2096f991df.png ../_images/b68c56c7933c1dcb188a46abda869861b3e552241ba0aef70171c4a0119c99f1.png

The stats routine has produced two files (one for each data variable). This is one of them:

output/airnow_wrfchem/stats.OZONE.all.CONUS.2019-09-05_06.2019-09-06_06.csv
Stat_ID,Stat_FullName,airnow_RACM_ESRL,airnow_RACM_ESRL_VCP
MB,Mean_Bias,3.93,3.23
MdnB,Median_Bias,3.86,3.27
R2,Coefficient_of_Determination_(R2),0.56,0.54
RMSE,Root_Mean_Square_Error,11.64,11.59