Combine shift_plan_reanalysis(), shift_download_reanalysis() and shift_read_reanalysis() without an EPW template or future climate case. The saved table contains canonical raw dependencies, not derived weather.

shift_reanalysis_data(
  source,
  sites,
  dir,
  data = NULL,
  limits = list(),
  resume = TRUE,
  dry_run = FALSE,
  dates = NULL
)

Arguments

source

A shift_era5() specification with explicit variables, frequency = "hour", and access = "arco" or "cds".

sites

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.

dir

Directory dedicated to one plan and acquisition origin.

data

Optional local files named exactly once by every request ID.

limits

Named list: max_submissions, max_file_bytes and max_total_bytes default to Inf; wait_timeout defaults to 3600 seconds, download_timeout to 600 seconds, and total_timeout to Inf.

resume

Reuse the ledger and verified completed assets. FALSE refuses an existing ledger rather than deleting it or submitting duplicate jobs.

dry_run

Return the public request plan without credentials, network access or file writes.

dates

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.

Value

A named list containing schema_version, status, directory, plan, requests, artifacts, diagnostics, execution and data. Only complete provides a data descriptor with path, format = "rds", rows, sha256, schema_version and normalization_version. Use readRDS(result$data$path) to read the complete data.table explicitly. Its reanalysis_schema attribute describes normalization and provenance. A partial or failed result has data = NULL.

Details

Raw requests, transport receipts and normalized data have separate identities. Each execution directory belongs to one exact plan and one provider API origin (or local replay). Changed sites, fields, years or origin require a different directory. Local inputs are copied and checked against their retained hashes; their provider origin is not authenticated. Original source paths must remain available when repeating a local replay.

identity.rds records the plan and origin; result.rds is the latest execution snapshot. receipts/ holds individual validation records. Network assets and submission accounting live under transfer/; local copies live under raw/. A versioned normalized-<id>.rds table and normalization.rds descriptor are published only after every dependency and cross-field grid check passes. Normalized identity includes schema/conversion version, the full plan, origin and actual raw hashes. Reopening verifies raw files and the normalized payload and descriptor; corrupt files are not silently accepted or overwritten.

limits constrain the network transfer stage and retain the cumulative accounting and interrupted-transfer rules of shift_download_reanalysis(). Local copies and normalization are not HTTP traffic; use an external process supervisor for a whole-workflow wall-clock limit. A separate owner lock spans acquisition, validation and publication. Orphan locks are not taken over. resume = FALSE refuses an existing execution. Failed asset diagnostics use fixed error categories; shift_read_reanalysis() can reproduce detailed local parsing failures. Configuration errors raise errors; validation or transfer failures never produce a complete data descriptor.

complete certifies this acquisition and strict local data contract. It does not establish a point's scientific suitability, TMY representativeness, or building-performance validity. All dependency fields and UTC boundary hours remain in the saved table; requested derived variables are not calculated.

Examples

source <- shift_era5(2001, variables = c("tas", "rsds"),
    frequency = "hour", access = "arco")
site <- shift_site("point", lat = 1.25, lon = 104)
shift_reanalysis_data(source, site, dry_run = TRUE)$requests
#>                                                          request_id
#>                                                              <char>
#> 1: a6339bd45c15acfca16184261bf862b2593f2716c68e21ef63b26a7f4f3b7b94
#> 2: bc6279d6ba0d03d0dc43e3b50d0f0768fe4d8931ea6bfd56d0db402ee51ec62f
#>                                     dataset variable_id latitude longitude
#>                                      <char>      <char>    <num>     <num>
#> 1: reanalysis-era5-single-levels-timeseries         tas     1.25       104
#> 2: reanalysis-era5-single-levels-timeseries        rsds     1.25       104
#>    date_start   date_end expected_hours site_ids   request        status
#>        <Date>     <Date>          <int>   <list>    <list>        <char>
#> 1: 2000-12-31 2002-01-01           8808    point <list[4]> not_submitted
#> 2: 2000-12-31 2002-01-01           8808    point <list[4]> not_submitted