Skip to content

daymet

Functionality to retrieve Daymet Daily Surface Weather Data for North America, Version 4 R1.

Source: https://daac.ornl.gov/cgi-bin/dsviewer.pl?ds_id=2129

Fetches data from https://daymet.ornl.gov/.

Requires daymetr. Install with

install.packages("daymetr")

  • Temporal coverage: 1950-01-01 to 2021-12-31
  • Spatial coverage (1 km grid):
North South East West
Hawaii (hi) 23.52 17.95 -154.77 -160.31
North America (na) 82.91 14.07 -53.06 -178.13
Puearto Rico (pr) 19.94 16.84 -64.12 -67.99

Example: Example: Download data for 3 points

```pycon
from springtime.datasets import Daymet

source = Daymet(
    points=[
        [-84.2625, 36.0133],
        [-86, 39.6],
        [-85, 40],
    ],
    years=[2000,2002]
)
source.download()
df = source.load()
```

Example: Example: Download daily data

```pycon
from springtime.datasets import Daymet

source = Daymet(
    variables = ["tmin", "tmax"],
    area = {
        "name": "indianapolis",
        "bbox": [-86.5, 39.5, -86, 40.1]
        },
    years=[2000, 2002]
)
source.download()
df = source.load()
```

Example: Example: download monthly data

```pycon
from springtime.datasets import Daymet

source = Daymet(
    variables = ["tmin", "tmax"],
    area = {
        "name": "indianapolis",
        "bbox": [-86.5, 39.5, -86, 40.1]
        },
    years=[2000, 2002],
    frequency = "monthly",
)
source.download()
df = source.load()
```

DaymetVariables = Literal['dayl', 'prcp', 'srad', 'swe', 'tmax', 'tmin', 'vp'] module-attribute

Daymet variables.

DaymetFrequencies = Literal['daily', 'monthly', 'annual'] module-attribute

Daymet frequencies

Daymet

Bases: Dataset

Base class for common Daymet attributes.

Attributes:

Name Type Description
years YearRange

timerange. For example years=[2000, 2002] downloads data for three years.

variables Sequence[DaymetVariables]

List of variable you want to download. Options:

  • dayl: Duration of the daylight period (seconds/day)
  • prcp: Daily total precipitation (mm/day)
  • srad: Incident shortwave radiation flux density(W/m2)
  • swe: Snow water equivalent (kg/m2)
  • tmax: Daily maximum 2-meter air temperature (°C)
  • tmin: Daily minimum 2-meter air temperature (°C)
  • vp: Water vapor pressure (Pa)

When empty will download all the previously mentioned climate variables.

points Point | Points | None

(Sequence of) point(s) as (longitude, latitude) in WGS84 projection.

area NamedArea | None

A dictionary of the form {"name": "yourname", "bbox": [xmin, ymin, xmax, ymax]}. If both area and points are defined, will first crop the area before extracting points, so points outside area will be lost. If points is None, will return the full dataset as xarray object; this cannot be joined with other datasets.

mosaic Literal['na', 'hi', 'pr']

Daymet tile mosaic; required when using area. Defaults to “na” for North America. Use “pr” for Puerto Rico and “hi” for Hawaii.

frequency DaymetFrequencies

required when using area. Choose from "daily", "monthly", or "annual"

resample Optional[ResampleConfig]

Resample the dataset to a different time resolution. If None, no resampling. Else, should be a dictonary of the form {frequency: 'M', operator: 'mean', **other_options}. Currently supported operators are 'mean', 'min', 'max', 'sum', 'median'. For valid frequencies see [1]. Other options will be passed directly to xr.resample [2]

to_recipe()

Print out a recipe to reproduce this dataset.

download()

Download data for dataset.

download_point(point)

Download data for a single point.

download_bbox()

Download data for area in bbox as netcdf subset.

raw_load()

Load raw data.

raw_load_point(point)

Read csv file for a single daymet data point.

Lat/lon is in csv headers. Add geometry column instead.