reVX.red_e.tech_potential.TechPotential
- class TechPotential(h5_path, base_layer, excl_dict, power_density=1, hsds=False, min_area=None, kernel='queen', check_layers=False)[source]
Bases:
ExclusionMaskFromDict
RED-E Tech Potential tool
- Parameters:
h5_path (str) – Path to .h5 file containing CF means and exclusion layers
base_layer (str) – Name of dataset in .h5 file containing base layer
excl_dict (dcit) – Dictionary of exclusion LayerMask arugments {layer: {kwarg: value}}
power_density (float) – Multiplier to convert CF means to generation means
hsds (bool) – Boolean flag to use h5pyd to handle .h5 ‘files’ hosted on AWS behind HSDS
min_area (float | NoneType) – Minimum required contiguous area in sq-km
kernel (str) – Contiguous filter method to use on final exclusion
check_layers (bool) – Run a pre-flight check on each layer to ensure they contain un-excluded values
Methods
add_layer
(layer[, replace])Add layer to be combined
close
()Close h5 instance
extract_inclusion_mask
(excl_fpath, tm_dset)Extract the full inclusion mask from excl_fpath using the given exclusion layers and whether or not to run a minimum area filter
run
(h5_path, base_layer, excl_dict[, ...])compute tech-potential
Attributes
FILTER_KERNELS
Open ExclusionLayers instance
List of available exclusion layers in exclusions .h5
Tech-potential as generation
Latitude coordinates array
List of layers to combines
List of LayerMask instances for each exclusion layer to combine
Longitude coordinates array
Inclusion mask for entire exclusion domain
Get a dictionary lookup of the nodata values for each layer name.
GeoTiff profile for exclusions
Get the exclusions shape.
- property profile
GeoTiff profile for exclusions
- Returns:
profile (dict) – Generic GeoTiff profile for exclusions in .h5 file
- property generation
Tech-potential as generation
- Returns:
gen (ndarray)
- classmethod run(h5_path, base_layer, excl_dict, sub_slice=None, power_density=1, hsds=False, min_area=None, kernel='queen', check_layers=False, generation=False)[source]
compute tech-potential
- Parameters:
h5_path (str) – Path to .h5 file containing CF means and exclusion layers
base_layer (str) – Name of dataset in .h5 file containing base layer
excl_dict (dcit) – Dictionary of exclusion LayerMask arugments {layer: {kwarg: value}}
sub_slice (tuple, optional) – Coordinates of sub-slice to extract, if None extract entire mask, by default None
power_density (float, optional) – Multiplier to convert CF means to generation means, by default 1
hsds (bool, optional) – Boolean flag to use h5pyd to handle .h5 ‘files’ hosted on AWS behind HSDS, by default False
min_area (float | NoneType, optional) – Minimum required contiguous area in sq-km, by default None
kernel (str, optional) – Contiguous filter method to use on final exclusion, by default ‘queen’
check_layers (bool, optional) – Run a pre-flight check on each layer to ensure they contain un-excluded values, by default False
generation (bool, optional) – Flag to return generation instead of base layer: gen = base layer * power density by default False
- Returns:
out (ndarray) – Base layer with exclusions masked out, if generation is true multiply base layer mask by power density
- add_layer(layer, replace=False)
Add layer to be combined
- Parameters:
layer (LayerMask) – LayerMask instance to add to set of layers to be combined
- close()
Close h5 instance
- property excl_h5
Open ExclusionLayers instance
- Returns:
_excl_h5 (ExclusionLayers)
- property excl_layers
List of available exclusion layers in exclusions .h5
- Returns:
_excl_layers (list)
- classmethod extract_inclusion_mask(excl_fpath, tm_dset, excl_dict=None, area_filter_kernel='queen', min_area=None)
Extract the full inclusion mask from excl_fpath using the given exclusion layers and whether or not to run a minimum area filter
- Parameters:
excl_fpath (str | list | tuple) – Filepath to exclusions h5 with techmap dataset (can be one or more filepaths).
tm_dset (str) – Dataset name in the techmap file containing the exclusions-to-resource mapping data.
excl_dict (dict | None) – Dictionary of exclusion keyword arugments of the format {layer_dset_name: {kwarg: value}} where layer_dset_name is a dataset in the exclusion h5 file and kwarg is a keyword argument to the reV.supply_curve.exclusions.LayerMask class.
area_filter_kernel (str, optional) – Contiguous area filter method to use on final exclusions mask, by default “queen”
min_area (float, optional) – Minimum required contiguous area filter in sq-km, by default None
- Returns:
inclusion_mask (ndarray) – Pre-computed 2D inclusion mask (normalized with expected range: [0, 1], where 1 is included and 0 is excluded)
- property latitude
Latitude coordinates array
- Returns:
ndarray
- property layer_names
List of layers to combines
- Returns:
list
- property layers
List of LayerMask instances for each exclusion layer to combine
- Returns:
list
- property longitude
Longitude coordinates array
- Returns:
ndarray
- property mask
Inclusion mask for entire exclusion domain
- Returns:
ndarray
- property nodata_lookup
Get a dictionary lookup of the nodata values for each layer name.
- Returns:
nodata (dict) – Lookup keyed by layer name and values are nodata values for the respective layers.
- property shape
Get the exclusions shape.
- Returns:
shape (tuple) – (rows, cols) shape tuple