Modules¶
prospect.simulation¶
-
class
prospect.simulation.
SimSession
(engine_str='sqlite:///simulation_default.db')¶ Bases:
object
Object to handle setup/teardown as well as transactions for a SQLAlchemy Session
Parameters: engine_str (str, optional) – Database URL (the default is “sqlite:///simulation_default.db”) Notes
The SQLAlchemy docs have some good examples of different types of database URLs. https://docs.sqlalchemy.org/en/latest/core/engines.html#database-urls
-
engine
¶ Type: sqlalchemy Engine
-
session
¶ Type: sqlalchemy Session
-
stage
(block)¶ Add a building block to the list of objects to save to the database
-
unstage
(block)¶ Remove a building block
-
prospect.survey¶
-
class
prospect.survey.
Survey
(name, area=None, assemblage=None, coverage=None, team=None)¶ Bases:
sqlalchemy.ext.declarative.api.Base
Unique index for a set of Area, Assemblage, Coverage, and Team
Parameters: name (str) – Unique name for the survey -
name
¶ Name of the survey
Type: str
-
add_bb
(bb: List[Union[prospect.area.Area, prospect.assemblage.Assemblage, prospect.coverage.Coverage, prospect.team.Team]])¶ Attach building blocks to survey.
Parameters: bb (List[Union[Area, Assemblage, Coverage, Team]]) – List of building block objects
-
prospect.area¶
-
class
prospect.area.
Area
(name, survey_name, shape, vis=1.0)¶ Bases:
sqlalchemy.ext.declarative.api.Base
Spatial extent of the survey
Parameters: - name (str) – Unique name for the area
- survey_name (str) – Name of the associated Survey
- shape (Polygon) – Geographic specification
- vis (Union[float, rv_frozen], optional) – Surface visibility (the default is 1.0, which means perfect surface visibility)
-
name
¶ Name of the area
Type: str
-
survey_name
¶ Name of the associated Survey
Type: str
-
shape
¶ Geographic specification
Type: Polygon
-
vis
¶ Surface visibility
Type: Union[float, rv_frozen]
-
df
¶ GeoDataFrame with one row that summarizes the area’s attributes
Type: geopandas GeoDataFrame
-
classmethod
from_area_value
(name: str, survey_name: str, value: float, origin: Tuple[float, float] = (0.0, 0.0), vis: Union[float, scipy.stats._distn_infrastructure.rv_frozen] = 1.0) → prospect.area.Area¶ Create a square Area object by specifying its area
Parameters: - name (str) – Unique name for the area
- survey_name (str) – Name of the associated survey
- value (float) – Area of the output shape
- origin (Tuple[float, float]) – Location of the bottom left corner of square
- vis (Union[float, rv_frozen]) – Surface visibility
Returns: Return type:
-
classmethod
from_shapefile
(name: str, survey_name: str, path: str, vis: Union[float, scipy.stats._distn_infrastructure.rv_frozen] = 1.0) → prospect.area.Area¶ Create an Area object from a shapefile
Parameters: - name (str) – Unique name for the area
- survey_name (str) – Name of the associated survey
- path (str) – File path to the shapefile
- vis (Union[float, rv_frozen]) – Surface visibility
Returns: Return type:
-
set_vis_beta_dist
(alpha: int, beta: int)¶ Define a beta distribution from which to sample visibility values
Parameters: beta (alpha,) – Values to define the shape of the beta distribution
-
set_vis_raster
(raster)¶ placeholder for future raster support
Parameters: raster –
prospect.assemblage¶
-
class
prospect.assemblage.
Assemblage
(name, survey_name, area_name, layer_list)¶ Bases:
sqlalchemy.ext.declarative.api.Base
A collection of all Layer objects for a survey
Parameters: - name (str) – Unique name for the assemblage
- survey_name (str) – Name of the survey
- area_name (str) – Name of the containing area
- layer_list (list of Layer) – List of layers that make up the assemblage
-
name
¶ Name of the assemblage
Type: str
-
survey_name
¶ Name of the survey
Type: str
-
area_name
¶ Name of the containing area
Type: str
-
df
¶ GeoDataFrame with a row for each feature in the assemblage
Type: geopandas GeoDataFrame
prospect.layer¶
-
class
prospect.layer.
Layer
(name, area, assemblage_name, feature_list, time_penalty=0.0, ideal_obs_rate=1.0)¶ Bases:
sqlalchemy.ext.declarative.api.Base
A container for Feature objects
The Layer class is mostly useful as a way to create groups of similar features.
Parameters: - name (str) – Unique name for the layer
- area (Area) – Containing area
- assemblage_name (str) – Name of the parent assemblage
- feature_list (List[Feature]) – List of features that make up the layer
- time_penalty (Union[float, rv_frozen], optional) – Minimum amount of time it takes to record a feature (the default is 0.0, which indicates no time cost for feature recording)
- ideal_obs_rate (Union[float, rv_frozen], optional) –
Ideal observation rate: the frequency with which an artifact or feature will be recorded, assuming the following ideal conditions:
- It lies inside or intersects the Coverage
- Surface visibility is 100%
- The surveyor is highly skilled
The default is 1.0, which indicates that when visibility and surveyor skill allow, the feature will always be recorded.
-
name
¶ Name of the layer
Type: str
-
area_name
¶ Name of the containing area
Type: str
-
assemblage_name
¶ Name of the parent assemblage
Type: str
-
df
¶ GeoDataFrame with a row for each feature in the layer
Type: geopandas GeoDataFrame
-
classmethod
from_matern_points
(parent_rate: float, child_rate: float, radius: float, name: str, area: prospect.area.Area, assemblage_name: str, time_penalty: Union[float, scipy.stats._distn_infrastructure.rv_frozen] = 0.0, ideal_obs_rate: Union[float, scipy.stats._distn_infrastructure.rv_frozen] = 1.0) → prospect.layer.Layer¶ Create a Layer instance with a Matérn point process.
It has a Poisson number of clusters, each with a Poisson number of points distributed uniformly across a disk of a given radius.
Parameters: - parent_rate (float) – Theoretical clusters per unit area across the whole space. See Notes in poisson_points() for more details
- child_rate (float) – Theoretical child points per unit area per cluster across the whole space.
- radius (float) – Radius of the disk around the cluster centers
- name (str) – Unique name for the layer
- area (Area) – Containing area
- assemblage_name (str) – Name of the parent assemblage
- time_penalty (Union[float, rv_frozen], optional) – Minimum amount of time it takes to record a feature (the default is 0.0, which indicates no time cost for feature recording)
- ideal_obs_rate (Union[float, rv_frozen], optional) –
Ideal observation rate: the frequency with which an artifact or feature will be recorded, assuming the following ideal conditions:
- It lies inside or intersects the Coverage (see below)
- Surface visibility is 100%
- The surveyor is highly skilled
The default is 1.0, which indicates that when visibility and surveyor skill allow, the feature will always be recorded.
Returns: Return type: See also
poisson_points()
- includes details on Poisson point process
from_pseudorandom_points()
- faster, naive point creation
from_poisson_points()
- simple Poisson points Layer
from_thomas_points()
- similar process, good for clusters with centers from Poisson points
uniform_disk()
- function used to specify point locations around parents
Notes
Parents (cluster centers) are NOT created as points in the output
-
classmethod
from_poisson_points
(rate: float, name: str, area: prospect.area.Area, assemblage_name: str, time_penalty: Union[float, scipy.stats._distn_infrastructure.rv_frozen] = 0.0, ideal_obs_rate: Union[float, scipy.stats._distn_infrastructure.rv_frozen] = 1.0) → prospect.layer.Layer¶ Create a Layer instance of points with a Poisson point process
Parameters: - rate (float) – Theoretical events per unit area across the whole space. See Notes in poisson_points() for more details
- name (str) – Unique name for the layer
- area (Area) – Containing area
- assemblage_name (str) – Name of the parent assemblage
- time_penalty (Union[float, rv_frozen], optional) – Minimum amount of time it takes to record a feature (the default is 0.0, which indicates no time cost for feature recording)
- ideal_obs_rate (Union[float, rv_frozen], optional) –
Ideal observation rate: the frequency with which an artifact or feature will be recorded, assuming the following ideal conditions:
- It lies inside or intersects the Coverage
- Surface visibility is 100%
- The surveyor is highly skilled
The default is 1.0, which indicates that when visibility and surveyor skill allow, the feature will always be recorded.
Returns: Return type: See also
poisson_points()
- includes details on Poisson point process
from_pseudorandom_points()
- faster, naive point creation
from_thomas_points()
- good for clusters with centers from Poisson points
from_matern_points()
- good for clusters with centers from Poisson points
Notes
The generated point coordinates are not guaranteed to fall within the given area, only within its bounding box. The generated GeoDataFrame, df, is clipped by the actual area bounds after they are generated, which can result in fewer points than expected. All points will remain in the feature_list.
-
classmethod
from_pseudorandom_points
(n: int, name: str, area: prospect.area.Area, assemblage_name: str, time_penalty: Union[float, scipy.stats._distn_infrastructure.rv_frozen] = 0.0, ideal_obs_rate: Union[float, scipy.stats._distn_infrastructure.rv_frozen] = 1.0) → prospect.layer.Layer¶ Create a Layer instance of pseudorandom points
Parameters: - n (int) – Number of points to generate
- name (str) – Unique name for the layer
- area (Area) – Containing area
- assemblage_name (str) – Name of the parent assemblage
- time_penalty (Union[float, rv_frozen], optional) – Minimum amount of time it takes to record a feature (the default is 0.0, which indicates no time cost for feature recording)
- ideal_obs_rate (Union[float, rv_frozen], optional) –
Ideal observation rate: the frequency with which an artifact or feature will be recorded, assuming the following ideal conditions:
- It lies inside or intersects the Coverage
- Surface visibility is 100%
- The surveyor is highly skilled
The default is 1.0, which indicates that when visibility and surveyor skill allow, the feature will always be recorded.
Returns: Return type: See also
from_poisson_points()
- simple Poisson points Layer
from_thomas_points()
- good for clusters with centers from Poisson points
from_matern_points()
- good for clusters with centers from Poisson points
Notes
The generated point coordinates are not guaranteed to fall within the given area, only within its bounding box. The generated GeoDataFrame, df, is clipped by the actual area bounds after they are generated, which can result in fewer points than expected. All points will remain in the feature_list.
-
classmethod
from_shapefile
(path: str, name: str, area: prospect.area.Area, assemblage_name: str, time_penalty: Union[float, scipy.stats._distn_infrastructure.rv_frozen] = 0.0, ideal_obs_rate: Union[float, scipy.stats._distn_infrastructure.rv_frozen] = 1.0) → prospect.layer.Layer¶ Create a Layer instance from a shapefile.
Parameters: - path (str) – Filepath to the shapefile
- name (str) – Unique name for the layer
- area (Area) – Containing area
- assemblage_name (str) – Name of the parent assemblage
- time_penalty (Union[float, rv_frozen], optional) – Minimum amount of time it takes to record a feature (the default is 0.0, which indicates no time cost for feature recording)
- ideal_obs_rate (Union[float, rv_frozen], optional) –
Ideal observation rate: the frequency with which an artifact or feature will be recorded, assuming the following ideal conditions:
- It lies inside or intersects the Coverage
- Surface visibility is 100%
- The surveyor is highly skilled
The default is 1.0, which indicates that when visibility and surveyor skill allow, the feature will always be recorded.
Returns: Return type:
-
classmethod
from_thomas_points
(parent_rate: float, child_rate: float, gauss_var: float, name: str, area: prospect.area.Area, assemblage_name: str, time_penalty: Union[float, scipy.stats._distn_infrastructure.rv_frozen] = 0.0, ideal_obs_rate: Union[float, scipy.stats._distn_infrastructure.rv_frozen] = 1.0) → prospect.layer.Layer¶ Create a Layer instance with a Thomas point process.
It has a Poisson number of clusters, each with a Poisson number of points distributed with an isotropic Gaussian distribution of a given variance.
Parameters: - parent_rate (float) – Theoretical clusters per unit area across the whole space. See Notes in poisson_points() for more details
- child_rate (float) – Theoretical child points per unit area per cluster across the whole space.
- gauss_var (float) – Variance of the isotropic Gaussian distributions around the cluster centers
- name (str) – Unique name for the layer
- area (Area) – Containing area
- assemblage_name (str) – Name of the parent assemblage
- time_penalty (Union[float, rv_frozen], optional) – Minimum amount of time it takes to record a feature (the default is 0.0, which indicates no time cost for feature recording)
- ideal_obs_rate (Union[float, rv_frozen], optional) –
Ideal observation rate: the frequency with which an artifact or feature will be recorded, assuming the following ideal conditions:
- It lies inside or intersects the Coverage
- Surface visibility is 100%
- The surveyor is highly skilled
The default is 1.0, which indicates that when visibility and surveyor skill allow, the feature will always be recorded.
Returns: Return type: See also
poisson_points()
- includes details on Poisson point process
from_pseudorandom_points()
- faster, naive point creation
from_poisson_points()
- simple Poisson points Layer
from_matern_points()
- similar process, good for clusters with centers from Poisson points
Notes
- Parents (cluster centers) are NOT created as points in the output
- The generated point coordinates are not guaranteed to fall within the given area, only within its bounding box. The generated GeoDataFrame, df, is clipped by the actual area bounds after they are generated, which can result in fewer points than expected. All points will remain in the feature_list.
-
static
poisson_points
(area: prospect.area.Area, rate: float) → numpy.ndarray¶ Create point coordinates from a Poisson process.
Parameters: - area (Area) – Bounding area
- rate (float) – Theoretical events per unit area across the whole space. See Notes for more details
Returns: Return type: np.ndarray
See also
from_poisson_points()
- creates Layer with Poisson process
from_pseudorandom_points()
- faster, naive point creation
from_thomas_points()
- good for clusters with centers from Poisson points
from_matern_points()
- good for clusters with centers from Poisson points
Notes
A Poisson point process is usually said to be more “purely” random than most random number generators (like the one used in from_pseudorandom_points())
The rate (usually called “lambda”) of the Poisson point process represents the number of events per unit of area per unit of time across some theoretical space of which our Area is some subset. In this case, we only have one unit of time, so the rate really represents a theoretical number of events per unit area. For example, if the specified rate is 5, in any 1x1 square, the number of points observed will be drawn randomly from a Poisson distribution with a shape parameter of 5. In practical terms, this means that over many 1x1 areas (or many observations of the same area), the mean number of points observed in that area will approximate 5.
-
set_ideal_obs_rate_beta_dist
(alpha: int, beta: int)¶ Define a beta distribution from which to sample ideal observation rate values
Parameters: beta (alpha,) – Values to define the shape of the beta distribution
-
static
uniform_disk
(x: float, y: float, r: float) → Tuple[float, float]¶ Randomly locate a point within a disk of specified radius
Parameters: - y (x,) – Coordinates of disk center
- r (float) – Radius of the disk
Returns: Random point within the disk
Return type: Tuple[float, float]
prospect.feature¶
-
class
prospect.feature.
Feature
(name, layer_name, shape, time_penalty=0.0, ideal_obs_rate=1.0)¶ Bases:
sqlalchemy.ext.declarative.api.Base
Represents an observable thing like an artifact or landscape feature.
This class is not normally used directly. It is usually more efficient to use the constructor methods of the Layer class to create many Feature objects at once.
Parameters: - name (str) – Unique name for the feature
- layer_name (str) – Name of the parent layer
- shape (Union[Point, LineString, Polygon]) – Geographic specification
- time_penalty (Union[float, rv_frozen], optional) – Minimum amount of time it takes to record a feature (the default is 0.0, which indicates no time cost for feature recording)
- ideal_obs_rate (Union[float, rv_frozen], optional) –
Ideal observation rate: the frequency with which an artifact or feature will be recorded, assuming the following ideal conditions:
- It lies inside or intersects the Coverage
- Surface visibility is 100%
- The surveyor is highly skilled
The default is 1.0, which indicates that when visibility and surveyor skill allow, the feature will always be recorded.
-
name
¶ Unique name for the feature
Type: str
-
layer_name
¶ Name of parent layer
Type: str
-
shape
¶ Geographic specification
Type: Union[Point, LineString, Polygon]
-
time_penalty
¶ Minimum amount of time it takes to record a feature
Type: Union[float, rv_frozen]
-
ideal_obs_rate
¶ Ideal observation rate: the frequency with which an artifact or feature will be recorded, assuming the following ideal conditions:
- It lies inside or intersects the Coverage
- Surface visibility is 100%
- The surveyor is highly skilled
Type: Union[float, rv_frozen]
-
to_dict
() → Dict¶ Create dictionary from attributes to allow easy DataFrame creation by Layer.
Returns: Dictionary containing pairs of class attributes and their values Return type: dict
prospect.coverage¶
-
class
prospect.coverage.
Coverage
(name, area, survey_name, surveyunit_list, orientation, spacing, sweep_width=None, radius=None)¶ Bases:
sqlalchemy.ext.declarative.api.Base
A collection of SurveyUnit objects
The Coverage class is mostly useful as a way to create groups of similar survey units.
Parameters: - name (str) – Unique name for the Coverage
- area (Area) – Containing area
- survey_name (str) – Name of the survey
- surveyunit_list (List[SurveyUnit]) – List of survey units that make up the coverage
- orientation (float) – Angle of the predominant axis of the survey units
- spacing (float) – Distance between survey units
- sweep_width (float, optional) – Buffer distance around transects (the default is None, which is only updated if the survey units are transects)
- radius (float, optional) – Buffer distance for radial survey units (the default is None, which is only update if the survey units are radial)
-
name
¶ Unique name for the coverage
Type: str
-
survey_name
¶ Name of the survey
Type: str
-
area_name
¶ Name of the containing area
Type: str
-
surveyunit_list
¶ List of survey units that make up the coverage
Type: List[SurveyUnit]
-
orientation
¶ Angle of the predominant axis of the survey units
Type: float
-
spacing
¶ Distance between survey units
Type: float
-
sweep_width
¶ Buffer distance around transects
Type: float
-
radius
¶ Buffer distance for radial survey units
Type: float
-
df
¶ GeoDataFrame with a row for each survey unit
Type: geopandas GeoDataFrame
-
classmethod
from_GeoDataFrame
(gdf: geopandas.geodataframe.GeoDataFrame, name: str, area: prospect.area.Area, survey_name: str, surveyunit_type: str, spacing: float, orient_axis: str = 'long', min_time_per_unit: Union[float, scipy.stats._distn_infrastructure.rv_frozen] = 0.0) → prospect.coverage.Coverage¶ Create a Coverage instance from a geopandas GeoDataFrame
Parameters: - gdf (geopandas GeoDataFrame) – GeoDataFrame where each row is a survey unit
- name (str) – Unique name for the Coverage
- area (Area) – Containing area
- survey_name (str) – Name of the survey
- surveyunit_type ({'transect', 'radial'}) – Type of units to create
- spacing (float) – Distance between survey units
- orient_axis ({'long', 'short'}, optional) – Axis of the area along which to orient the survey units (the default is ‘long’, which creates rows parallel to the longest axis of the area’s minimum rotated rectangle)
- min_time_per_unit (Union[float, rv_frozen], optional) –
Minimum amount of time required to complete one “unit” of survey, given no surveyor speed penalty and no time penalty for recording features. The default is 0.0.
Because transects can differ in length, transect coverages should specify this term as time per one unit of distance (e.g., seconds per meter).
For radial survey units, this term should be specified more simply as time per one survey unit.
Returns: Return type:
-
classmethod
from_radials
(name: str, area: prospect.area.Area, survey_name: str, spacing: float = 10.0, radius: float = 1.78, orientation: float = 0.0, optimize_orient_by: str = None, orient_increment: float = 5.0, orient_axis: str = 'long', min_time_per_unit: Union[float, scipy.stats._distn_infrastructure.rv_frozen] = 0.0) → prospect.coverage.Coverage¶ Create a Coverage instance of radial units.
Parameters: - name (str) – Unique name for the Coverage
- area (Area) – Containing area
- survey_name (str) – Name of the survey
- spacing (float, optional) – Distance between survey units (the default is 10.0)
- radius (float, optional) – Buffer distance for radial survey units (the default is 1.78, which leads to radial units of roughly 10 square units of area)
- orientation (float, optional) – Angle of the predominant axis of the survey units (the default is 0.0)
- optimize_orient_by ({'area_coverage', 'area_orient'}, optional) – Metric to optimize in determining the orientation of survey units. ‘area_coverage’ chooses the orientation that maximizes the area covered by the survey units. ‘area_orient’ chooses the orientation that best parallels the orient_axis of the area. The default is None, in which case the orientation parameter is used directly.
- orient_increment (float, optional) – Step size (in degrees) to use when testing different orientations. (the default is 5.0)
- orient_axis ({'long', 'short'}, optional) – Axis of the area along which to orient the survey units (the default is ‘long’, which creates rows parallel to the longest axis of the area’s minimum rotated rectangle)
- min_time_per_unit (Union[float, rv_frozen]) –
Minimum amount of time required to complete one “unit” of survey, given no surveyor speed penalty and no time penalty for recording features. The default is 0.0.
For radial survey units, this term should be specified more simply as time per one survey unit.
Returns: Return type:
-
classmethod
from_shapefile
(path: str, name: str, area: prospect.area.Area, survey_name: str, surveyunit_type: str, spacing: float, orient_axis: str = 'long', min_time_per_unit: Union[float, scipy.stats._distn_infrastructure.rv_frozen] = 0.0) → prospect.coverage.Coverage¶ Create a Coverage instance from a shapefile.
Parameters: - path (str) – Filepath to the shapefile
- name (str) – Unique name for the Coverage
- area (Area) – Containing area
- survey_name (str) – Name of the survey
- surveyunit_type ({'transect', 'radial'}) – Type of units to create
- spacing (float) – Distance between survey units
- orient_axis ({'long', 'short'}, optional) – Axis of the area along which to orient the survey units (the default is ‘long’, which creates rows parallel to the longest axis of the area’s minimum rotated rectangle)
- min_time_per_unit (Union[float, rv_frozen], optional) –
Minimum amount of time required to complete one “unit” of survey, given no surveyor speed penalty and no time penalty for recording features. The default is 0.0.
Because transects can differ in length, transect coverages should specify this term as time per one unit of distance (e.g., seconds per meter).
For radial survey units, this term should be specified more simply as time per one survey unit.
Returns: Return type:
-
classmethod
from_transects
(name: str, area: prospect.area.Area, survey_name: str, spacing: float = 10.0, sweep_width: float = 2.0, orientation: float = 0.0, optimize_orient_by: str = None, orient_increment: float = 5.0, orient_axis: str = 'long', min_time_per_unit: Union[float, scipy.stats._distn_infrastructure.rv_frozen] = 0.0) → prospect.coverage.Coverage¶ Create a Coverage instance of transects.
Parameters: - name (str) – Unique name for the Coverage
- area (Area) – Containing area
- survey_name (str) – Name of the survey
- spacing (float, optional) – Distance between survey units (the default is 10.0)
- sweep_width (float, optional) – Buffer distance around transects (the default is 2.0)
- orientation (float, optional) – Angle of the predominant axis of the survey units (the default is 0.0)
- optimize_orient_by ({'area_coverage', 'area_orient'}, optional) – Metric to optimize in determining the orientation of survey units. ‘area_coverage’ chooses the orientation that maximizes the area covered by the survey units. ‘area_orient’ chooses the orientation that best parallels the orient_axis of the area. The default is None, in which case the orientation parameter is used directly.
- orient_increment (float, optional) – Step size (in degrees) to use when testing different orientations. (the default is 5.0)
- orient_axis ({'long', 'short'}, optional) – Axis of the area along which to orient the survey units (the default is ‘long’, which creates rows parallel to the longest axis of the area’s minimum rotated rectangle)
- min_time_per_unit (Union[float, rv_frozen]) –
Minimum amount of time required to complete one “unit” of survey, given no surveyor speed penalty and no time penalty for recording features. The default is 0.0.
Because transects can differ in length, transect coverages should specify this term as time per one unit of distance (e.g., seconds per meter).
Returns: Return type:
prospect.surveyunit¶
-
class
prospect.surveyunit.
SurveyUnit
(name, coverage_name, shape, surveyunit_type, length=None, radius=None, min_time_per_unit=0.0)¶ Bases:
sqlalchemy.ext.declarative.api.Base
Represents a spatial unit of survey like a transect or radial unit.
This class is not normally used directly. It is usually more efficient to use the constructor methods of the Coverage class to create many SurveyUnit objects at once.
Parameters: - name (str) – Unique name for the survey unit
- coverage_name (str) – Name of the parent coverage
- shape (Polygon) – Geographic specification
- surveyunit_type ({'transect', 'radial'}) – Type of the unit
- length (float, optional) – Length of transect units (the default is None)
- radius (float, optional) – Radius of radial units (the default is None)
- min_time_per_unit (Union[float, rv_frozen], optional) –
Minimum amount of time required to complete one “unit” of survey, given no surveyor speed penalty and no time penalty for recording features. The default is 0.0.
Because transects can differ in length, transect coverages should specify this term as time per one unit of distance (e.g., seconds per meter).
For radial survey units, this term should be specified more simply as time per one survey unit.
-
name
¶ Unique name for the survey unit
Type: str
-
coverage_name
¶ Name of the parent coverage
Type: str
-
shape
¶ Geographic specification
Type: Polygon
-
surveyunit_type
¶ Type of the unit
Type: {‘transect’, ‘radial’}
-
surveyunit_area
¶ Area value calculated from the shape
Type: float
-
length
¶ Length of transect units
Type: float
-
radius
¶ Radius of radial units
Type: float
-
min_time_per_unit
¶ Minimum amount of time required to complete one “unit” of survey, given no surveyor speed penalty and no time penalty for recording features.
Because transects can differ in length, transect coverages should specify this term as time per one unit of distance (e.g., seconds per meter).
For radial survey units, this term should be specified more simply as time per one survey unit.
Type: Union[float, rv_frozen]
-
to_dict
() → Dict¶ Create dictionary from attributes to allow easy DataFrame creation by Coverage.
Returns: Dictionary containing pairs of class attributes and their values Return type: dict
prospect.team¶
-
class
prospect.team.
Team
(name, survey_name, surveyor_list, assignment='naive')¶ Bases:
sqlalchemy.ext.declarative.api.Base
A collection of Surveyor objects.
Parameters: - name (str) – Unique name for the team
- survey_name (str) – Name of the survey
- surveyor_list (List[Surveyor]) – List of surveyors that make up the team
- assignment ({'naive', 'speed', 'random'}) –
Strategy for assigning team members to survey units.
- ’naive’ - cycle through Team.df in index order, assigning surveyors to survey units in Coverage.df in index order until all survey units have a surveyor.
- ’speed’ - calculate the total base time required for the coverage and allocate survey units proportional to surveyor speed.
- ’random’ - for each survey unit, randomly select (with replacement) a surveyor from the team
-
name
¶ Unique name for the team
Type: str
-
survey_name
¶ Name of the survey
Type: str
-
assignment
¶ Strategy for assigning team members to survey units.
Type: str
-
df
¶ DataFrame with a row for each surveyor
Type: pandas DataFrame
prospect.surveyor¶
-
class
prospect.surveyor.
Surveyor
(name, team_name, surveyor_type, skill=1.0, speed_penalty=0.0)¶ Bases:
sqlalchemy.ext.declarative.api.Base
Represents an individual who will participate in the survey.
Parameters: - name (str) – Unique name for the surveyor
- team_name (str) – Name of the parent team
- surveyor_type (str) – A helpful way of grouping surveyors with like traits (e.g., ‘student’ or ‘expert’)
- skill (Union[float, rv_frozen], optional) – Assuming perfect visibility and ideal observation rate, what is the expected probability that this person would identify any feature that crossed their survey unit. The default is 1.0, which would mean this surveyor recorded everything they encountered (after controlling for other factors).
- speed_penalty (Union[float, rv_frozen], optional) – Time factor added to each of this surveyor’s survey units. The default is 0.0, which applies no penalty. Penalties should range between 0.0 and 1.0.
-
name
¶ Unique name for the surveyor
Type: str
-
team_name
¶ Name of the parent team
Type: str
-
surveyor_type
¶ A helpful way of grouping surveyors with like traits (e.g., ‘student’ or ‘expert’)
Type: str
-
skill
¶ Assuming perfect visibility and ideal observation rate, what is the expected probability that this person would identify any feature that crossed their survey unit.
Type: Union[float, rv_frozen]
-
speed_penalty
¶ Time factor added to each of this surveyor’s survey units.
Type: Union[float, rv_frozen]
-
to_dict
() → Dict¶ Create dictionary from attributes to allow easy DataFrame creation by Team.
Returns: Dictionary containing pairs of class attributes and their values Return type: dict
prospect.utils¶
-
prospect.utils.
clip_lines_polys
(lines_polys: geopandas.geodataframe.GeoDataFrame, by: geopandas.geodataframe.GeoDataFrame) → geopandas.geodataframe.GeoDataFrame¶ Subset a GeoDataFrame of lines or polygons based on the boundaries of another GeoDataFrame.
Parameters: - lines_polys (geopandas GeoDataFrame) – Features to be clipped
- by (geopandas GeoDataFrame) – Boundaries to use for clipping
Returns: A subset of the original lines_polys
Return type: geopandas GeoDataFrame
References
Earth Analytics Python course, https://doi.org/10.5281/zenodo.2209415
-
prospect.utils.
clip_points
(points: geopandas.geodataframe.GeoDataFrame, by: geopandas.geodataframe.GeoDataFrame) → geopandas.geodataframe.GeoDataFrame¶ Subset a GeoDataFrame of points based on the boundaries of another GeoDataFrame.
Parameters: - points (geopandas GeoDataFrame) – Point features to be clipped
- by (geopandas GeoDataFrame) – Boundaries to use for clipping
Returns: A subset of the original points
Return type: geopandas GeoDataFrame
References
Earth Analytics Python course, https://doi.org/10.5281/zenodo.2209415
-
prospect.utils.
make_beta_distribution
(a: float, b: float) → scipy.stats._distn_infrastructure.rv_frozen¶ Create a fixed beta distribution.
Parameters: b (a,) – Shape parameters Returns: Fixed beta distribution Return type: rv_frozen
-
prospect.utils.
make_truncnorm_distribution
(mean: float, sd: float, lower: float, upper: float) → scipy.stats._distn_infrastructure.rv_frozen¶ Create a truncated normal distribution.
Parameters: - mean (float) – Mean of distribution
- sd (float) – Standard deviation of the distribution
- lower (float) – Lower bound
- upper (float) – Upper bound
Returns: Fixed truncated normal distribution
Return type: rv_frozen