CopernicusData

class CopernicusData @JvmOverloads constructor(endpoint: String, dataset: String, inputs: Any, variable: String? = null, cacheDirectory: String = DEFAULT_CACHE_DIRECTORY.toString(), cdsApiRcFile: String = DEFAULT_CDSAPIRC_LOCATION.toString(), providerTimeout: String = CopernicusDataStoreProvider.DEFAULT_TIMEOUT.toIsoString()) : GridSnapshots

The data of a GriddedGeoLayer, downloaded at construction from a Copernicus data store, unless already in the local cache. See GridsFromDirectory for data already available locally.

Parameters

endpoint

the URL of the API of the data store (e.g., https://ewds.climate.copernicus.eu/api).

dataset

the dataset (e.g., cems-glofas-historical).

inputs

what to download (variables, dates, area...), as a JSON object: either a mapping, a JSON file (among the classpath resources or, if not there, on the file system), or a JSON string. Requests with a type field need a file or a string, as the Alchemist loader reserves type in mappings.

variable

the name of the variable inside the downloaded files, auto-detected when null.

cacheDirectory

the directory of the cache.

cdsApiRcFile

the .cdsapirc file with the API token, read only when downloading.

providerTimeout

how long the data store can take to prepare the data, as an ISO-8601 duration.

Throws

if a parameter is not valid, including inputs not holding a JSON object.

if the token cannot be read, or the download fails.

Constructors

Link copied to clipboard
constructor(endpoint: String, dataset: String, inputs: Any, variable: String? = null, cacheDirectory: String = DEFAULT_CACHE_DIRECTORY.toString(), cdsApiRcFile: String = DEFAULT_CDSAPIRC_LOCATION.toString(), providerTimeout: String = CopernicusDataStoreProvider.DEFAULT_TIMEOUT.toIsoString())

Types

Link copied to clipboard
object Companion

Default locations, and readers of the inputs and of the token.

Properties

Link copied to clipboard
open override val instants: List<Instant>

The instants of the grids, strictly ascending.

Functions

Link copied to clipboard
open override fun grid(index: Int): RasterGrid

The grid at the instant with the given index in instants.