ecoscope.trajectory =================== .. py:module:: ecoscope.trajectory Module Contents --------------- .. py:function:: get_displacement(gdf) Get displacement in meters between first and final fixes. .. py:function:: get_tortuosity(gdf) Get tortuosity for dataframe defined as distance traveled divided by displacement between first and final points. .. py:class:: Trajectory(gdf) Bases: :py:obj:`ecoscope.base.EcoDataFrame` A trajectory represents a time-ordered collection of segments. Currently only straight track segments exist. It is based on an underlying relocs object that is the point representation .. py:method:: from_relocations(relocs, copy = True) :classmethod: Create Trajectory class from Relocation dataframe. :param relocs: A `Relocations` instance. :type relocs: Relocations :param copy: Whether or not to copy the `gdf`. Defaults to `True`. :type copy: bool, optional :rtype: Trajectory .. py:method:: _create_multitraj(gdf) :staticmethod: .. py:method:: _create_trajsegments(gdf) :staticmethod: .. py:method:: apply_traj_filter(traj_seg_filter, inplace = False) .. py:method:: get_turn_angle() .. py:method:: upsample(freq) Interpolate to create upsampled Relocations :param freq: Sampling frequency for new Relocations object :type freq: str, pd.Timedelta or pd.DateOffset :returns: **relocs** :rtype: ecoscope.Relocations .. py:method:: to_relocations() Converts a Trajectory object to a Relocations object. :rtype: ecoscope.Relocations .. py:method:: downsample(freq, tolerance = '0S', interpolation = False) Function to downsample relocations. :param freq: Downsampling frequency for new Relocations object :type freq: str, pd.Timedelta or pd.DateOffset :param tolerance: Tolerance on the downsampling frequency :type tolerance: str, pd.Timedelta or pd.DateOffset :param interpolation: If true, interpolates locations on the whole trajectory :type interpolation: bool, optional :rtype: ecoscope.Relocations .. py:method:: calculate_proximity(proximity_profile) A function to analyze the trajectory of a subject in relation to a set of spatial features and regions to determine where/when the subject was proximal to the spatial feature. :param proximity_profile: proximity setting for performing calculation :type proximity_profile: ProximityProfile :rtype: pd.DataFrame .. py:method:: apply_spatial_classification(spatial_regions, output_column_name = 'spatial_index')