Skip to main content

Python interface to RSIG Web API

Project description

pyrsig

Docs Tests pypi

pyrsig is a Python interface to the RSIG Web API. RSIG connects you to petabytes of air quality data from EPA, NASA, NOAA, and many other partners. pyrsig connects RSIG to xarray, pandas, and all your favorite python libraries.

Install

There are two easy ways to isntall pyrsig easily.

From pypi.org (most stable):

pip install pyrsig

From github (latest):

pip install git+https://github.com/barronh/pyrsig.git

User Guide

Many examples, tutorials, and guides are available at https://barronh.github.io/pyrsig. Only a few very basic examples are shown below.

Example

Get DataFrame for AQS ozone

import pyrsig

rsigapi = pyrsig.RsigApi(bdate='2022-03-01')
print([k for k in rsigapi.keys() if 'ozone' in k])
# ['airnow.ozone', 'airnow2.ozone', 'aqs.ozone', 'aqs.ozone_8hour_average', 'aqs.ozone_daily_8hour_maximum', 'pandora.ozone']
df = rsigapi.to_dataframe('aqs.ozone')
print(df.shape, *df.columns)
# (26760, 6) Timestamp(UTC) LONGITUDE(deg) LATITUDE(deg) STATION(-) ozone(ppb) SITE_NAME

Get DataFrame for PurpleAir PM25

import pyrsig

rsigapi = pyrsig.RsigApi(bdate='2022-03-01')
rsigapi.purpleair_kw['api_key'] = '<put your api key here>'
df = rsigapi.to_dataframe('purpleair.pm25_corrected')

Get DataFrame for TropOMI NO2

import pyrsig

rsigapi = pyrsig.RsigApi(bdate='2022-03-01')
df = rsigapi.to_dataframe('tropomi.offl.no2.nitrogendioxide_tropospheric_column')
print(df.shape, *df.columns)
# (303444, 4) Timestamp(UTC) LONGITUDE(deg) LATITUDE(deg) nitrogendioxide_tropospheric_column(molecules/cm2)

Get IOAPI formatted NetCDF TropOMI NO2

import pyrsig

rsigapi = pyrsig.RsigApi(bdate='2022-03-01')
ds = rsigapi.to_ioapi('tropomi.offl.no2.nitrogendioxide_tropospheric_column')
print(ds.data_vars)
# Data variables:
#     TFLAG      (TSTEP, VAR, DATE-TIME) int32 ...
#     LONGITUDE  (TSTEP, LAY, ROW, COL) float32 ...
#     LATITUDE   (TSTEP, LAY, ROW, COL) float32 ...
#     COUNT      (TSTEP, LAY, ROW, COL) int32 ...
#     NO2        (TSTEP, LAY, ROW, COL) float32 ...

Get List of Possible

import pyrsig

rsigapi = pyrsig.RsigApi()
keys = rsigapi.keys()
print(len(keys), keys)
# 80 ('airnow.pm25', ... 'aqs.ozone', ... 'cmaq.equates.conus.aconc.O3', ... 'hms.smoke',
#     'metar.wind', ... 'pandora.ozone', 'purpleair.pm25_corrected', ...
#     'tropomi.offl.no2.nitrogendioxide_tropospheric_column', ...
#     'viirsnoaa.jrraod.AOD550', ...)
keys = rsigapi.keys(offline=False) # slow and likely to many options
print(len(keys))
# 3875

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

pyrsig-0.11.1.tar.gz (182.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyrsig-0.11.1-py3-none-any.whl (187.7 kB view details)

Uploaded Python 3

File details

Details for the file pyrsig-0.11.1.tar.gz.

File metadata

  • Download URL: pyrsig-0.11.1.tar.gz
  • Upload date:
  • Size: 182.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyrsig-0.11.1.tar.gz
Algorithm Hash digest
SHA256 13b487f87c8e3a8575392db8ef297a0ba93e9bc8bae73047ee944277a122b9d5
MD5 270f639d07fbc8c6705a7be54753a207
BLAKE2b-256 796a3715318f45452a4b0855548abcb8f3c61e4dd256dc78cc848fc32d5b43d1

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyrsig-0.11.1.tar.gz:

Publisher: python-publish.yml on barronh/pyrsig

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyrsig-0.11.1-py3-none-any.whl.

File metadata

  • Download URL: pyrsig-0.11.1-py3-none-any.whl
  • Upload date:
  • Size: 187.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyrsig-0.11.1-py3-none-any.whl
Algorithm Hash digest
SHA256 493a78a279516880470469f77aa37f704905238d780e50936fe33d30bde36d74
MD5 b2210ba3b9f5baa88807c6cfab22cd55
BLAKE2b-256 6fcd94977a46d6a370daff7591b9c5840b65abd84d487c72ac18b1faa879e50e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyrsig-0.11.1-py3-none-any.whl:

Publisher: python-publish.yml on barronh/pyrsig

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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