Home

Awesome

stactools-noaa-climate-normals

PyPI

Background

The NOAA U.S. Climate Normals provide information about typical climate conditions for thousands of weather station locations across the United States. Normals act both as a ruler to compare current weather and as a predictor of conditions in the near future. Climate normals are calculated for uniform time periods (conventionally 30 years long), and consist of annual/seasonal, monthly, daily, and hourly averages and statistics of temperature, precipitation, and other climatological variables for each weather station.

Data is available in two forms: tabular and gridded. The tabular data consists of weather variables for each weather station location. The gridded data is an interpolated form of the tabular data and is derived from the NClimGrid dataset. Gridded data is limited to temperature and precipitation information.

Three Collections, and corresponding Items, can be generated with this package:

  1. noaa-climate-normals-tabular

    • Items for each Climate Normal time period and temporal interval combination, e.g. monthly data for the 1991-2020 time period.
    • Each Item contains a single GeoParquet asset created from the weather variables for all available weather stations (~10-15K) for the particular time period and frequency combination. The source data for each weather station is contained in a unique CSV file, so a single GeoParquet asset contains data from 10-15K CSV files.
  2. noaa-climate-normals-gridded

    • Items for each timestep in each Climate Normal time period and temporal interval combination, e.g., month 1 (January) of the monthly data in the 1991-2020 time period.
    • Each Item contains COG Assets for all available weather variables.
  3. noaa-climate-normals-netcdf

    • Items for the NetCDF files that serve as the source data for the COGs in the noaa-climate-normals-gridded Collection.

STAC Examples

The example Collections and Items in the examples directory can be created by running ./scripts/create_examples.py.

Installation

pip install stactools-noaa-climate-normals

Command-line Usage

To create a Collection:

stac noaa-climate-normals <gridded|netcdf|tabular> create-collection

To create an Item, e.g., for the monthly tabular data from the 1991-2020 time period:

stac noaa-climate-normals tabular create-item <filepath to text file of csv hrefs> monthly 1991-2020 <item and geoparquet destination directory>

Each Collection has unique subcommands and options. Use stac noaa-climate-normals --help to explore subcommands and options.

Contributing

We use pre-commit to check any changes. To set up your development environment:

pip install -e .
pip install -r requirements-dev.txt
pre-commit install

To check all files:

pre-commit run --all-files

To run the tests:

pytest -vv