R/shift-plan-reanalysis.R
shift_plan_reanalysis.RdBuild a credential-free request plan without downloading weather, requiring an EPW template, or constructing a future-climate workflow. Supports explicit ERA5 single-level ARCO and CDS hourly sources. Unsupported products and access routes are rejected, never substituted.
shift_plan_reanalysis(source, sites, dates = NULL)A shift_era5() specification with explicit variables,
frequency = "hour", and access = "arco" or "cds".
One shift_site() or a non-empty list of uniquely named sites
(unique site IDs; list names are optional). Coordinates describe requested
points; a plan cannot establish the coordinates actually returned by CDS.
CDS sites must explicitly identify native 0.25-degree grid points.
Optional vector of UTC dates (Date or ISO YYYY-MM-DD strings).
Request exactly these full days, without additional padding. Dates must be
within source years or their immediately adjacent boundary days. NULL
retains complete years plus one UTC boundary day on each side. Callers
selecting local source months must include their own UTC boundary coverage.
A list with schema_version, status = "planned", source,
sites, variables, requests, and submitted = 0L. requests is a
data.table containing stable SHA-256 request IDs, dataset, raw variable,
requested coordinates, inclusive UTC dates, expected hourly sample count,
associated site IDs, provider request bodies, and not_submitted status.
A full UTC boundary day is included on each side of each contiguous
requested year range; intervening gap years are not silently acquired.
variables records the raw dependencies of each requested variable.
Planning performs no authentication, network access, or file writes. The
expected sample count describes the requested UTC interval, not a verified
download. Raw requests and normalized weather have separate identities;
this function does not read or normalize weather and does not enforce a
transfer budget. Independent retrieval, receipts and recovery are separate
execution work. No claim of completed data acquisition follows from a plan.
Equivalent longitude aliases and derived-variable dependencies share raw
requests. All associated site IDs remain recorded. Provider availability,
actual file coordinates, units and complete hourly coverage still require
validation when data are acquired.
CDS requests are split by calendar month and contiguous days, one raw field
per request, avoiding year/month/day Cartesian expansion and mixed step types.
Use rsdsdiff to request its raw dependencies SSRD and FDIR; this interface
does not calculate diffuse radiation. Cloud cover is normalized to percent.
source <- shift_era5(2001, variables = c("tas", "rsds"),
frequency = "hour", access = "arco")
site <- shift_site("point", lon = 104, lat = 1.25)
plan <- shift_plan_reanalysis(source, site)
plan$requests[, c("variable_id", "expected_hours", "status")]
#> variable_id expected_hours status
#> <char> <int> <char>
#> 1: tas 8808 not_submitted
#> 2: rsds 8808 not_submitted