Skip to content

Commit

Permalink
Merge pull request #171 from colin-harkins/develop_aircraft
Browse files Browse the repository at this point in the history
Merge all new features from develop into develop_aircraft
  • Loading branch information
colin-harkins authored Mar 16, 2023
2 parents b8d1508 + 3a0305d commit d016076
Show file tree
Hide file tree
Showing 75 changed files with 12,535 additions and 1,111 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- uses: actions/checkout@v3

- name: Set up Python (micromamba)
uses: mamba-org/provision-with-micromamba@v12
uses: mamba-org/provision-with-micromamba@v14
with:
environment-file: docs/environment-docs.yml
cache-env: true
Expand Down Expand Up @@ -67,7 +67,7 @@ jobs:
cd docs/examples
melodies-monet --version
python -m melodies_monet --version
melodies-monet control_idealized.yaml
melodies-monet run control_idealized.yaml
cd -
docs:
Expand Down
19 changes: 0 additions & 19 deletions docs/README_docs.txt

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 13 additions & 2 deletions docs/api.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
API
---

.. module:: melodies_monet

:mod:`melodies_monet` has these top-level submodules, which are imported lazily:

.. currentmodule:: melodies_monet

.. autosummary::
:toctree: api/
:recursive:

melodies_monet

driver
plots
stats
tutorial
util

A typical workflow involves using an instance of :class:`driver.analysis`.
See :doc:`the examples <examples/intro_examples>`.

:ref:`genindex`

Expand Down
2 changes: 1 addition & 1 deletion docs/appendix/machine-specific-install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ environment for running and developing MELODIES MONET.
.. note::
In the recent past, downloading a lot of dependent packages at once
with conda on Hera led to stalling.
To overcome this challange, try installing packages individually::
To overcome this challenge, try installing packages individually::
$ conda create --name melodies-monet python=3.9
$ conda activate melodies-monet
Expand Down
229 changes: 193 additions & 36 deletions docs/appendix/yaml.rst

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion docs/applications/forecasts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,15 @@ CO, and NO\ :sub:`2` and AERONET AOD measurements.

Check out the full analysis for each forecast `here <https://rapidrefresh.noaa.gov/RAPchemEPA/>`__.

This includes a new feature developed by NOAA GSL summer student, Mackenzie Arnold,
to `interactively view plots for individual surface sites online <https://rapidrefresh.noaa.gov/RAPchemEPAsites/>`__.

The code to produce this analysis using MELODIES MONET is in the
``examples/forecast_evaluation`` folder on GitHub.

Example plots for ozone and PM\ :sub:`2.5` for the forecast on January 18th, 2022
are below.

.. figure:: /_static/figures/OZONE_EPA_f00_rapchem.png

.. figure:: /_static/figures/PM25_EPA_f00_rapchem.png
.. figure:: /_static/figures/PM25_EPA_f00_rapchem.png
38 changes: 38 additions & 0 deletions docs/background/supported_analyses.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Supported Analyses
==================

Supported data analysis options in MELODIES MONET are explained below.

Calculating Regulatory Metrics
------------------------------

MDA8 (8-hour daily maximum) ozone and 24 hour average PM\ :sub:`2.5` \ can be
calculated within MELODIES MONET from hourly observational and model data. All plots
except for the "spatial_overlay" plot and all stats will work with the regulatory
metrics.

The MDA8 ozone metric is calculated based on the following:
1) Local time is used
2) For each day, rolling 8-hour averages are calculated for each period with at least 6 hours of data
3) The MDA8 value is the highest of the 8-hour averages in a given day
4) The MDA8 value is only used for a given day if at least 18 of the 24 possible 8-hour averages are available

As described in the EPA report on
`Health Risk and Exposure Assessment for Ozone <https://www3.epa.gov/ttn/naaqs/standards/ozone/data/20140131healthrea4a.pdf>`__
(page 8).

The 24 hour average PM\ :sub:`2.5` \ metric is calculated based on the following:
1) Local time is used
2) The average PM\ :sub:`2.5` \ value is calculated over a given day
3) The PM\ :sub:`2.5` \ value is only used for a given day if at least 18 of the 24 possible hours are available

