lair.air.noaa#

NOAA greenhouse gas data.

Module Attributes

CARBONTRACKER_DIR

CarbonTracker data directory

GML_DIR

NOAA GML data directory

Classes

CarbonTracker(version[, ...])

NOAA CarbonTracker

CarbonTrackerCH4([version, ...])

NOAA CarbonTracker-CH4

Flask(specie, site[, platform, lab_id, ...])

NOAA GML Flask

lair.air.noaa.CARBONTRACKER_DIR = '/uufs/chpc.utah.edu/common/home/lin-group11/group_data/carbontracker'#

CarbonTracker data directory

lair.air.noaa.GML_DIR = '/uufs/chpc.utah.edu/common/home/lin-group11/group_data/gml'#

NOAA GML data directory

class lair.air.noaa.CarbonTracker(version: str, carbon_tracker_directory: str | None = None, cache: bool = True)[source]#

NOAA CarbonTracker

Attributes

specie

(Literal[‘ch4’, ‘co2’]) The greenhouse gas specie.

version

(str) The CarbonTracker version.

directory

(str) The directory for the version.

cache

(bool) Whether to cache the data.

Methods

get_specie_from_version(version)

Get the specie from the version.

from_version(version, carbon_tracker_directory=None)

Create a CarbonTracker object from the version.

download(sub_dirs=[‘fluxes’, ‘molefractions’], pattern=None)

Download CarbonTracker data from the NOAA GML FTP server.

__init__(version: str, carbon_tracker_directory: str | None = None, cache: bool = True)[source]#

Initialize a CarbonTracker object.

Parameters:
versionstr

The version of CarbonTracker data to download. Visit https://gml.noaa.gov/aftp/products/carbontracker/ to see available versions.

carbon_tracker_dirstr, optional

The directory to download the data to, by default CARBONTRACKER_DIR.

cachebool, optional

Whether to cache the data, by default True.

static get_specie_from_version(version: str) Literal['ch4', 'co2'][source]#

Get the specie from the version.

Parameters:
versionstr

The version of CarbonTracker data.

Returns:
Literal[‘ch4’, ‘co2’]

The specie.

static from_version(version: str, carbon_tracker_directory: str | None = None)[source]#

Create a CarbonTracker object from the version.

Parameters:
versionstr

The version of CarbonTracker data to download. Visit https://gml.noaa.gov/aftp/products/carbontracker/ to see available versions.

carbon_tracker_directorystr, optional

The directory to download the data to, by default CARBONTRACKER_DIR.

Returns:
CarbonTracker

The CarbonTracker object.

download(sub_dirs: list[str] = ['fluxes', 'molefractions'], pattern: str = None)[source]#

Download CarbonTracker data from the NOAA GML FTP server.

Parameters:
sub_dirslist of str, optional

The subdirectories to download data from, by default [‘fluxes’, ‘molefractions’]. If None, download the entire version data.

patternstr, optional

The pattern to match against the files, by default None

class lair.air.noaa.CarbonTrackerCH4(version='CT-CH4-2023', carbon_tracker_directory=None, cache=True, parallel_parse=True)[source]#

NOAA CarbonTracker-CH4

Attributes

molefractions

(xr.Dataset) The molefractions Dataset.

Methods

calc_molefractions_pressure(molefractions)

Calculate the pressure at each level in the molefractions Dataset.

__init__(version='CT-CH4-2023', carbon_tracker_directory=None, cache=True, parallel_parse=True)[source]#

Initialize a CarbonTracker object.

Parameters:
versionstr

The version of CarbonTracker data to download. Visit https://gml.noaa.gov/aftp/products/carbontracker/ to see available versions.

carbon_tracker_dirstr, optional

The directory to download the data to, by default CARBONTRACKER_DIR.

cachebool, optional

Whether to cache the data, by default True.

property molefractions: Dataset#

Molefractions Dataset. Cached property.

static calc_molefractions_pressure(molefractions) Dataset[source]#

Calculate the pressure at each level in the molefractions Dataset.

Parameters:
molefractionsxr.Dataset

The molefractions Dataset.

Returns:
xr.Dataset

The molefractions Dataset with the pressure calculated.

class lair.air.noaa.Flask(specie: str, site: str, platform: Literal['surface', 'shipboard'] = 'surface', lab_id: int = 1, measurement_group: Literal['ccgg', 'sil'] = 'ccgg', frequency: Literal['event', 'month'] = 'event', driver: Literal['pandas', 'xarray'] = 'pandas', gml_dir: str | None = None)[source]#

NOAA GML Flask

Attributes

specie

(str) The greenhouse gas specie.

site

(str) The site where the flask samples were collected.

platform

(str, optional) The platform where the flask samples were collected, by default ‘surface’.

lab_id

(int, optional) The lab ID, by default 1.

measurement_group

(str, optional) The measurement group, by default ‘ccgg’.

frequency

(str, optional) The frequency of the measurements, by default ‘event’.

driver

(str, optional) The driver to use to read the data, by default ‘pandas’.

gml_dir

(str, optional) The NOAA GML directory to download the data to, by default GML_DIR.

directory

(str) The directory for the Flask data.

filename

(str) The filename for the Flask data.

filepath

(str) The filepath for the Flask data.

data

(pd.DataFrame | xr.Dataset) The Flask data.

file_template

(str) The template for the Flask filename.

driver_ext

(dict) The driver extensions.

__init__(specie: str, site: str, platform: Literal['surface', 'shipboard'] = 'surface', lab_id: int = 1, measurement_group: Literal['ccgg', 'sil'] = 'ccgg', frequency: Literal['event', 'month'] = 'event', driver: Literal['pandas', 'xarray'] = 'pandas', gml_dir: str | None = None)[source]#

Initialize a Flask object.

Parameters:
speciestr

The greenhouse gas specie.

sitestr

The site where the flask samples were collected.

platformstr, optional

The platform where the flask samples were collected, by default ‘surface’.

lab_idint, optional

The lab ID, by default 1.

measurement_groupstr, optional

The measurement group, by default ‘ccgg’.

frequencystr, optional

The frequency of the measurements, by default ‘event’.

driverstr, optional

The driver to use to read the data, by default ‘pandas’.

gml_dirstr, optional

The NOAA GML directory to download the data to, by default GML_DIR.

static apply_qaqc(data: DataFrame | Dataset, driver: str = 'pandas')[source]#

Apply QA/QC to the Flask data.

Parameters:
datapd.DataFrame | xr.Dataset

The Flask data.

driverstr, optional

The driver to use to read the data, by default ‘pandas’.

Returns:
pd.DataFrame | xr.Dataset

The Flask data with QA/QC applied.