Package 'rcmip6'

Title: Download CMIP6 Data
Description: Search and download CMIP6 data.
Authors: Elio Campitelli [cre, aut]
Maintainer: Elio Campitelli <[email protected]>
License: GPL-3
Version: 0.0.2.9000
Built: 2024-10-16 05:17:04 UTC
Source: https://github.com/eliocamp/rcmip6

Help Index


List downloaded models.

Description

Reads files in your local CMIP6 directory and parses the contents into a data.frame

Usage

cmip_available(root = cmip_root_get())

cmip_available_legacy(root = cmip_root_get())

Arguments

root

Root folder to download and organise the data.

Details

cmip_available_legacy() reads from the older way of storing information and will only work for files downloaded with version <= 0.0.2 of the package.

Value

A data.frame.


Downloads CMIP data

Description

Downloads CMIP data

Usage

cmip_download(
  results,
  root = cmip_root_get(),
  user = Sys.info()[["user"]],
  comment = NULL,
  year_range = c(-Inf, Inf),
  check_diskspace = TRUE,
  download_config = cmip_download_config(),
  ...
)

cmip_download_config(
  delay = 0.5,
  retry = 5,
  total_connections = 1,
  host_connections = 1,
  low_speed_limit = 100,
  low_speed_time = 30
)

Arguments

results

A list of search results from cmip_search().

root

Root folder to download and organise the data.

user, comment

Deprecated.

year_range

An integer vector of length 2, indicating the start and end range of years. Restricts the download of model output with files that include some data within this range of years. Defaults to c(-Inf, Inf) to include all possible files

check_diskspace

Logical indicating whether to check if location has enough space to download all the requested files.

download_config

a list of arguments to configure the behaviour of downloads.

...

Ignored

delay

delay in seconds between retries. The actual delay adds a bit of randomness.

retry

number of retries before giving up on a download.

total_connections

maximum number of total concurrent connections.

host_connections

maximum number concurrent connections per host.

low_speed_limit, low_speed_time

the download will fail if it downloads at below low_speed_limit bytes/second for more than low_speed_time seconds.

Value

A list of files.


Filters replicas based on online servers

Description

Checks the online status of data nodes and returns filtered results so that there is a single replica of each instance that is hosted on an online node.

Usage

cmip_filter_replicas(results)

Arguments

results

A list of search results from cmip_search().

Value

A data.table.


Set or get the root folder for CMIP data.

Description

Set or get the root folder for CMIP data.

Usage

cmip_root_set(root, mode = "default")

cmip_root_get()

Arguments

root

Root folder.

mode

Mode that defines folder permissions. Can be an umask valid string or the aliases:

  • "default": the default umask returned by Sys.umask(NA).

  • "shared": read and write permissions to any user (mode "0000")

  • "private": read and write permissions only for the current user (mode "7777")


Simplifies the output of searches

Description

Removes a lot of less important columns from the output of cmip_search(). The full dataset is stored in the hidden column full_info. Use cmip_unsimplify() to return to the original format

Usage

cmip_simplify(results)

cmip_unsimplify(data)

Arguments

results

A list of search results from cmip_search().

data

A simplifided output from cmip_simplify()


Computes the total size of a search result in Mb.

Description

Computes the total size of a search result in Mb.

Usage

cmip_size(results)

Arguments

results

A list of search results from cmip_search().


Obtain file server URLs of CMIP data

Description

Finds the URLs that cmip_download would obtain from a search results object.

Usage

cmip_urls(results)

Arguments

results

A list of search results from cmip_search().

Details

If a valid URL is not found the return value has an NA in its place.

Note that the versions to download have "/fileServer/" in the path, whereas those for the remote access have "/dodsC/" instead (and can be string-substituted). This works for some sources we have seen (GDAL for example can within limitations read remotely from the 'fileServer' URLs, but the NetCDF library needs the 'dodsC' version, again this a pattern observed on some sources not an authorative claim).

It takes some time to process and find these so they aren't automatically added to the results from a search.

Value

character vector of URLs