In order to calculate the regulatory metric, add "regulatory: True" into the input
YAML file under the "obs" section for each variable that you want to apply the calculation.
Currently, this option only works for "OZONE" and "PM2.5" variables. There are separate
plotting characteristics for the regulatory options ("ylabel_reg_plot", "vmin_reg_plot",
"vmax_reg_plot", and "vdiff_reg_plot") that can also be specified in the input YAML file.
An example input YAML file that calculates MDA8 ozone and 24 hr PM\ :sub:`2.5` \ is in
``examples/yaml/control_rrfs_cmaq_airnow_reg.yaml``. These input YAML file options are
also further described in the Appendix under :doc:`/appendix/yaml`.


3 changes: 2 additions & 1 deletion docs/background/supported_datasets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ Supported Models
* `CESM/CAM-chem <https://www2.acom.ucar.edu/gcm/cam-chem>`_
* RRFS-CMAQ (under development)
* GSD-Chem (under development)

* `RAQMS <http://raqms-ops.ssec.wisc.edu/>`_

In general, processing requires input to be in netCDF format. For the above
models, scripts to configure the model data into a standard format for
MELODIES MONET are available. If input datasets are in netCDF format and
Expand Down
16 changes: 11 additions & 5 deletions docs/background/supported_plots.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,16 @@ Surface Evaluation
.. figure:: /_static/figures/plot_grp3.spatial_bias.OZONE.2019-08-01_12.2019-08-11_12.all.CONUS.airnow_rrfs_diurnal_fires.png

**Spatial Bias** - Difference plot of model - observations averaged over
the analysis window with options to specify the domain.
the analysis window with options to specify the domain. Defaults to average,
but users can also optionally plot percentiles.

.. figure:: /_static/figures/plot_grp6.spatial_bias_exceedance.OZONE_reg.2019-08-01_13.2019-08-31_12.all.CONUS.airnow_cmaq_oper_exceedance.png

**Spatial Bias Exceedance** - Difference plot of model - observations for the number of
exceedances greater than the regulatory standard within the analysis window with options to specify
the domain. This only works for regulatory calculations (regulatory = True) for variables "OZONE" and "PM2.5".
An exceedance occurs when MDA8 ozone is greater than 70 ppbv or 24 hour averaged PM\ :sub:`2.5` \ is
greater than 35 ug m\ :sup:`-3`\.

.. figure:: /_static/figures/plot_grp4.spatial_overlay.OZONE.2019-08-01_12.2019-08-11_12.all.CONUS.airnow_rrfs_diurnal_fires.png

Expand All @@ -40,10 +49,7 @@ Surface Evaluation
:scale: 25 %

**BOX-plot** - BOX-plot comparing one or more model results with one
observation over the analysis window with options to specify the domain.

Adding an option to plot regulatory metrics like MDA8 ozone is under
development.
observation over the analysis window with options to specify the domain.

See the `Expand Surface Observations <https://github.com/NOAA-CSL/MELODIES-MONET/projects/7>`_
project on GitHub to learn about current and future development.
Expand Down
24 changes: 24 additions & 0 deletions docs/cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,30 @@
Command Line Interface
======================

Installing :mod:`melodies_monet` provides a command line interface (CLI):
``melodies-monet``.

For example, you can use the CLI to run control files without writing
any Python code::

melodies-monet run control.yml

**Subcommands**

* |run|_ -- run a control file
* |get-airnow|_ -- get AirNow data
* |get-aeronet|_ -- get AERONET data

.. |run| replace:: ``run``
.. _run: #melodies-monet-run

.. |get-airnow| replace:: ``get-airnow``
.. _get-airnow: #melodies-monet-get-airnow

.. |get-aeronet| replace:: ``get-aeronet``
.. _get-aeronet: #melodies-monet-get-aeronet


.. click:: melodies_monet._cli:_typer_click_object
:prog: melodies-monet
:nested: full
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
'myst_nb',
'sphinx_design',
'sphinx_click',
'sphinx_togglebutton',
]

