Skip to main content

A Python package for manipulating and analyzing ISD 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 CALL     LAT      LON  \
8480   377350  99999                   GANDJA   AJ  NaN  NaN  40.717   46.417   
1023   027710  99999  JOUTSA LEIVONMAKI SAVEN   FI  NaN  NaN  61.883   26.100   
11880  545340  99999                 TANGSHAN   CH  NaN  NaN  39.650  118.100   
3795   111900  99999               EISENSTADT   AU  NaN  NaN  47.850   16.533   
26693  957119  99999     WEST WYALONG AIRPORT   AS  NaN  NaN -33.930  147.200   

        ELEV(M)     BEGIN       END        x       y               geometry  
8480     309.0  19320101  20241117   46.417  40.717  POINT (46.417 40.717)  
1023     146.0  20080115  20241112   26.100  61.883    POINT (26.1 61.883)  
11880     29.0  19560820  20241112  118.100  39.650    POINT (118.1 39.65)  
3795     189.3  19730627  20241117   16.533  47.850   POINT (16.533 47.85)  
26693    262.0  19651231  19840629  147.200 -33.930   POINT (147.2 -33.93)  

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['temp'].plot(figsize=(10, 4), legend=False, c='grey', lw=0.6)

time_series

Flexibility of geometry

The geometry parameter is highly flexible and can be set in different ways:

  1. Bounding Box: Use the get_box() function as shown above to define a simple rectangular bounding box around a location.
  2. Custom Geometries: You can pass any shapely.geometry object (e.g., Polygon, MultiPolygon) or a geopandas GeoDataFrame to define more specific regions of interest.
  3. None: If geometry is set to None, the function retrieves data for all available stations globally.
    ⚠️ Note: Setting geometry=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

isd_fetch-0.1.1.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

isd_fetch-0.1.1-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file isd_fetch-0.1.1.tar.gz.

File metadata

  • Download URL: isd_fetch-0.1.1.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for isd_fetch-0.1.1.tar.gz
Algorithm Hash digest
SHA256 77fc533c556c05432b79eed5d65874a9c2c4dcb2a5183de0270fb3a8c745338b
MD5 1d313af152d253931cf54610b5b355f5
BLAKE2b-256 90b87a20566b5a9cd2a4911a9e2d69669551b6475c0e1801aaa8ebca23d2f5d7

See more details on using hashes here.

File details

Details for the file isd_fetch-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: isd_fetch-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for isd_fetch-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8454e44d3fcaf15b2decf63d527b8549f70e8488e2f91be8476fed517da84200
MD5 95f0dd345288255d9f4381136758ecda
BLAKE2b-256 de0eec159063afa2c08ccd2464c226dbf4ba65399b83d3b20503af07de5b361a

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