Download Daily NASA POWER (MERRA-2) Data for a Named Point
Source:R/dl_daily_nasa.R
smn_dl_daily_nasa.RdDownloads daily NASA POWER variables for a specific point (lat/lon) and tags
the result with a user-defined station (node) name so you can join/trace later.
Arguments
- station
Character. A label or node name to tag the time series (e.g., "Toluca_Node").
- lat
Numeric. Latitude in decimal degrees (WGS84).
- lon
Numeric. Longitude in decimal degrees (WGS84).
- altitude
Numeric (optional). Altitude of the point (m a.s.l.). Default
NA_real_.- start_date
Start date (YYYY-MM-DD). If earlier than 1984-01-01, it is automatically adjusted to
1984-01-01(POWER coverage).- end_date
End date (YYYY-MM-DD). Default
Sys.Date().- vars
Character vector of POWER parameter short names. Defaults to a compact set:
c("T2M_MAX","T2M_MIN","RH2M","PRECTOTCORR","EVLAND").- community
POWER community. Default
"AG". (Common alternatives:"SSE","RE")- retries
Integer. Max GET retries on failure (default 5).
- sleep_sec
Numeric. Seconds to sleep between retries (default 3).
- output_format
Either
"all"(default) or"reduce". The"reduce"option keeps onlystation, latitude, longitude, altitude, dateand the requested variables.
Value
A data.frame ordered by date with columns:
station, latitude, longitude, altitude, date, <requested POWER variables>.
POWER missing values -999 are returned as NA.
Examples
if (FALSE) { # \dontrun{
nasa_df <- smn_dl_daily_nasa(
station = "Toluca_Node",
lat = 19.289, lon = -99.657, altitude = 2670,
start_date = "2020-01-01", end_date = "2020-12-31",
vars = c("T2M_MAX","T2M_MIN","PRECTOTCORR"),
output_format = "reduce"
)
} # }