extlinks = {
Expand Down
12 changes: 7 additions & 5 deletions docs/develop/datasets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,19 @@ Observations
------------

Examples for how to read in data from Aeronet, AirNow, and Improve are in the
``examples/process_obs`` folder of the code on GitHub. Use these examples
as reference in order to add new surface observational datasets.
``examples/process_obs`` folder in the MELODIES MONET repository
`on GitHub <https://github.com/NOAA-CSL/MELODIES-MONET>`__.
Use these examples as reference in order to add new surface observational datasets.

Instructions for reading in aircraft and satellite observations are under development.

Models
------
Examples for reading model datasets can be
found in the monetio/models folder.
found in the ``monetio/models`` folder in the MONETIO repository
`on GitHub <https://github.com/noaa-oar-arl/monetio>`__.
These include e.g., _cesm_fv_mm.py, _cmaq_mm.py, and _wrfchem_mm.py.
While a part of the monetio repository,
the MELODIES-MONET readers are designated with an _mm.
While a part of the MONETIO repository,
the MELODIES MONET readers are designated with an _mm.

Support for additional models is also under developed.
4 changes: 2 additions & 2 deletions docs/develop/developers_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ these instructions:

$ conda create --name melodies-monet python=3.9
$ conda activate melodies-monet
$ conda install -y -c conda-forge pyyaml monet monetio netcdf4 wrf-python click pooch jupyterlab
$ conda install -y -c conda-forge pyyaml monet monetio netcdf4 wrf-python typer rich pooch jupyterlab

(b) Clone [#clone]_ and link the latest development versions of MONET and MONETIO from GitHub to
your conda environment::
Expand Down Expand Up @@ -154,7 +154,7 @@ Either use the ``docs/environment-docs.yml`` file [#env]_
from the MELODIES MONET repository,
or add the following packages to your conda environment manually::

$ conda install -y -c conda-forge sphinx sphinx_rtd_theme myst-nb sphinx-design
$ conda install -y -c conda-forge sphinx sphinx_rtd_theme myst-nb sphinx-design sphinx-click typer

The restructured text sources (rst) are located
in the MELODIES-MONET/docs folders.
Expand Down
24 changes: 24 additions & 0 deletions docs/develop/development_team.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,43 @@ NOAA GSL Jordan Schnell
NCAR ACOM Louisa Emmons, David Fillmore
=============== =============================

Code Reviewers
--------------

================= =============== ========================================================
Reviewer GitHub Username Expertise
================= =============== ========================================================
Zachary Moon zmoon Docs, Connections to MONET and MONETIO, CI tests
David Fillmore dwfncar Satellite obs, Plots, Stats, Connection to METplus
Colin Harkins colin-harkins Docs, Aircraft obs, Plots, Stats
Louisa Emmons lkemmons Docs, Aircraft obs, Plots, Stats
Rebecca Schwantes rschwant Docs, Surface and aircraft obs, Plots, Stats
================= =============== ========================================================

Development Team Members
------------------------

Below is a list of people who have contributed to MELODIES MONET along with
their current and future development goals.

**Mackenzie Arnold:**
I’m a summer intern at CIRES/NOAA GSL working on model verification of smoke-forecast
models. I plan to help review the code, work to improve the site-specific analysis, add
in a new capability to interactively view plots for individual surface sites online,
and help with various other aspects of development.

**Megan Bela:**
I am a research scientist at CIRES/NOAA CSL working to improve process-level
understanding and representations of fire emissions, plume rise, and chemistry
in regional coupled chemistry-meteorology models. My plans include testing and
expanding the capability of MELODIES MONET for evaluating simulations with
research and operational models of fire impacts on air quality and weather.

**Margaret Bruckner:**
I am a graduate student at the University of Wisconsin-Madison. My development plans
primarily focus on adding capabilities for comparison of satellite observations to model
output and expanding data processing options.

**Rebecca Buchholz:**
I am a Project Scientist at NCAR/ACOM helping with the development of MELODIES MONET.
My development plans include incorporating satellite datasets such as MOPITT CO and
Expand Down
4 changes: 3 additions & 1 deletion docs/environment-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ channels:
- conda-forge
- nodefaults
dependencies:
- python=3.8
- python=3.9
#
# melodies_monet deps
- monet
- monetio
- netcdf4
- numpy<1.24
#
# Extras
- pooch
Expand All @@ -27,6 +28,7 @@ dependencies:
- sphinx-click
- sphinx-design
- sphinx_rtd_theme
- sphinx-togglebutton
#
- pip
- pip:
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/airnow_camchem_se.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"source": [
"## Control File\n",
"\n",
"Read in the required yaml control file that sets up all the definitons of what we want to pair and plot."
"Read in the required yaml control file that sets up all the definitions of what we want to pair and plot."
]
},
{
Expand Down
Loading

0 comments on commit d016076

Please sign in to comment.