Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ozone sonder plot based on 'develop aircraft' branch #252

Merged
merged 32 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
3e2d1d5
print out
btang1 Feb 20, 2024
278ef69
keep change ozone sonder
btang1 Mar 5, 2024
2dd95fe
save tools
btang1 Mar 5, 2024
db2ba0f
somechange
btang1 Mar 8, 2024
7057cd1
Update driver_backup.py
btang1 Mar 14, 2024
c64f50d
Update driver.py
btang1 Mar 14, 2024
44cbea9
Update ozone_sonder_plots.py
btang1 Mar 14, 2024
185b32b
Update tools.py
btang1 Mar 14, 2024
2fd476a
Update ozone_sonder_plots.py
btang1 Mar 15, 2024
edef63f
Update driver.py
btang1 Mar 15, 2024
4dc7b55
Update driver.py
btang1 Mar 20, 2024
a0d4e75
Update ozone_sonder_plots.py
btang1 Mar 20, 2024
9ab0107
Update driver.py
btang1 Apr 4, 2024
8374e26
Update ozone_sonder_plots.py
btang1 Apr 4, 2024
e115a9e
Merge remote-tracking branch 'noaa/develop' into aircraft_ozone_sonder
zmoon Jul 15, 2024
52f9019
Add header
zmoon Jul 15, 2024
f951c30
Remove _backup files
zmoon Jul 15, 2024
9f55ecb
Remove extra spaces
zmoon Jul 15, 2024
ff35d42
Attempt to reduce diff
zmoon Jul 15, 2024
74eb26a
update becky
btang1 Oct 2, 2024
c387c26
final updata os
btang1 Oct 4, 2024
048a313
final check
btang1 Oct 4, 2024
a4dab17
zach help
btang1 Oct 7, 2024
80519fa
run_os_yaml
btang1 Oct 7, 2024
36d91cc
Add GML 100-m ozonesondes file to examples fetcher
zmoon Nov 8, 2024
5933b2b
Use example file
zmoon Nov 8, 2024
84c5743
Some AQM data for comparison to ozonesondes
zmoon Nov 8, 2024
fc3f8d1
Add page for ozonesonde example
zmoon Nov 8, 2024
07489b0
Address review comments
zmoon Nov 8, 2024
97aacda
Update examples
zmoon Nov 8, 2024
b1b1fd8
Initial ozonesonde plots inclusion
zmoon Nov 9, 2024
cefe1e8
Fix special settings condition
zmoon Nov 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -85,7 +85,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