Python interface to RSIG Web API
Project description
pyrsig
Python interface to RSIG Web API
Install
From pypi.org (most stable):
pip install pyrsig
From github (latest):
pip install git+https://github.com/barronh/pyrsig.git
User Guide
Examples and more information are available at https://barronh.github.io/pyrsig
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
Release history Release notifications | RSS feed
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.10.0.tar.gz
(245.1 kB
view details)
Built Distribution
pyrsig-0.10.0-py3-none-any.whl
(250.0 kB
view details)
File details
Details for the file pyrsig-0.10.0.tar.gz
.
File metadata
- Download URL: pyrsig-0.10.0.tar.gz
- Upload date:
- Size: 245.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9bd43b4d968a7edeb6c335ab4ea200abb4e9c1b248a4bde6b6ac816a35325b53 |
|
MD5 | e0f02c984170420045faaeef720f4ee2 |
|
BLAKE2b-256 | 37683987014b1086fd21feb0e60b40b417207ae13fd5920f29fef855133d02f8 |
File details
Details for the file pyrsig-0.10.0-py3-none-any.whl
.
File metadata
- Download URL: pyrsig-0.10.0-py3-none-any.whl
- Upload date:
- Size: 250.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 40874d48996a4e7dfd6385e9e1616562740fc790fa3dfcb3a77680fa25810c2f |
|
MD5 | 5c11825abd0658d61fecc6266994a918 |
|
BLAKE2b-256 | 5abf0de6ffa71ee422747cc0a678ed39ccab35a8d679fb57901817d0bbbb5a23 |