ecoscope.relocations#

Module Contents#

class ecoscope.relocations.Relocations(gdf)[source]#

Bases: ecoscope.base.EcoDataFrame

Relocation is a model for a set of fixes from a given subject. Because fixes are temporal, they can be ordered asc or desc. The additional_data dict can contain info specific to the subject and relocations: name, type, region, sex etc. These values are applicable to all fixes in the relocations array. If they vary, then they should be put into each fix’s additional_data dict.

Parameters:

gdf (geopandas.GeoDataFrame)

classmethod from_gdf(gdf, groupby_col=None, time_col='fixtime', uuid_col=None, copy=True)[source]#
Parameters:
  • gdf (GeoDataFrame) – Observations data

  • groupby_col (str, optional) – Name of gdf column of identities to treat as separate individuals. Usually subject_id. Default is treating the gdf as being of a single individual.

  • time_col (str, optional) – Name of gdf column containing relocation times. Default is ‘fixtime’.

  • uuid_col (str, optional) – Name of gdf column of row identities. Used as index. Default is existing index.

  • copy (bool, optional) – Whether or not to copy the gdf. Defaults to True.

static _apply_speedfilter(df, fix_filter)[source]#
Parameters:
static _apply_distfilter(df, fix_filter)[source]#
Parameters:
apply_reloc_filter(fix_filter=None, inplace=False)[source]#

Apply a given filter by marking the fix junk_status based on the conditions of a filter

Parameters:
  • fix_filter (ecoscope.base._dataclasses.RelocsFilterType | None)

  • inplace (bool)

property distance_from_centroid#
property cluster_radius#

The cluster radius is the largest distance between a point in the relocationss and the centroid of the relocationss

property cluster_std_dev#

The cluster standard deviation is the standard deviation of the radii from the centroid to each point making up the cluster

threshold_point_count(threshold_dist)[source]#

Counts the number of points in the cluster that are within a threshold distance of the geographic centre

Parameters:

threshold_dist (float)

apply_threshold_filter(threshold_dist_meters=float('Inf'))[source]#
Parameters:

threshold_dist_meters (float)