Climate Helper Functions

Helper Module

import eratos.helpers as eratosHelpers
eratosHelpers<- reticulate::import("eratos.helpers ")

Write Metadata of found dataset list

Search variables using the write_dataset_block_meta function which has the following definition:

write_dataset_block_meta(
  fpath,
  resIter,
  propMap,
  verbose=False
)

where,

  • fpath: The file path and file name eg. "datasets.csv"
  • resIter: A list or iterable of eratos dataset resources, usually generated by list_dataset_blocks.
  • propMap: A python dictionary of dataset properties interested in default = eratosClimate.climateMetaMap
  • verbose: (True/False) Flag that will print the progress of the function, recommend for large n results.

Examples in Python and R are shown below.

# Create list of datasets blocks in EUR-11 Region, write them to 'datasets.csv' file.
dsblks = eratosClimate.list_dataset_blocks(adapter, cordexDomain='EUR-11')
eratosHelpers.write_dataset_block_meta('datasets.csv', dsblks, eratosClimate.climateMetaMap, verbose=True)
# Create list of datasets blocks in EUR-11 Region, write them to 'datasets.csv' file.
dsblks = eratosClimate$list_dataset_blocks(adapter, cordexDomain='EUR-11')
eratosHelpers$write_dataset_block_meta('datasets.csv', dsblks, eratosClimate$climateMetaMap, verbose=True)

File data.

You may pull the underlying file data for a given dataset by using pull_files:

ds_res.data().pull_files(
  dest,
)

where,

  • dest: The destination folder for the files in the dataset.
# Get gridded data adapter.
ds_gadptr = ds_res.data().pull_files('./some/folder/')
# Get gridded data adapter.
ds_gadptr <- ds_res$data()$pull_files("./some/folder/")