Skip to content

Commit

Permalink
Merge pull request #252 from btang1/aircraft_ozone_sonder
Browse files Browse the repository at this point in the history
add ozone sonder plot based on 'develop aircraft' branch
  • Loading branch information
rschwant authored Nov 13, 2024
2 parents 5878fdb + cefe1e8 commit d8cc60e
Show file tree
Hide file tree
Showing 10 changed files with 599 additions and 8 deletions.
188 changes: 188 additions & 0 deletions docs/examples/control_ufsaqm_ozonesonde.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
# General Description:
# Any key that is specific for a plot type will begin with ts for timeseries, ty for taylor
# Opt: Specifying the variable or variable group is optional
# For now all plots except time series average over the analysis window.
# Seting axis values - If set_axis = True in data_proc section of each plot_grp the yaxis for the plot will be set based on the values specified in the obs section for each variable. If set_axis is set to False, then defaults will be used. 'vmin_plot' and 'vmax_plot' are needed for 'timeseries', 'spatial_overlay', and 'boxplot'. 'vdiff_plot' is needed for 'spatial_bias' plots and'ty_scale' is needed for 'taylor' plots. 'nlevels' or the number of levels used in the contour plot can also optionally be provided for spatial_overlay plot. If set_axis = True and the proper limits are not provided in the obs section, a warning will print, and the plot will be created using the default limits.
analysis:
start_time: '2023-06-24-00:00:00' #UTC
end_time: '2023-06-25-00:00:00' #UTC
output_dir: ./output/ufsaqm_ozonesonde
debug: True

model:
ufsaqm_cmaq52: # model label
files: 'example:ufsaqm:cmaq52_2023-06-24_20-21'
mod_type: 'rrfs'
radius_of_influence: 19500 #meters: horizontal resolution * 1.5
mapping: #model species name : obs species name
gml-ozonesondes:
o3_ave: 'o3'
variables:
pres_pa_mid:
rename: pressure_model
unit_scale: 1
unit_scale_method: '*'
projection: ~
plot_kwargs: #Opt
color: 'red'
marker: '.'
linestyle: '-'

ufsaqm_cmaq54: # model label
files: 'example:ufsaqm:cmaq54_2023-06-24_20-21'
mod_type: 'rrfs'
radius_of_influence: 19500 #meters: horizontal resolution * 1.5
mapping: #model species name : obs species name
gml-ozonesondes:
o3_ave: 'o3'
variables:
pres_pa_mid:
rename: pressure_model
unit_scale: 1
unit_scale_method: '*'
projection: ~
plot_kwargs: #Opt
color: 'cornflowerblue'
marker: '.'
linestyle: '-'

obs:
gml-ozonesondes: # obs label
filename: 'example:gml-100m-ozonesondes:as-of-2024-02-09'
obs_type: ozone_sonder
variables: #Opt
o3:
unit_scale: 1000 #Opt Scaling factor (original ppmv, convert to ppbv)
unit_scale_method: '*' #Opt Multiply = '*' , Add = '+', subtract = '-', divide = '/'
nan_value: -1.0 # Opt Set this value to NaN
ylabel_plot: 'Ozone (ppbv)'
vmin_plot: 10.0 #Opt Min for y-axis during plotting. To apply to a plot, change restrict_yaxis = True.
vmax_plot: 100.0 #Opt Max for y-axis during plotting. To apply to a plot, change restrict_yaxis = True.
vdiff_plot: 20.0 #Opt +/- range to use in bias plots. To apply to a plot, change restrict_yaxis = True.
#nlevels_plot: 21 #Opt number of levels used in colorbar for contourf plot.
#regulatory: False #Opt compute regulatory functions
latitude:
unit_scale: 1
unit_scale_method: '*'
longitude:
unit_scale: 1
unit_scale_method: '*'
press:
rename: pressure_obs # name to convert this variable to
unit_scale: 100 # convert model hPa to Pa
unit_scale_method: '*'
# temp:
# rename: temperature_obs # name to convert this variable to
# unit_scale: 0 # original in degree C
# unit_scale_method: '-'

plots:
plot_grp1:
type: 'vertical_single_date' # plot type
fig_kwargs: #Opt to define figure options
figsize: [6,8] # figure size if multiple plots
default_plot_kwargs: # Opt to define defaults for all plots. Model kwargs overwrite these.
linewidth: 2.0
markersize: 5.
text_kwargs: #Opt
fontsize: 18.
domain_type: ['all'] #List of domain types: 'all' or any domain in obs file. (e.g., airnow: epa_region, state_name, siteid, etc.)
domain_name: ['CONUS'] #List of domain names. If domain_type = all domain_name is used in plot title.

