isd-fetch


Nameisd-fetch JSON
Version 0.1.5 PyPI version JSON
download
home_pageNone
SummaryA Python package for fetching ISD Lite data
upload_time2024-11-28 10:50:44
maintainerNone
docs_urlNone
authorCyril Joly
requires_python>=3.7
licenseBSD 3-Clause License Copyright (c) 2024, Cyril Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
keywords isd lite weather data noaa
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![PyPI version](https://badge.fury.io/py/isd-fetch.svg)](https://badge.fury.io/py/isd-fetch)
[![Unit tests](https://github.com/CyrilJl/isd-fetch/actions/workflows/pytest.yml/badge.svg)](https://github.com/CyrilJl/isd-fetch/actions/workflows/pytest.yml)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/cdc692322be649cea8b8b6760bfb333e)](https://app.codacy.com/gh/CyrilJl/isd-fetch/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)

# PyISD: A Python Package for NOAA's ISD Lite Dataset

**PyISD** is a Python package designed for efficiently accessing and processing NOAA's ISD Lite dataset. The ISD Lite dataset, a streamlined version of the full Integrated Surface Database (ISD), provides hourly weather observations worldwide. It includes eight essential surface parameters in a fixed-width format, free of duplicate values, sub-hourly data, and complex flags. For more information, visit the [official ISD homepage](https://www.ncei.noaa.gov/products/land-based-station/integrated-surface-database).

## Installation

```bash
pip install isd-fetch
```

## Features

- Easy access to global weather station data with spatial and temporal filtering
- Support for various coordinate reference systems (CRS)
- Parallel data downloading for improved performance
- Flexible data organization by location or weather variable
- Comprehensive station metadata handling

## Quick Start Guide

### Basic Usage

```python
from pyisd import IsdLite

# Initialize the client
isd = IsdLite(crs=4326, verbose=True)

# View available stations
isd.raw_metadata.sample(5)
```

```
         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)
```

### Fetching Weather Data

There are multiple ways to fetch data based on your needs:

```python
# Get data for all French weather stations
france_data = isd.get_data(
    start='2023-01-01',
    end='2023-12-31',
    countries='FR',  # ISO country code for France
    organize_by='field'  # Organize data by weather variable
)

# Access temperature data from all French stations
france_data['temp'].sample(4)
```

```
                     070200  070240  070270  ...  077680  077750  077700
2023-05-12 09:00:00    11.4    11.6    13.1  ...    19.7    19.7    16.5
2024-06-26 15:00:00    21.8    25.8    26.7  ...    25.8    25.4    23.2
2023-10-09 18:00:00    18.0    16.7    17.9  ...    22.0    20.9    21.8
2023-12-19 14:00:00     NaN    12.0    11.8  ...    14.6    15.7    13.6
```

```python
# You can also query multiple countries
european_data = isd.get_data(
    start='2023-01-01',
    end='2023-12-31',
    countries=['FR', 'DE', 'IT'],  # France, Germany, Italy
    organize_by='field'
)
```

## Spatial Filtering Options

PyISD offers flexible spatial filtering through the `geometry` parameter:

1. **Bounding Box**: Using coordinates (xmin, ymin, xmax, ymax)

```python
geometry = (-2.5, 48.5, 2.5, 49.5)  # Paris region
```

2. **GeoDataFrame/Geometry**: Using any shapely or geopandas geometry

```python
import geopandas as gpd
city = gpd.read_file('city_boundary.geojson')
data = isd.get_data(geometry=city)
```

3. **Place Name**: Using the `get_box()` helper function

```python
geometry = get_box('London', width=2.0, crs=4326)
```

4. **Global Data**: Setting geometry to None (⚠️ use with caution - large downloads)

```python
data = isd.get_data(geometry=None)  # Downloads data for all stations
```

## Available Weather Variables

- `temp`: Air temperature (°C)
- `dewtemp`: Dew point temperature (°C)
- `pressure`: Sea level pressure (hPa)
- `winddirection`: Wind direction (degrees)
- `windspeed`: Wind speed (m/s)
- `skycoverage`: Sky coverage/ceiling (code)
- `precipitation-1h`: One-hour precipitation (mm)
- `precipitation-6h`: Six-hour precipitation (mm)

## Station Coverage

The ISD Lite network includes thousands of weather stations worldwide:

![ISD Station Locations](https://github.com/CyrilJl/pyisd/blob/main/assets/noaa_isd_locations.png?raw=true)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "isd-fetch",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "ISD Lite, weather data, NOAA",
    "author": "Cyril Joly",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/26/c5/9d85e40217e6d86795e863d67e80be04ba4015a892bf092b2948f318fa9d/isd_fetch-0.1.5.tar.gz",
    "platform": null,
    "description": "[![PyPI version](https://badge.fury.io/py/isd-fetch.svg)](https://badge.fury.io/py/isd-fetch)\n[![Unit tests](https://github.com/CyrilJl/isd-fetch/actions/workflows/pytest.yml/badge.svg)](https://github.com/CyrilJl/isd-fetch/actions/workflows/pytest.yml)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/cdc692322be649cea8b8b6760bfb333e)](https://app.codacy.com/gh/CyrilJl/isd-fetch/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)\n\n# PyISD: A Python Package for NOAA's ISD Lite Dataset\n\n**PyISD** is a Python package designed for efficiently accessing and processing NOAA's ISD Lite dataset. The ISD Lite dataset, a streamlined version of the full Integrated Surface Database (ISD), provides hourly weather observations worldwide. It includes eight essential surface parameters in a fixed-width format, free of duplicate values, sub-hourly data, and complex flags. For more information, visit the [official ISD homepage](https://www.ncei.noaa.gov/products/land-based-station/integrated-surface-database).\n\n## Installation\n\n```bash\npip install isd-fetch\n```\n\n## Features\n\n- Easy access to global weather station data with spatial and temporal filtering\n- Support for various coordinate reference systems (CRS)\n- Parallel data downloading for improved performance\n- Flexible data organization by location or weather variable\n- Comprehensive station metadata handling\n\n## Quick Start Guide\n\n### Basic Usage\n\n```python\nfrom pyisd import IsdLite\n\n# Initialize the client\nisd = IsdLite(crs=4326, verbose=True)\n\n# View available stations\nisd.raw_metadata.sample(5)\n```\n\n```\n         USAF   WBAN         STATION NAME CTRY   ST  ...      BEGIN        END       x       y                geometry\n5416   172650  99999             ADIYAMAN   TU  NaN  ... 2007-01-27 2024-11-17  38.283  37.750    POINT (38.283 37.75)\n1362   032130  99999             ESKMEALS   UK  NaN  ... 1973-01-02 1997-12-26  -3.400  54.317     POINT (-3.4 54.317)\n4729   153150  99999              SEMENIC   RO  NaN  ... 1973-07-21 2024-11-17  22.050  45.183    POINT (22.05 45.183)\n28589  999999  13855  TULLAHOMA AEDC SITE   US   TN  ... 1963-01-01 1969-08-01 -86.233  35.383  POINT (-86.233 35.383)\n6422   268530  99999             BEREZINO   BO  NaN  ... 1960-04-01 2024-11-17  28.983  53.833   POINT (28.983 53.833)\n```\n\n### Fetching Weather Data\n\nThere are multiple ways to fetch data based on your needs:\n\n```python\n# Get data for all French weather stations\nfrance_data = isd.get_data(\n    start='2023-01-01',\n    end='2023-12-31',\n    countries='FR',  # ISO country code for France\n    organize_by='field'  # Organize data by weather variable\n)\n\n# Access temperature data from all French stations\nfrance_data['temp'].sample(4)\n```\n\n```\n                     070200  070240  070270  ...  077680  077750  077700\n2023-05-12 09:00:00    11.4    11.6    13.1  ...    19.7    19.7    16.5\n2024-06-26 15:00:00    21.8    25.8    26.7  ...    25.8    25.4    23.2\n2023-10-09 18:00:00    18.0    16.7    17.9  ...    22.0    20.9    21.8\n2023-12-19 14:00:00     NaN    12.0    11.8  ...    14.6    15.7    13.6\n```\n\n```python\n# You can also query multiple countries\neuropean_data = isd.get_data(\n    start='2023-01-01',\n    end='2023-12-31',\n    countries=['FR', 'DE', 'IT'],  # France, Germany, Italy\n    organize_by='field'\n)\n```\n\n## Spatial Filtering Options\n\nPyISD offers flexible spatial filtering through the `geometry` parameter:\n\n1. **Bounding Box**: Using coordinates (xmin, ymin, xmax, ymax)\n\n```python\ngeometry = (-2.5, 48.5, 2.5, 49.5)  # Paris region\n```\n\n2. **GeoDataFrame/Geometry**: Using any shapely or geopandas geometry\n\n```python\nimport geopandas as gpd\ncity = gpd.read_file('city_boundary.geojson')\ndata = isd.get_data(geometry=city)\n```\n\n3. **Place Name**: Using the `get_box()` helper function\n\n```python\ngeometry = get_box('London', width=2.0, crs=4326)\n```\n\n4. **Global Data**: Setting geometry to None (\u26a0\ufe0f use with caution - large downloads)\n\n```python\ndata = isd.get_data(geometry=None)  # Downloads data for all stations\n```\n\n## Available Weather Variables\n\n- `temp`: Air temperature (\u00b0C)\n- `dewtemp`: Dew point temperature (\u00b0C)\n- `pressure`: Sea level pressure (hPa)\n- `winddirection`: Wind direction (degrees)\n- `windspeed`: Wind speed (m/s)\n- `skycoverage`: Sky coverage/ceiling (code)\n- `precipitation-1h`: One-hour precipitation (mm)\n- `precipitation-6h`: Six-hour precipitation (mm)\n\n## Station Coverage\n\nThe ISD Lite network includes thousands of weather stations worldwide:\n\n![ISD Station Locations](https://github.com/CyrilJl/pyisd/blob/main/assets/noaa_isd_locations.png?raw=true)\n",
    "bugtrack_url": null,
    "license": "BSD 3-Clause License  Copyright (c) 2024, Cyril  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ",
    "summary": "A Python package for fetching ISD Lite data",
    "version": "0.1.5",
    "project_urls": null,
    "split_keywords": [
        "isd lite",
        " weather data",
        " noaa"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d28122ca11ad6f660c2bedbc8ab1427799e27b089479283bb33dbefd54268f08",
                "md5": "3483cfb937c0c83e152b97307774364f",
                "sha256": "48e400b36e48cfe046ab16f9a38d157b22b7b3783c828812d147031f8a8caa4e"
            },
            "downloads": -1,
            "filename": "isd_fetch-0.1.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3483cfb937c0c83e152b97307774364f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 11363,
            "upload_time": "2024-11-28T10:50:43",
            "upload_time_iso_8601": "2024-11-28T10:50:43.508297Z",
            "url": "https://files.pythonhosted.org/packages/d2/81/22ca11ad6f660c2bedbc8ab1427799e27b089479283bb33dbefd54268f08/isd_fetch-0.1.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "26c59d85e40217e6d86795e863d67e80be04ba4015a892bf092b2948f318fa9d",
                "md5": "f4e8a7a94e7c87b25df8779b2450e60c",
                "sha256": "0156930f8e3a919c32bc9f08380be547ed6e999b87ae67a7792e56dd737d6483"
            },
            "downloads": -1,
            "filename": "isd_fetch-0.1.5.tar.gz",
            "has_sig": false,
            "md5_digest": "f4e8a7a94e7c87b25df8779b2450e60c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 10066,
            "upload_time": "2024-11-28T10:50:44",
            "upload_time_iso_8601": "2024-11-28T10:50:44.370562Z",
            "url": "https://files.pythonhosted.org/packages/26/c5/9d85e40217e6d86795e863d67e80be04ba4015a892bf092b2948f318fa9d/isd_fetch-0.1.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-28 10:50:44",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "isd-fetch"
}
        
Elapsed time: 1.83471s