task_geo.data_sources.noaa package

Module contents

Functions

noaa_api(countries, start_date[, end_date, …])

NOAA API Data Source.

task_geo.data_sources.noaa.noaa_api(countries, start_date, end_date=None, metrics=None, country_aggr=False)[source]

NOAA API Data Source.

Please, note the following: - The metrics variable will only filter out available metrics, if the metric is not available, requesting it will have no effect.

  • Country_agg will only return the min for TMIN, that is the absolute minimum,

and the max for TMAX, the absolute maximum.

Parameters
  • countries (list[str]) – List of country names in FIPS format.

  • start_date (datetime) – Start date for the data.

  • end_date (datetime) – End date for the date. (Optional, if not present will be set to the current day.)

  • metrics (list[str]) – Optional.List of metrics to retrieve,valid values are: TMIN: Minimum temperature. TMAX: Maximum temperature. TAVG: Average of temperature. SNOW: Snowfall (mm). SNWD: Snow depth (mm). PRCP: Precipitation.

  • country_aggr (bool) – When True, only an aggregate for each date/country will be returned.

Example: >>> from datetime import datetime >>> countries = [‘FR’] >>> start_date = datetime(2020, 1, 1) >>> end_date = datetime(2020, 1, 15) >>> noaa_api(countries, start_date, end_date)