EsgResultAggregation is a class that represents query results for
Aggregation type from ESGF search RESTful API.
In general, there is no need to create an EsgResultAggregation manually.
Usually, it is created by calling
EsgResultDataset$collect().
epwshiftr::EsgResult -> EsgResultAggregation
url_opendapA character vector of the OPeNDAP URLs of the files.
url_downloadA character vector of the download URLs of the files.
fieldsA character vector indicating all response fields, followed by derived URL fields when their source fields are available.
Inherited methods
epwshiftr::EsgResult$count()epwshiftr::EsgResult$filter()epwshiftr::EsgResult$initialize()epwshiftr::EsgResult$load()epwshiftr::EsgResult$query_url()epwshiftr::EsgResult$reachable()epwshiftr::EsgResult$save()epwshiftr::EsgResult$selection()epwshiftr::EsgResult$slice()epwshiftr::EsgResult$to_dt()
to_data_table()Convert the results into a data.table
fieldsA non-empty character vector indicating the fields to
put into the data.table. If NULL, all fields in the query
result will be used. Default: NULL.
formattedWhether to use formatted values for special fields,
including url and size. Default: FALSE.
A data.table.
filter_time()Filter aggregation records by the time range covered by each file
See EsgResultFile$filter_time() for the method semantics.
EsgResultAggregation$filter_time(start, stop, method = c("drs", "opendap"))download_plan()Build a persistent downloader plan for aggregation records.
replicaReplica policy. Aggregation records currently use the current records.
serviceESGF URL service to download from. Default:
"HTTPServer".
probeWhether to lightly probe URLs before ranking them.
strategyCandidate ranking strategy.
allReserved for API symmetry with EsgResultFile.
node_statsOptional data node history from
Downloader$data_nodes().
network_policyOptional network options from
Downloader$network_policy.
node_policyOptional data-node cooldown policy from
Downloader$node_policy.
probe_concurrencyMaximum concurrent URL probes. Default: 1.
probe_cache_secondsSeconds to reuse fresh data-node probe
history before probing a URL again. Default: 3600.
repair_urls()Replace unreachable service URLs with reachable replica records.
$repair_urls() probes the current records for the selected service,
queries ESGF replicas by master_id for records whose URL is missing or
unreachable, probes candidate replica URLs, and returns a new result with
repaired records in the original row order. The original result is not
modified. Aggregation results are not downloadable as files; repaired
aggregation URLs are intended for service access such as OPeNDAP.
The returned result records the original query URL plus the replica
lookup query URL in $query_url("all").
EsgResultAggregation$repair_urls(
service = c("OPENDAP", "HTTPServer"),
index_node = NULL,
probe = NULL
)serviceService URL to repair. One of "OPENDAP" or
"HTTPServer". Default: "OPENDAP".
index_nodeOptional ESGF search index node used to look up
replicas. If NULL, the current result index node is used.
probeOptional named list of probe settings. Supported fields
are level, timeout, concurrency, network_policy,
cache_seconds, and cache_failures_seconds. Default
level is "data_node".
download()Enqueue and run aggregation downloads using a Downloader.
downloaderOptional persistent Downloader. If NULL,
store$downloader() is used when store is supplied.
storeOptional EsgStore providing a bound downloader.
replicaReplica policy. Aggregation records currently use the current records.
serviceESGF URL service to download from. Default:
"HTTPServer".
probeWhether to lightly probe URLs before ranking them.
strategyCandidate ranking strategy.
probe_concurrencyMaximum concurrent URL probes when
probe = TRUE. Default comes from the downloader worker count.
probe_cache_secondsSeconds to reuse fresh data-node probe
history before probing a URL again. Default: 3600.
session_labelOptional download session label.
runWhether to run the queued session immediately. Default:
TRUE.
...Additional arguments passed to Downloader$run().
print()Print a summary of the current dataset
open_dataset()Open aggregation files as an EsgDataset for remote data access via OPeNDAP
EsgResultAggregation$open_dataset(
which = NULL,
fallback = c("ask", "auto", "error"),
store = NULL,
downloader = NULL,
progress = getOption("epwshiftr.progress", interactive())
)whichAggregation records to open. Use integer indices or
aggregation record IDs. If NULL, all aggregation records
are opened. Default: NULL.
fallbackWhat to do if OPeNDAP is unavailable. One of:
"ask": Interactively ask the user (default). In a
non-interactive session this raises an error.
"auto": Automatically download files via HTTPServer.
"error": Raise an error.
storeOptional EsgStore used for recoverable HTTP fallback.
downloaderOptional persistent Downloader used for recoverable HTTP fallback.
progressWhether to show progress bars while opening
OPeNDAP records and any HTTP fallback downloads. By default
the package option epwshiftr.progress is used, falling back
to interactive().