ecoscope.analysis.ecograph#

Module Contents#

class ecoscope.analysis.ecograph.Ecograph(trajectory, resolution=15, radius=2, cutoff=None, tortuosity_length=3)[source]#

A class that analyzes movement tracking data using Network Theory.

Parameters:
  • trajectory (ecoscope.base.Trajectory) – Trajectory dataframe

  • resolution (float) – Pixel size, in meters

  • radius (int) – Radius to compute Collective Influence (Default : 2)

  • cutoff (int) – Cutoff to compute an approximation of betweenness index if the standard algorithm is too slow. Can be useful for very large graphs (Default : None)

  • tortuosity_length (int) – The number of steps used to compute the two tortuosity metrics (Default : 3 steps)

to_csv(output_path)[source]#

Saves the features of all nodes in a CSV file

Parameters:

output_path (str, Pathlike) – Output path for the CSV file

to_geotiff(feature, output_path, individual='all', interpolation=None, transform=None)[source]#

Saves a specific node feature as a GeoTIFF

Parameters:
  • feature (str) – Feature of interest

  • output_path (str, Pathlike) – Output path for the GeoTIFF file

  • individual (str) – The individual for which we want to output the node feature (Default : “all”)

  • interpolation (str or None) – Whether to interpolate the feature for each step in the trajectory (Default : None). If provided, has to be one of those four types of interpolation : “mean”, “median”, “max” or “min”

  • transform (sklearn.base.TransformerMixin or None) – A feature transform method (Default : None)

static _get_ecograph(self, trajectory_gdf, individual_name, radius, cutoff, tortuosity_length)[source]#
static _update_node(G, node_id, attributes)[source]#
static _get_day_night_value(day_night_value)[source]#
static _initialize_node(G, node_id, attributes, empty=False)[source]#
static _get_dot_product(x, y, z, w)[source]#
static _get_tortuosities(self, lines, time_delta)[source]#
static _compute_network_metrics(self, G, radius, cutoff)[source]#
static _compute_degree(G)[source]#
static _compute_collective_influence(self, G, radius)[source]#
static _get_collective_influence(G, start, radius)[source]#
static _compute_betweenness(G, cutoff)[source]#
static _get_feature_mosaic(self, feature, interpolation=None)[source]#
static _get_feature_map(self, feature, individual, interpolation)[source]#
static _get_regular_feature_map(self, feature, individual)[source]#
static _get_interpolated_feature_map(self, feature, individual, interpolation)[source]#
exception ecoscope.analysis.ecograph.InterpolationError[source]#

Bases: Exception

Common base class for all non-exit exceptions.

exception ecoscope.analysis.ecograph.IndividualNameError[source]#

Bases: Exception

Common base class for all non-exit exceptions.

exception ecoscope.analysis.ecograph.FeatureNameError[source]#

Bases: Exception

Common base class for all non-exit exceptions.

ecoscope.analysis.ecograph.get_feature_gdf(input_path)[source]#

Convert a GeoTIFF feature map into a GeoDataFrame

Parameters:

input_path (str, Pathlike) – Input path for the GeoTIFF file