cost_eco_model_linker.reef_distances

Attributes

Functions

haversine(x, y)

Calculate the great circle distance in kilometers between two points

find_closest_port(iv_reef_spatial)

Find closest port from mean location of reefs where interventions occur.

find_representative_reef(reef_spatial_data, iv_reefs)

Find closest representative reef from mean location of reefs where interventions occur.

find_representative_reefs(iv_reef_spatial, regions_data)

Find clusters of reefs within max_dist of each other. These represent the furthest a ship would travel

find_representative_port(reef_spatial_data, iv_reefs)

find_max_reef_distance(reef_spatial_data, ...[, max_dist])

Finds the total estimated travel distance from port via the max distance to port from

Module Contents

cost_eco_model_linker.reef_distances.REPR_PORTS = None
cost_eco_model_linker.reef_distances.REPR_REEFS = None
cost_eco_model_linker.reef_distances.haversine(x, y)

Calculate the great circle distance in kilometers between two points on the earth (specified in decimal degrees)

Order of values are expected to be in longitude and latitude.

cost_eco_model_linker.reef_distances.find_closest_port(iv_reef_spatial)

Find closest port from mean location of reefs where interventions occur.

Return type:

Tuple, of the name of closest port and the distance in nautical miles.

cost_eco_model_linker.reef_distances.find_representative_reef(reef_spatial_data, iv_reefs)

Find closest representative reef from mean location of reefs where interventions occur.

Return type:

Name of closest representative reef.

cost_eco_model_linker.reef_distances.find_representative_reefs(iv_reef_spatial, regions_data, max_dist=25.0)

Find clusters of reefs within max_dist of each other. These represent the furthest a ship would travel between reefs to implement interventions before going back to port. For reefs in unique clusters, the reef furthest from port is selected to represent the maximum travel distance from port, which is used to estimate the logistical cost of the intervention.

Parameters:
  • reef_spatial_data (dataframe) – A dataframe from the RME specified key reef IDs and spatial information (loaded from reefmod_gbr.gpkg).

  • regions_data (dataframe) – A dataframe with key spatial and economics data for each reef in the GBR (loaded from econ_spatial.csv).

  • iv_reefs (np.array(str)) – GBRMPA IDs of all reefs intervened at in the intervention

  • max_dist (float) – Maximum allowable distance between reefs in a cluster.

Returns:

representative_reefs – GBRMPA IDs which represent a subset of iv_reefs which give the reefs furthest from port for each cluster, their names, and distances.

Return type:

Tuple

cost_eco_model_linker.reef_distances.find_representative_port(reef_spatial_data, iv_reefs)
cost_eco_model_linker.reef_distances.find_max_reef_distance(reef_spatial_data, regions_data, iv_reefs, max_dist=25.0)

Finds the total estimated travel distance from port via the max distance to port from the closest reef cluster plus the sum of distances between that cluster and any other clusters.

Parameters:
  • iv_reefs (list) – List of reef IDs intervened at for a particular intervention

  • data_store (dataframe) – Storage dataframe for creating economics metric files

Return type:

Tuple, of (reef_ids, reef_names, distances)