sup3r.preprocessing.rasterizers.exo.ExoRasterizerH5#

class ExoRasterizerH5(file_paths: str | None = None, source_file: str | None = None, feature: str | None = None, s_enhance: int = 1, t_enhance: int = 1, input_handler_name: str | None = None, input_handler_kwargs: dict | None = None, cache_dir: str = './exo_cache/', chunks: str | dict | None = 'auto', distance_upper_bound: int | None = None, max_workers: int = 1, verbose: bool = False)[source]#

Bases: BaseExoRasterizer

ExoRasterizer for H5 files

Methods

get_data()

Get a raster of source values corresponding to the high-resolution grid (the file_paths input grid * s_enhance * t_enhance).

get_distance_upper_bound()

Maximum distance (float) to map high-resolution data from source_file to the low-resolution file_paths input.

Attributes

cache_dir

cache_file

Get cache file name

chunks

coords

Get coords dictionary for initializing xr.Dataset.

data

Get a raster of source values corresponding to the high-resolution grid (the file_paths input grid * s_enhance * t_enhance).

distance_upper_bound

feature

file_paths

hr_lat_lon

Lat lon grid for data in format (spatial_1, spatial_2, 2) Lat/Lon array with same ordering in last dimension.

hr_shape

Get the high-resolution spatiotemporal shape

hr_time_index

Get the full time index for aggregated source data

input_handler_kwargs

input_handler_name

lr_shape

Get the low-resolution spatiotemporal shape

max_workers

nn

Get the nearest neighbor indices.

s_enhance

source_data

Get the 1D array of exogenous data from the source_file_h5

source_file

source_handler

Get the Loader object that handles the exogenous data file.

source_lat_lon

Get the 2D array (n, 2) of lat, lon data from the source_file_h5

t_enhance

tree

Get the KDTree built on the target lat lon data from the file_paths input with s_enhance

verbose

property source_data#

Get the 1D array of exogenous data from the source_file_h5

property cache_file#

Get cache file name

Returns:

cache_fp (str) – Name of cache file. This is a netcdf file which will be saved with Cacher and loaded with Loader

property coords#

Get coords dictionary for initializing xr.Dataset.

property data#

Get a raster of source values corresponding to the high-resolution grid (the file_paths input grid * s_enhance * t_enhance). The shape is (lats, lons, temporal, 1)

get_data()#

Get a raster of source values corresponding to the high-resolution grid (the file_paths input grid * s_enhance * t_enhance). The shape is (lats, lons, 1)

get_distance_upper_bound()#

Maximum distance (float) to map high-resolution data from source_file to the low-resolution file_paths input.

property hr_lat_lon#

Lat lon grid for data in format (spatial_1, spatial_2, 2) Lat/Lon array with same ordering in last dimension. This corresponds to the enhanced meta data from the file_paths input * s_enhance.

Returns:

ndarray

property hr_shape#

Get the high-resolution spatiotemporal shape

property hr_time_index#

Get the full time index for aggregated source data

property lr_shape#

Get the low-resolution spatiotemporal shape

property nn#

Get the nearest neighbor indices. This uses a single neighbor by default

property source_handler#

Get the Loader object that handles the exogenous data file.

property source_lat_lon#

Get the 2D array (n, 2) of lat, lon data from the source_file_h5

property tree#

Get the KDTree built on the target lat lon data from the file_paths input with s_enhance