mnp.species_models.habitat_suitability

Module Contents

Classes

HSIProcedure

Abstract class for HSI procedures.

Nature

PreCalculated

Procedure for when reading HSI from disk. Does nothing as HSI map is read from cover directory. An empty procedure is needed for this as having no procedure will result in KeyError when attempting to execute procedures from SpeciesModel

HSI

Habitat type suitability class for making hsi maps for species.

API

class mnp.species_models.habitat_suitability.HSIProcedure(hsi_threshold: float, suitabilities: dict)

Bases: abc.ABC

Abstract class for HSI procedures.

Initialization

hsi_threshold: float

threshold below which to exclude land type, multiplied by environmental factor, from further computations.

suitabilities: dict

Suitabilities of land types as: land type code (str) : suitability (float between 0 and 1).

abstractmethod run(land_types: dict, abiotic_factor_array: sparse.csr_array or None)

Run the HSI procedure on a given set of land types and (optionally) abiotic factor array.

land_typesdict

Land types as: land type code (str) : suitability (float between 0 and 1).

abiotic_factor_arraysparse.csr_array or None

Abiotic factor array for the species. If None, no abiotic factors are considered.

class mnp.species_models.habitat_suitability.Nature(hsi_threshold: float, suitabilities: dict)

Bases: mnp.species_models.habitat_suitability.HSIProcedure

run(land_types: dict, environmental_factor_array: sparse.csr_array or None)

Calculate land type suitability for ‘Nature’ species; terrestrial species occurring in nature areas.

land_types : dict environmental_factor_array : sparse.csr_array or None

hsi : sparse.csr_array

class mnp.species_models.habitat_suitability.PreCalculated(hsi_threshold: float, suitabilities: dict)

Bases: mnp.species_models.habitat_suitability.HSIProcedure

Procedure for when reading HSI from disk. Does nothing as HSI map is read from cover directory. An empty procedure is needed for this as having no procedure will result in KeyError when attempting to execute procedures from SpeciesModel

land_types environmental_factor_array

Initialization

hsi_threshold: float

threshold below which to exclude land type, multiplied by environmental factor, from further computations.

suitabilities: dict

Suitabilities of land types as: land type code (str) : suitability (float between 0 and 1).

run(land_types: dict, environmental_factor_array: sparse.csr_array or None)
class mnp.species_models.habitat_suitability.HSI(parameters: mnp.config.MNPParameters, species_code: str)

Bases: mnp.species_models.species_geo_map.SpeciesGeoMap

Habitat type suitability class for making hsi maps for species.

Initialization

parameters : MNPParameters species_code : str

HSI

calculate(land_types: dict, environmentals: dict or None = None) sparse.sparray or int

Calculate land type suitability index map for this species based on the land type map, and land type suitabilities

environmentals : dict or None land_types : dict

dict of LandType objects

save_environmental_factor_raster()

Save the environmental factor raster to a file.