rex.multi_time_resource.MultiTimeH5

class MultiTimeH5(h5_path, res_cls=<class 'rex.resource.Resource'>, hsds=False, hsds_kwargs=None, **res_cls_kwargs)[source]

Bases: object

Class to handle h5 Resources stored over multiple temporal files

Parameters
  • h5_path (str) – Unix shell style pattern path with * wildcards to multi-file resource file sets. Files must have the same coordinates but can have different datasets or time indexes.

  • res_cls (obj) – Resource class to use to open and access resource data

  • hsds (bool) – Boolean flag to use h5pyd to handle .h5 ‘files’ hosted on AWS behind HSDS

  • hsds_kwargs (dict, optional) – Dictionary of optional kwargs for h5pyd, e.g., bucket, username, password, by default None

  • res_cls_kwargs (dict, optional) – Kwargs for res_cls

Methods

close()

Close all h5py.File instances

Attributes

attrs

Global .h5 file attributes sourced from first .h5 file

datasets

Available datasets

files

Available file paths

h5

open h5 file handler for a single .h5 file

h5_files

.h5 files data is being sourced from

resource_datasets

Available resource datasets

shape

Dataset shape (time, sites)

time_index

Multi-year datetime index

property attrs

Global .h5 file attributes sourced from first .h5 file

Returns

attrs (dict)

property files

Available file paths

Returns

list

property h5_files

.h5 files data is being sourced from

Returns

list

property h5

open h5 file handler for a single .h5 file

Returns

h5py.File

property datasets

Available datasets

Returns

list

property resource_datasets

Available resource datasets

Returns

list

property shape

Dataset shape (time, sites)

Returns

tuple

property time_index

Multi-year datetime index

Returns

pandas.DatatimeIndex

close()[source]

Close all h5py.File instances