geodata.dataset.Dataset#

class geodata.dataset.Dataset(module: str, weather_data_config: str, years: slice, months: slice | None = None, opendap: bool = False, bounds: collections.abc.Iterable | None = None)#

Dataset is a class that encapsulates any datasets natively supported by geodata. It provides a streamlined workflow for downloading, preprocessing, and storing of these datasets.

Parameters:
  • module (str) – Name of dataset module

  • weather_data_config (str) – The type of weather data configuration to use. For more information, please refer to the documentation for the dataset you are using.

  • years (slice) – The years to download. For example, slice(2000, 2010) will download all data from 2000 to 2010.

  • months (slice, optional) – The months to download. For example, slice(1, 12) will download all data from January to December. Defaults to slice(1, 12).

  • opendap (bool, optional) – Whether to use OpenDAP protocol for downloading. Defaults to False.

  • bounds (Optional[Iterable], optional) – The bounds to download. For example, [-180, 90, 180, -90] will download all data from the entire globe. If omitted, global data will be downloaded.

module#
config#
dataset_module#
weatherconfig#
datadir: str#
opendap#
years#
months#
prepared = False#
toDownload = []#
downloadedFiles = []#
totalFiles = []#
incomplete_count = 0#
step#
yrs#
mos#
property meta_data_config#
Metadata configuration for dataset.
property weather_data_config: dict#

Weather data config for dataset.

property projection: str#

Projection for dataset.

property shape#
The shape of the Cutout by (y, x).
property extent: collections.abc.Iterable[float]#

The extent of the Cutout by (x_min, x_max, y_min, y_max).

Methods#

datasetfn(fn, *args)

Construct file name from template function in weather_data_config and args (yr, mo, day)

datasetfn_opendap(fn, variables, *args)

Construct url for OpenDap protocol. Depends on datasetfn()

get_data([trim, testing])

Download data from server.

trim_variables()

Reduce size of file by trimming variables in file.

grid_coordinates()

Return grid coordinates of the Cutout.

grid_cells()

Return grid cells of the Cutout.