reV.handlers.exclusions.ExclusionLayers
- class ExclusionLayers(h5_file, hsds=False)[source]
Bases:
object
Handler of .h5 file and techmap for Exclusion Layers
- Parameters:
h5_file (str | list | tuple) – .h5 file containing exclusion layers and techmap, or a list of h5 files
hsds (bool) – Boolean flag to use h5pyd to handle .h5 ‘files’ hosted on AWS behind HSDS
Methods
close
()Close h5 instance
get_layer_crs
(layer)Get crs for a specific exclusion layer
get_layer_description
(layer)Get description for given layer
get_layer_profile
(layer)Get profile for a specific exclusion layer
get_layer_values
(layer)Get values for given layer in Geotiff format (bands, y, x)
get_nodata_value
(layer)Get the nodata value for a given layer
Attributes
Exclusion layers chunks default chunk size
GeoTiff projection crs
Open h5py File instance.
Get an array of 1D index values for the flattened h5 excl extent.
Latitude coordinates array
Available exclusions layers
Longitude coordinates array
Get pixel area in km2 from the transform profile of the excl file.
GeoTiff profile for exclusions
Exclusion shape (latitude, longitude)
- property h5
Open h5py File instance.
- Returns:
h5 (rex.MultiFileResource | rex.Resource)
- property iarr
Get an array of 1D index values for the flattened h5 excl extent.
- Returns:
iarr (np.ndarray) – Uint array with same shape as exclusion extent, representing the 1D index values if the geotiff extent was flattened (with default flatten order ‘C’)
- property profile
GeoTiff profile for exclusions
- Returns:
profile (dict)
- property crs
GeoTiff projection crs
- Returns:
str
- property pixel_area
Get pixel area in km2 from the transform profile of the excl file.
- Returns:
area (float) – Exclusion pixel area in km2. Will return None if the appropriate transform attribute is not found.
- property layers
Available exclusions layers
- Returns:
layers (list)
- property shape
Exclusion shape (latitude, longitude)
- Returns:
shape (tuple)
- property chunks
Exclusion layers chunks default chunk size
- Returns:
chunks (tuple | None) – Chunk size of exclusion layers
- property latitude
Latitude coordinates array
- Returns:
ndarray
- property longitude
Longitude coordinates array
- Returns:
ndarray
- get_layer_profile(layer)[source]
Get profile for a specific exclusion layer
- Parameters:
layer (str) – Layer to get profile for
- Returns:
profile (dict | None) – GeoTiff profile for single exclusion layer
- get_layer_crs(layer)[source]
Get crs for a specific exclusion layer
- Parameters:
layer (str) – Layer to get profile for
- Returns:
crs (str | None) – GeoTiff projection crs
- get_layer_values(layer)[source]
Get values for given layer in Geotiff format (bands, y, x)
- Parameters:
layer (str) – Layer to get values for
- Returns:
values (ndarray) – GeoTiff values for single exclusion layer