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: Download data for 3 points
source = DaymetMultiplePoints(
points=[
[-84.2625, 36.0133],
[-86, 39.6],
[-85, 40],
],
years=[2000,2002]
)
source.download()
df = source.load()
Example: Download daily data
from springtime.datasets.meteo.daymet import DaymetBoundingBox
source = DaymetBoundingBox(
variables = ["tmin", "tmax"],
area = {
"name": "indianapolis",
"bbox": [-86.5, 39.5, -86, 40.1]
},
years=[2000, 2002]
)
source.download()
df = source.load()
Example: download monthly data
from springtime.datasets.meteo.daymet import DaymetBoundingBox
source = DaymetBoundingBox(
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.
Daymet
Bases: Dataset
Base class for common Daymet attributes.
Attributes:
Name | Type | Description |
---|---|---|
years |
timerange. For example years=[2000, 2002] downloads data for three years. |
|
resample |
Resample the dataset to a different time resolution. If None, no resampling. |
|
variables |
Sequence[DaymetVariables]
|
List of variable you want to download. Options:
When empty will download all the previously mentioned climate variables. |
download()
abstractmethod
Download the data.
Only downloads if data is not in CONFIG.cache_dir or CONFIG.force_override is TRUE.
load()
abstractmethod
Load the dataset from disk into memory.
This may include pre-processing operations as specified by the context, e.g. filter certain variables, remove data points with too many NaNs, reshape data.
DaymetSinglePoint
Bases: Daymet
Daymet data for single point.
Attributes:
Name | Type | Description |
---|---|---|
years |
timerange. For example years=[2000, 2002] downloads data for three years. |
|
resample |
Resample the dataset to a different time resolution. If None, no resampling. |
|
variables |
List of variable you want to download. See Daymet |
|
point |
Tuple[float, float]
|
Point as longitude, latitude in WGS84 projection. |
download()
Download the data.
Only downloads if data is not in CONFIG.cache_dir or CONFIG.force_override is TRUE.
load()
Load the dataset from disk into memory.
This may include pre-processing operations as specified by the context, e.g. filter certain variables, remove data points with too many NaNs, reshape data.
DaymetMultiplePoints
Bases: Daymet
Daymet data for multiple points.
Attributes:
Name | Type | Description |
---|---|---|
years |
timerange. For example years=[2000, 2002] downloads data for three years. |
|
resample |
Resample the dataset to a different time resolution. If None, no resampling. |
|
variables |
List of variable you want to download. See Daymet |
|
points |
Union[Sequence[Tuple[float, float]], PointsFromOther]
|
List of points as [[longitude, latitude], ...], in WGS84 projection |
download()
Download the data.
Only downloads if data is not in CONFIG.cache_dir or CONFIG.force_override is TRUE.
load()
Load the dataset from disk into memory.
This may include pre-processing operations as specified by the context, e.g. filter certain variables, remove data points with too many NaNs, reshape data.
DaymetBoundingBox
Bases: Daymet
Daymet data for a bounding box.
Attributes:
Name | Type | Description |
---|---|---|
years |
timerange. For example years=[2000, 2002] downloads data for three years. |
|
resample |
Resample the dataset to a different time resolution. If None, no resampling. |
|
variables |
List of variable you want to download. See Daymet |
|
area |
NamedArea
|
A dictionary of the form
|
mosaic |
Literal['na', 'hi', 'pr']
|
Daymet tile mosaic. Defaults to “na” for North America. Use “pr” for Puerto Rico and “hi” for Hawaii. |
frequency |
Literal['daily', 'monthly', 'annual']
|
Choose from "daily", "monthly", or "annual" |
download()
Download the data.
Only downloads if data is not in CONFIG.cache_dir or CONFIG.force_override is TRUE.
load()
Load the dataset from disk into memory.
This may include pre-processing operations as specified by the context, e.g. filter certain variables, remove data points with too many NaNs, reshape data.