Skip to main content

Scrape CO2 data from Mauna Loa Observatory off of NOAA Earth Science Research Lab

Project description

Mauna Loa Observatory Carbon Dioxide Data Scraper

This Python package includes a script to scrape the NOAA Earth Science Research Lab for Carbon Dioxide (CO2) readings from the Mauna Loa Observatory in Hawai'i. You can access this data here: https://www.esrl.noaa.gov/gmd/ccgg/trends/mlo.html

Installation

pip install git+https://github.com/kylepollina/mlo_co2.git

Features

monthly_mean()

# Data from March 1958 through April 1974 have been obtained by C. David Keeling
# of the Scripps Institution of Oceanography (SIO) and were obtained from the
# Scripps website (scrippsco2.ucsd.edu).
# Monthly mean CO2 constructed from daily mean values
# Scripps data downloaded from http://scrippsco2.ucsd.edu/data/atmospheric_co2
# Monthly values are corrected to center of month based on average seasonal
# cycle. Missing days can be asymmetric which would produce a high or low bias.
# Missing months have been interpolated, for NOAA data indicated by negative stdev
# and uncertainty. We have no information for SIO data about Ndays, stdv, unc
# so that they are also indicated by negative numbers

Optional start date and end date parameters. Scraped from this url: https://www.esrl.noaa.gov/gmd/webdata/ccgg/trends/co2/co2_mm_mlo.txt

>>> from mlo_co2 import monthly_mean
>>> mean = monthly_mean(start=datetime(year=1985, day=1, month=1), end=datetime(year=2014, day=1, month=1))
>>> mean.keys()
dict_keys(['url', 'license', 'description', 'headers', 'raw', 'data'])
>>> mean['data'].keys()
dict_keys(['yr', 'mon', 'decimal', 'monthly average (ppm)', 'de-seasonalized (ppm)', '#days', 'st.dev of days', 'unc. of mon mean'])

annual_mean()

# Data from March 1958 through April 1974 have been obtained by C. David Keeling
# of the Scripps Institution of Oceanography (SIO) and were obtained from the
# Scripps website (scrippsco2.ucsd.edu).
#
# The estimated uncertainty in the annual mean is the standard deviation
# of the differences of annual mean values determined independently by
# NOAA/ESRL and the Scripps Institution of Oceanography.
#
# NOTE: In general, the data presented for the last year are subject to change,
# depending on recalibration of the reference gas mixtures used, and other quality
# control procedures. Occasionally, earlier years may also be changed for the same
# reasons.  Usually these changes are minor.
#
# CO2 expressed as a mole fraction in dry air, micromol/mol, abbreviated as ppm

Optional start date and end date parameters. Scraped from this url: https://www.esrl.noaa.gov/gmd/webdata/ccgg/trends/co2/co2_annmean_mlo.txt

>>> from mlo_co2 import annual_mean
>>> mean = annual_mean(start=datetime(year=1985, day=1, month=1), end=datetime(year=2014, day=1, month=1))
>>> mean.keys()
dict_keys(['url', 'license', 'description', 'headers', 'raw', 'data'])
>>> mean['data'].keys()
dict_keys(['yr', 'mean (ppm)', 'unc'])

annual_mean_increase()

# Data from March 1958 through April 1974 have been obtained by C. David Keeling
# of the Scripps Institution of Oceanography (SIO) and were obtained from the
# Scripps website (scrippsco2.ucsd.edu).
#
# Annual CO2 mole fraction increase (ppm) from Jan 1 through Dec 31.
#
# The uncertainty in the Mauna Loa annual mean growth rate is estimated
# from the standard deviation of the differences between monthly mean
# values determined independently by the Scripps Institution of Oceanography
# and by NOAA/ESRL.
#
# NOTE: In general, the data presented for the last year are subject to change,
# depending on recalibration of the reference gas mixtures used, and other quality
# control procedures. Occasionally, earlier years may also be changed for the same
# reasons.  Usually these changes are minor.
#
# CO2 expressed as a mole fraction in dry air, micromol/mol, abbreviated as ppm

Optional start date and end date parameters. Scraped from this url: https://www.esrl.noaa.gov/gmd/webdata/ccgg/trends/co2/co2_gr_mlo.txt

>>> from mlo_co2 import annual_mean_increase
>>> mean = annual_mean_increase()
>>> mean.keys()
dict_keys(['url', 'license', 'description', 'headers', 'raw', 'data'])
>>> mean['data'].keys()
dict_keys(['yr', 'ann inc', 'unc'])

weekly_mean()

# NOTE: DATA FOR THE LAST SEVERAL MONTHS ARE PRELIMINARY, ARE STILL SUBJECT
# TO QUALITY CONTROL PROCEDURES.
# NOTE: The week "1 yr ago" is exactly 365 days ago, and thus does not run from
# Sunday through Saturday. 365 also ignores the possibility of a leap year.
# The week "10 yr ago" is exactly 10*365 days +3 days (for leap years) ago.

Optional start date and end date parameters. Scraped from this url: https://www.esrl.noaa.gov/gmd/webdata/ccgg/trends/co2/co2_weekly_mlo.txt

>>> from mlo_co2 import weekly_mean
>>> mean = weekly_mean()
>>> mean.keys()
dict_keys(['url', 'license', 'description', 'headers', 'raw', 'data'])
>>> mean['data'].keys()
dict_keys(['yr', 'mon', 'day', 'decimal', 'ppm', '#days', '1 yr ago', '10 yr ago', 'since 1800'])

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mlo_co2-0.4.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

mlo_co2-0.4-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file mlo_co2-0.4.tar.gz.

File metadata

  • Download URL: mlo_co2-0.4.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.9.1

File hashes

Hashes for mlo_co2-0.4.tar.gz
Algorithm Hash digest
SHA256 a06bcac8800f44dbb57183fa9e79e5101974d986de6d9422a2769919efab0455
MD5 c5a9b2b0783f717351ac0e9eb068a1e4
BLAKE2b-256 3ebb57ccef5e9bfa3b2bb5c5a62e3e78c15f145c817841bb572adb67156b7239

See more details on using hashes here.

File details

Details for the file mlo_co2-0.4-py3-none-any.whl.

File metadata

  • Download URL: mlo_co2-0.4-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.9.1

File hashes

Hashes for mlo_co2-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 6770ef3078f11cba9596bf20bbed2b65c7c218298b3304375caaec1f3b295ac7
MD5 fb1e18debf23ae6fafb51e266de8f0ab
BLAKE2b-256 3675e25f202b45d0eac8de33fa5c558121ba767e99b77844b564fddbfa8c356c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page