reV.supply_curve.exclusions.FrictionMask

class FrictionMask(fric_h5, fric_dset, hsds=False, check_layers=False)[source]

Bases: ExclusionMask

Class to handle exclusion-style friction layer.

Parameters:
  • fric_h5 (str) – Path to friction layer .h5 file (same format as exclusions file)

  • fric_dset (str) – Friction layer dataset in fric_h5

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

  • 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

run(excl_h5, fric_dset[, hsds])

Create inclusion mask from given layers dictionary

Attributes

FILTER_KERNELS

excl_h5

Open ExclusionLayers instance

excl_layers

List of available exclusion layers in exclusions .h5

latitude

Latitude coordinates array

layer_names

List of layers to combines

layers

List of LayerMask instances for each exclusion layer to combine

longitude

Longitude coordinates array

mask

Inclusion mask for entire exclusion domain

nodata_lookup

Get a dictionary lookup of the nodata values for each layer name.

shape

Get the exclusions shape.

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)

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

classmethod run(excl_h5, fric_dset, hsds=False)[source]

Create inclusion mask from given layers dictionary

Parameters:
  • fric_h5 (str) – Path to friction layer .h5 file (same format as exclusions file)

  • fric_dset (str) – Friction layer dataset in fric_h5

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

Returns:

mask (ndarray) – Full inclusion mask