lair.noaa.CarbonTrackerCO2#

class lair.noaa.CarbonTrackerCO2(version, carbon_tracker_directory=None, cache=True, grid='nam1x1', parallel_parse=True)[source]#

Bases: CarbonTracker

NOAA CarbonTracker (CO2)

Mole fractions are in ppm (micromol mol-1). Releases such as CT2019B keep the daily molefraction files flat in molefractions/co2_total/, one file per grid (CT2019B.molefrac_nam1x1_2015-06-01.nc, ..._glb3x2_...).

Each parameter is also an attribute of the same name.

Parameters:
  • version (str) – The version, such as 'CT2019B'.

  • carbon_tracker_directory (str, optional) – The CarbonTracker data root, by default $LAIR_CARBONTRACKER_DIR.

  • cache (bool, optional) – Whether to cache the data, by default True (see CarbonTracker).

  • grid (str, optional) – The molefraction grid to read, e.g. 'nam1x1' (North America, 1x1 deg, the default) or 'glb3x2' (global, 3x2 deg). Points outside the grid sample as NaN.

  • parallel_parse (bool, optional) – Whether molefractions opens the files in worker processes, one for each CPU this process may use (default True), or one at a time. The workers import the calling script again, so a script that reads molefractions needs the if __name__ == "__main__": guard. Inside a worker process, such as one of parallelize(), the files are opened one at a time whatever this says.

See also

CarbonTrackerCH4

The same for methane.

Examples

Nothing is read until the data is used:

>>> from lair.noaa import CarbonTrackerCO2
>>> ct = CarbonTrackerCO2("CT2019B", "carbontracker", grid="glb3x2")
>>> ct.molefractions_dir.as_posix()
'carbontracker/co2/CT2019B/molefractions/co2_total'

Attributes

molefractions

Molefractions Dataset on self.grid (lazy).

molefractions_dir

Directory of the total-CO2 molefraction files.

Inherited

From CarbonTracker: background, download, from_version, get_specie_from_version, sample, units