lair.noaa.CarbonTracker#
- class lair.noaa.CarbonTracker(version, carbon_tracker_directory=None, cache=True)[source]#
Bases:
objectNOAA CarbonTracker
- specie#
The greenhouse gas specie.
- Type:
Literal[‘ch4’, ‘co2’]
- from_version(version, carbon_tracker_directory=None)[source]#
Create a CarbonTracker object from the version.
- download(sub_dirs=['fluxes', 'molefractions'], pattern=None)[source]#
Download CarbonTracker data from the NOAA GML FTP server.
- static from_version(version, carbon_tracker_directory=None)[source]#
Create a CarbonTracker object from the version.
- Parameters:
version (str) – The version of CarbonTracker data to download. Visit https://gml.noaa.gov/aftp/products/carbontracker/ to see available versions.
carbon_tracker_directory (str, optional) – The CarbonTracker data root, by default
$LAIR_CARBONTRACKER_DIR.
- Returns:
CarbonTracker – The CarbonTracker object.
- download(sub_dirs=('fluxes', 'molefractions'), pattern=None)[source]#
Download CarbonTracker data from the NOAA GML FTP server.
- Parameters:
sub_dirs (list of str, optional) – The subdirectories to download data from, by default [‘fluxes’, ‘molefractions’]. If None, download the entire version data.
pattern (str, optional) – Only download matching files: a glob against the remote path if it has wildcards (e.g.
'*2015-06*'), else a substring. By default None.
- sample(points)[source]#
Sample the molefraction field at
points.pointsis a DataFrame with columnstime(UTC sample time),lati,long,zagl; any other columns (e.g.indx,run_time) are carried through for downstream grouping. Returns one row per input point withct_<specie>_<units>and the CT cell/level used. Points whose UTC date has no molefraction file are dropped.
- background(points, by=None)[source]#
Background mole fraction [ppm]: mean of the sampled field over
points.Samples the field at every point (e.g. trajectory endpoints) and averages over them. With
by(e.g.'run_time') the mean and 1-sigma spread are returned per group; otherwise a single-row summary. Output is ppm (CT-CH4 mole fractions are stored in ppb, CO2 in ppm).