altitude_range: [0,10]
altitude_method: ['sea level'] #choose from 'ground level' or 'sea level'
station_name: ['Trinidad Head, California']
compare_date_single: [2023,6,24,20,30,18]
monet_logo_position: [1] #1 is lower left, 4 is upper left.
data: ['gml-ozonesondes_ufsaqm_cmaq52', 'gml-ozonesondes_ufsaqm_cmaq54'] # make this a list of pairs in obs_model where the obs is the obs label and model is the model_label

data_proc:
#filter_dict: {'state_name':{'value':['CA','NY'],'oper':'isin'},'WS':{'value':1,'oper':'<'}}
#filter_string: state_name in ['CA','NY'] and WS < 1 # Uses pandas query method.
#rem_obs_by_nan_pct: {'group_var': 'siteid','pct_cutoff': 25,'times':'hourly'} # Groups by group_var, then removes all instances of groupvar where obs variable is > pct_cutoff % nan values
rem_obs_nan: True # True: Remove all points where model or obs variable is NaN. False: Remove only points where model variable is NaN.
#ts_select_time: 'time_local' #Time used for avg and plotting: Options: 'time' for UTC or 'time_local'
#ts_avg_window: 'H' # Options: None for no averaging or list pandas resample rule (e.g., 'H', 'D')
set_axis: True #If select True, add vmin_plot and vmax_plot for each variable in obs.

plot_grp2:
type: 'vertical_boxplot_os' # plot type
fig_kwargs: #Opt to define figure options
figsize: [6,8] # figure size if multiple plots
default_plot_kwargs: # Opt to define defaults for all plots. Model kwargs overwrite these.
linewidth: 2.0
markersize: 5.
text_kwargs: #Opt
fontsize: 18.
domain_type: ['all'] #List of domain types: 'all' or any domain in obs file. (e.g., airnow: epa_region, state_name, siteid, etc.)
domain_name: ['CONUS'] #List of domain names. If domain_type = all domain_name is used in plot title.

altitude_range: [0,10]
altitude_method: ['ground level'] #choose from 'ground level' or 'sea level'
station_name: ['Trinidad Head, California']
compare_date_single: [2023,6,24,20,30,18]
monet_logo_position: [1] #1 is lower left, 4 is upper left.
altitude_threshold_list: [0,1,2,3,4,5,6,7,8,9,10]
data: ['gml-ozonesondes_ufsaqm_cmaq52', 'gml-ozonesondes_ufsaqm_cmaq54'] # make this a list of pairs in obs_model where the obs is the obs label and model is the model_label

data_proc:
#filter_dict: {'state_name':{'value':['CA','NY'],'oper':'isin'},'WS':{'value':1,'oper':'<'}}
#filter_string: state_name in ['CA','NY'] and WS < 1 # Uses pandas query method.
#rem_obs_by_nan_pct: {'group_var': 'siteid','pct_cutoff': 25,'times':'hourly'} # Groups by group_var, then removes all instances of groupvar where obs variable is > pct_cutoff % nan values
rem_obs_nan: True # True: Remove all points where model or obs variable is NaN. False: Remove only points where model variable is NaN.
#ts_select_time: 'time_local' #Time used for avg and plotting: Options: 'time' for UTC or 'time_local'
#ts_avg_window: 'H' # Options: None for no averaging or list pandas resample rule (e.g., 'H', 'D')
set_axis: True #If select True, add vmin_plot and vmax_plot for each variable in obs.

plot_grp3:
type: 'density_scatter_plot_os' # plot type
fig_kwargs: #Opt to define figure options
figsize: [10,8] # figure size if multiple plots
default_plot_kwargs: # Opt to define defaults for all plots. Model kwargs overwrite these.
linewidth: 2.0
markersize: 5.
text_kwargs: #Opt
fontsize: 18.
domain_type: ['all'] #List of domain types: 'all' or any domain in obs file. (e.g., airnow: epa_region, state_name, siteid, etc.)
domain_name: ['CONUS'] #List of domain names. If domain_type = all domain_name is used in plot title.

model_name_list: ['gml-ozonesondes', 'ufsaqm cmaq 5.2', 'ufsaqm cmaq 5.4']
altitude_range: [0,10]
altitude_method: ['ground level'] #choose from 'ground level' or 'sea level'

