Tutorial Datasets
The module melodies_monet.tutorial enables automatic downloading and caching of small[1] versions of the tutorial datasets.
This functionality requires pooch, an optional dependency.
import xarray as xr
import melodies_monet as mm
mm.tutorial.example_ids
['wrfchem:racm_esrl',
'wrfchem:racm_esrl_vcp',
'wrfchem:racm_esrl_reg',
'wrfchem:racm_esrl_vcp_reg',
'airnow:2019-09',
'airnow:2019-08',
'airnow:2019-07',
'airnow:2017-07',
'camchem:fv',
'camchem:se',
'camchem:se_scrip',
'ufsaqm:merge_0627_L1',
'ufsaqm:merge_0627_L2',
'ufsaqm:merge_0628_L1',
'ufsaqm:model_data',
'ufsaqm:AEROMMA',
'ufsaqm:cmaq52_2023-06-24_20-21',
'ufsaqm:cmaq54_2023-06-24_20-21',
'ufschem:2017-07',
'ufschem:2017-07_sfc',
'ufschem:2023-08-01',
'aeronet:2019-09',
'aeronet:2019-08',
'csn:2019_daily',
'improve:2019_daily',
'ncore:2019_daily',
'gml-100m-ozonesondes:as-of-2024-02-09',
'ish:2017-07',
'ish-lite:2017-07',
'uwy-sonde:2023-08-01']
The example IDs above can be used inside a control file to specify to use that dataset, downloading if necessary but otherwise loading from the pooch cache.
For example:
model:
cam-chem:
files: 'example:camchem:fv'
(for model)
obs:
airnow:
filename: 'example:airnow:2019-09'
(for obs)
Note that you can also use melodies_monet.tutorial.fetch_example() to load data directly.
fp = mm.tutorial.fetch_example("camchem:fv")
xr.open_dataset(fp)
Downloading data from 'https://csl.noaa.gov/groups/csl4/modeldata/melodies-monet/data/example_model_data/cesmfv_example/CAM_chem_merra2_FCSD_1deg_QFED_world_201909-01-09_small_sfc.nc' to file '/home/docs/.cache/pooch/f57b114fb465b23ee998209b50df7d9d-CAM_chem_merra2_FCSD_1deg_QFED_world_201909-01-09_small_sfc.nc'.
<xarray.Dataset> Size: 24MB
Dimensions: (time: 36, lev: 1, lat: 192, lon: 288, ilev: 2, nbnd: 2)
Coordinates:
* time (time) datetime64[ns] 288B 2019-09-01T06:00:00 ... 2019-09-10
* lev (lev) float64 8B 992.5
* lat (lat) float64 2kB -90.0 -89.06 -88.12 -87.17 ... 88.12 89.06 90.0
* lon (lon) float64 2kB 0.0 1.25 2.5 3.75 ... 355.0 356.2 357.5 358.8
* ilev (ilev) float64 16B 985.0 1e+03
Dimensions without coordinates: nbnd
Data variables:
O3 (time, lev, lat, lon) float32 8MB ...
P0 float64 8B ...
PM25 (time, lev, lat, lon) float32 8MB ...
PS (time, lat, lon) float32 8MB ...
date (time) int32 144B ...
datesec (time) int32 144B ...
hyai (ilev) float64 16B ...
hyam (lev) float64 8B ...
hybi (ilev) float64 16B ...
hybm (lev) float64 8B ...
time_bnds (time, nbnd) datetime64[ns] 576B ...
Attributes:
Conventions: CF-1.0
source: CAM
case: fmerra.2.1003.FCSD.f09.qfedcmip.56L.001.branch02
logname: buchholz
host: cheyenne3
initial_file: /glade/p/cesmdata/cseg/inputdata/atm/cam/inic/fv/f.e20...
topography_file: /glade/p/cesmdata/cseg/inputdata/atm/cam/met/MERRA2/0....
model_doi_url: https://doi.org/10.5065/D67H1H0V
time_period_freq: hour_6
history: Mon Feb 28 16:25:23 2022: ncks -7 -L 1 --baa=4 --ppc d...
NCO: netCDF Operators version 5.0.6 (Homepage = http://nco....