A Python package for fetching ISD Lite data
Project description
PyISD: A Python Package for NOAA's ISD Lite Dataset
PyISD is a Python package designed for loading and processing NOAA's ISD Lite dataset. The dataset, as described by NOAA, is a streamlined version of the full Integrated Surface Database (ISD). It includes eight common surface parameters in a fixed-width format, free of duplicate values, sub-hourly data, and complicated flags, making it suitable for general research and scientific purposes. For more details, visit the official ISD homepage.
Installation
pip install isd-fetch
Features
- Load and query the ISD Lite dataset with ease.
- Retrieve and process metadata for stations worldwide.
- Filter data based on spatial and temporal constraints.
Example Usage
1. Importing and Loading Metadata
You can start by importing the IsdLite
module, fetching metadata for weather stations worldwide and displaying a sample of the station metadata:
from pyisd import IsdLite
CRS = 4326
module = IsdLite(crs=CRS, verbose=True)
module.raw_metadata.sample(5)
The output displays station metadata including station name, latitude, longitude, elevation, and the period of available records:
USAF WBAN STATION NAME CTRY ST ... BEGIN END x y geometry
5416 172650 99999 ADIYAMAN TU NaN ... 2007-01-27 2024-11-17 38.283 37.750 POINT (38.283 37.75)
1362 032130 99999 ESKMEALS UK NaN ... 1973-01-02 1997-12-26 -3.400 54.317 POINT (-3.4 54.317)
4729 153150 99999 SEMENIC RO NaN ... 1973-07-21 2024-11-17 22.050 45.183 POINT (22.05 45.183)
28589 999999 13855 TULLAHOMA AEDC SITE US TN ... 1963-01-01 1969-08-01 -86.233 35.383 POINT (-86.233 35.383)
6422 268530 99999 BEREZINO BO NaN ... 1960-04-01 2024-11-17 28.983 53.833 POINT (28.983 53.833)
The available stations locations can be visualized :
2. Fetching and Visualizing Data
To retrieve data, you can specify the time period and spatial constraints. Here, we fetch temperature data (temp
) for the bounding box around Paris between January 1, 2023, and November 20, 2024:
from pyisd.misc import get_box
geometry = get_box(place='Paris', width=1., crs=CRS)
data = module.get_data(start=20230101, end=20241120, geometry=geometry, organize_by='field')
data.keys()
# dict_keys(['temp', 'dewtemp', 'pressure', 'winddirection', 'windspeed', 'skycoverage', 'precipitation-1h', 'precipitation-6h'])
data['temp'].plot(figsize=(10, 4), legend=False, c='grey', lw=0.6)
Flexibility of geometry
The geometry
parameter is highly flexible and can be set in different ways:
- Bounding Box: Use the
get_box()
function as shown above to define a simple rectangular bounding box around a location. - Custom Geometries: You can pass any
shapely.geometry
object (e.g.,Polygon
,MultiPolygon
) or ageopandas
GeoDataFrame
to define more specific regions of interest. None
: Ifgeometry
is set toNone
, the function retrieves data for all available stations globally.
⚠️ Note: Settinggeometry=None
is not advised unless strictly necessary, as the download time and data size can be extremely large.
By carefully specifying geometry
, you can focus on the data most relevant to your study while avoiding unnecessarily large downloads.
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
Built Distribution
File details
Details for the file isd_fetch-0.1.3.tar.gz
.
File metadata
- Download URL: isd_fetch-0.1.3.tar.gz
- Upload date:
- Size: 9.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec8f2ea616c4cc2da00e6214105e91a22f37693c87a1aec82549487586cf8073 |
|
MD5 | 341ea9c19718c10c96e75bf2bfc6d9c0 |
|
BLAKE2b-256 | d1b101c8739444d1fbd8ada4b5ca0bd4f31a2e281fd0409701d944b7a1610efb |
File details
Details for the file isd_fetch-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: isd_fetch-0.1.3-py3-none-any.whl
- Upload date:
- Size: 10.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00fdecd7fc61dfcd10e6f47e7def74b979980c57ed8abcb426f21c60d916d08c |
|
MD5 | 943bda559e8c22615bb58366bdd6c9dd |
|
BLAKE2b-256 | e6945c8f9bf5c9a9dcc8b41526bb4a0988cae6bf63ad89cc176862d77a9bc2d7 |