# station_name: ['Boulder, Colorado']
# compare_date_single: [2023,6,7,16,40,50]
# compare_date_single: [2023,6,15,16,6,29]
# compare_date_single: [2023,6,21,16,8,1]
# compare_date_single: [2023,6,28,18,23,44]
# compare_date_single: [2023,7,13,15,21,03]
# compare_date_single: [2023,7,17,16,17,04]
# compare_date_single: [2023,7,24,16,04,18]
# compare_date_single: [2023,8,1,15,23,46]
# compare_date_single: [2023,8,9,16,3,55]
# compare_date_single: [2023,8,16,13,59,47]
# compare_date_single: [2023,8,23,16,14,12]
# compare_date_single: [2023,8,29,16,25,12]

station_name: ['Trinidad Head, California']
# compare_date_single: [2023,6,12,1,2,7]
# compare_date_single: [2023,6,14,23,5,6]
compare_date_single: [2023,6,24,20,30,18]
# compare_date_single: [2023,7,03,20,38,41]
# compare_date_single: [2023,7,22,21,43,40]
# compare_date_single: [2023,8,4,22,16,11]
# compare_date_single: [2023,8,10,20,25,51]
# compare_date_single: [2023,8,18,20,9,52]
cmap_method: ['turbo']
monet_logo_position: [1] #1 is lower left, 4 is upper left.

data: ['gml-ozonesondes_ufsaqm_cmaq52', 'gml-ozonesondes_ufsaqm_cmaq54'] # make this a list of pairs in obs_model where the obs is the obs label and model is the model_label

data_proc:
#filter_dict: {'state_name':{'value':['CA','NY'],'oper':'isin'},'WS':{'value':1,'oper':'<'}}
#filter_string: state_name in ['CA','NY'] and WS < 1 # Uses pandas query method.
#rem_obs_by_nan_pct: {'group_var': 'siteid','pct_cutoff': 25,'times':'hourly'} # Groups by group_var, then removes all instances of groupvar where obs variable is > pct_cutoff % nan values
rem_obs_nan: True # True: Remove all points where model or obs variable is NaN. False: Remove only points where model variable is NaN.
#ts_select_time: 'time_local' #Time used for avg and plotting: Options: 'time' for UTC or 'time_local'
#ts_avg_window: 'H' # Options: None for no averaging or list pandas resample rule (e.g., 'H', 'D')
set_axis: True #If select True, add vmin_plot and vmax_plot for each variable in obs.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 45 additions & 0 deletions docs/examples/ufs-aqm-gml-ozonesonde.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# GML ozonesonde and UFS-AQM

[GML ozonesondes](https://gml.noaa.gov/ozwv/ozsondes/) can be fetched and loaded with MONETIO.
For this example, we use a pre-prepared dataset of the 100-m data[^100m] and compare to
runs of developmental versions of the UFS-AQM regional model.

This example works with {doc}`the CLI </cli>`. (``melodies-monet run``).

````{admonition} Control file.
:class: dropdown
```{literalinclude} control_ufsaqm_ozonesonde.yaml
:caption:
:linenos:
```
````

[^100m]: Soundings regridded into a mostly 100-m vertical grid, with a single time assigned
for the whole profile.

## Plots

```{figure} output/ufsaqm_ozonesonde/plot_grp1.vertical_single_date.o3.2023-06-24_00.2023-06-25_00.all.CONUS.png
:width: 85 %
:alt: vertical profiles
```

```{figure} output/ufsaqm_ozonesonde/plot_grp2.vertical_boxplot_os.o3.2023-06-24_00.2023-06-25_00.all.CONUS.png
:width: 85 %
:alt: vertical profiles with boxplots
````
```{figure} output/ufsaqm_ozonesonde/plot_grp3.density_scatter_plot_os.o3.2023-06-24_00.2023-06-25_00.all.CONUS.gml-ozonesondes_ufsaqm_cmaq52.ground-level.png
:width: 85 %
:alt: comparison scatter plot
```

```{figure} output/ufsaqm_ozonesonde/plot_grp3.density_scatter_plot_os.o3.2023-06-24_00.2023-06-25_00.all.CONUS.gml-ozonesondes_ufsaqm_cmaq54.ground-level.png
:width: 85 %
:alt: comparison scatter plot for the other model
```
3 changes: 2 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ MONETIO please refer to:
examples/read_paired_data
examples/aircraft_pairing
examples/AEROMMA_UFS-AQM_Plots

examples/ufs-aqm-gml-ozonesonde

.. toctree::
:hidden:
:maxdepth: 4
Expand Down
Loading

0 comments on commit d8cc60e

Please sign in to comment.