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

Downloader & cmorizer for NOAA GML surface flask trace gases #3847

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions doc/sphinx/source/input.rst
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,12 @@ A list of the datasets for which a CMORizers is available is provided in the fol
+------------------------------+------------------------------------------------------------------------------------------------------+------+-----------------+
| NOAA-MBL-CH4 | ch4s (Amon) | 2 | Python |
+------------------------------+------------------------------------------------------------------------------------------------------+------+-----------------+
| NOAA-GML-SURFACE-FLASK-CH4 | ch4s (Amon) | 2 | Python |
+------------------------------+------------------------------------------------------------------------------------------------------+------+-----------------+
| NOAA-GML-SURFACE-FLASK-CO2 | co2s (Amon) | 2 | Python |
+------------------------------+------------------------------------------------------------------------------------------------------+------+-----------------+
| NOAA-GML-SURFACE-FLASK-N2O | n2os (Amon) | 2 | Python |
+------------------------------+------------------------------------------------------------------------------------------------------+------+-----------------+
| NOAAGlobalTemp | tasa (Amon) | 2 | Python |
+------------------------------+------------------------------------------------------------------------------------------------------+------+-----------------+
| NSIDC-0116-[nh|sh] [#note4]_ | usi, vsi (day) | 3 | Python |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
# Filename
filename: 'ch4_surface-flask_ccgg_text.tar.gz'

# Trace gas
trace_gas: ch4

# Common global attributes for Cmorizer output
attributes:
dataset_id: NOAA-GML-SURFACE-FLASK-CH4
version: '1.0'
tier: 2
modeling_realm: atmos
project_id: OBS6
source: 'https://gml.noaa.gov/aftp/data/trace_gases/ch4/flask/surface/ch4_surface-flask_ccgg_text.tar.gz'
reference: 'noaa-gml-surface-flask-ch4'

# Variables to cmorize
variables:
ch4s:
mip: Amon
raw_name: ch4s
raw_units: 'mol mol-1'
standard_name: mole_fraction_of_methane_in_air
long_name: 'Mole Fraction of CH4'
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
# Filename
filename: 'co2_surface-flask_ccgg_text.tar.gz'

# Trace gas
trace_gas: co2

# Common global attributes for Cmorizer output
attributes:
dataset_id: NOAA-GML-SURFACE-FLASK-CO2
version: '1.0'
tier: 2
modeling_realm: atmos
project_id: OBS6
source: 'https://gml.noaa.gov/aftp/data/trace_gases/co2/flask/surface/co2_surface-flask_ccgg_text.tar.gz'
reference: 'noaa-gml-surface-flask-co2'

# Variables to cmorize
variables:
co2s:
mip: Amon
raw_name: co2s
raw_units: 'micromol mol-1'
standard_name: mole_fraction_of_carbon_dioxide_in_air
long_name: 'Mole Fraction of CO2'
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
# Filename
filename: 'n2o_surface-flask_ccgg_text.tar.gz'

# Trace gas
trace_gas: n2o

# Common global attributes for Cmorizer output
attributes:
dataset_id: NOAA-GML-SURFACE-FLASK-N2O
version: '1.0'
tier: 2
modeling_realm: atmos
project_id: OBS6
source: 'https://gml.noaa.gov/aftp/data/trace_gases/n2o/flask/surface/n2o_surface-flask_ccgg_text.tar.gz'
reference: 'noaa-gml-surface-flask-n2o'

# Variables to cmorize
variables:
n2os:
mip: Amon
raw_name: n2os
raw_units: 'mol mol-1'
standard_name: mole_fraction_of_nitrous_oxide_in_air
long_name: 'Mole Fraction of N2O'
24 changes: 24 additions & 0 deletions esmvaltool/cmorizers/data/datasets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1103,6 +1103,30 @@ datasets:
Download the following files:
ersst.v5.yyyymm.nc
for years 1854 onwards

NOAA-GML-SURFACE-FLASK-CH4:
tier: 2
source: https://gml.noaa.gov/aftp/data/trace_gases/ch4/flask/surface/
last_access: 2024-07-30
info: |
Download the following archive:
ch4_surface-flask_ccgg_text.tar.gz

NOAA-GML-SURFACE-FLASK-CO2:
tier: 2
source: https://gml.noaa.gov/aftp/data/trace_gases/co2/flask/surface/
last_access: 2024-07-30
info: |
Download the following archive:
co2_surface-flask_ccgg_text.tar.gz

NOAA-GML-SURFACE-FLASK-N2O:
tier: 2
source: https://gml.noaa.gov/aftp/data/trace_gases/n2o/flask/surface/
last access: 2024-07-30
info: |
Download the following archive:
n2o_surface-flask_ccgg_text.tar.gz

NOAAGlobalTemp:
tier: 2
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
"""Script to download NOAA Global Monitoring Lab surface flask data
for CH4 from NOAA's archive."""
import logging

from esmvaltool.cmorizers.data.downloaders.wget import WGetDownloader

logger = logging.getLogger(__name__)


def download_dataset(config, dataset, dataset_info,
start_date, end_date, overwrite):
"""Download dataset.

Parameters
----------
config : dict
ESMValTool's user configuration
dataset : str
Name of the dataset
dataset_info : dict
Dataset information from the datasets.yml file
start_date : datetime
Start of the interval to download
end_date : datetime
End of the interval to download
overwrite : bool
Overwrite already downloaded files
"""
downloader = WGetDownloader(
config=config,
dataset=dataset,
dataset_info=dataset_info,
overwrite=overwrite,
)
path = "https://gml.noaa.gov/aftp/data/trace_gases/ch4/flask/surface/"
file = "ch4_surface-flask_ccgg_text.tar.gz"
downloader.download_file(
path + file,
wget_options=[],
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
"""Script to download NOAA Global Monitoring Lab surface flask data
for CO2 from NOAA's archive."""
import logging

from esmvaltool.cmorizers.data.downloaders.wget import WGetDownloader

logger = logging.getLogger(__name__)


def download_dataset(config, dataset, dataset_info,
start_date, end_date, overwrite):
"""Download dataset.

Parameters
----------
config : dict
ESMValTool's user configuration
dataset : str
Name of the dataset
dataset_info : dict
Dataset information from the datasets.yml file
start_date : datetime
Start of the interval to download
end_date : datetime
End of the interval to download
overwrite : bool
Overwrite already downloaded files
"""
downloader = WGetDownloader(
config=config,
dataset=dataset,
dataset_info=dataset_info,
overwrite=overwrite,
)
path = "https://gml.noaa.gov/aftp/data/trace_gases/co2/flask/surface/"
file = "co2_surface-flask_ccgg_text.tar.gz"
downloader.download_file(
path + file,
wget_options=[],
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
"""Script to download NOAA Global Monitoring Lab surface flask data
for N2O from NOAA's archive."""
import logging

from esmvaltool.cmorizers.data.downloaders.wget import WGetDownloader

logger = logging.getLogger(__name__)


def download_dataset(config, dataset, dataset_info,
start_date, end_date, overwrite):
"""Download dataset.

Parameters
----------
config : dict
ESMValTool's user configuration
dataset : str
Name of the dataset
dataset_info : dict
Dataset information from the datasets.yml file
start_date : datetime
Start of the interval to download
end_date : datetime
End of the interval to download
overwrite : bool
Overwrite already downloaded files
"""
downloader = WGetDownloader(
config=config,
dataset=dataset,
dataset_info=dataset_info,
overwrite=overwrite,
)
path = "https://gml.noaa.gov/aftp/data/trace_gases/n2o/flask/surface/"
file = "n2o_surface-flask_ccgg_text.tar.gz"
downloader.download_file(
path + file,
wget_options=[],
)
Loading