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).
Maximum distance (float) to map high-resolution data from source_file to the low-resolution file_paths input.
Attributes
cache_dir
Get cache file name
chunks
Get coords dictionary for initializing xr.Dataset.
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
Lat lon grid for data in format (spatial_1, spatial_2, 2) Lat/Lon array with same ordering in last dimension.
Get the high-resolution spatiotemporal shape
Get the full time index for aggregated source data
input_handler_kwargs
input_handler_name
Get the low-resolution spatiotemporal shape
max_workers
Get the nearest neighbor indices.
s_enhance
Get the 1D array of exogenous data from the source_file_h5
source_file
Get the Loader object that handles the exogenous data file.
Get the 2D array (n, 2) of lat, lon data from the source_file_h5
t_enhance
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 withLoader
- 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