:py:mod:`ecoscope.analysis` =========================== .. py:module:: ecoscope.analysis Subpackages ----------- .. toctree:: :titlesonly: :maxdepth: 3 UD/index.rst Submodules ---------- .. toctree:: :titlesonly: :maxdepth: 1 astronomy/index.rst ecograph/index.rst geofence/index.rst immobility/index.rst percentile/index.rst proximity/index.rst seasons/index.rst speed/index.rst Package Contents ---------------- .. py:class:: Ecograph(trajectory, resolution=15, radius=2, cutoff=None, tortuosity_length=3) A class that analyzes movement tracking data using Network Theory. :param trajectory: Trajectory dataframe :type trajectory: ecoscope.base.Trajectory :param resolution: Pixel size, in meters :type resolution: float :param radius: Radius to compute Collective Influence (Default : 2) :type radius: int :param cutoff: Cutoff to compute an approximation of betweenness index if the standard algorithm is too slow. Can be useful for very large graphs (Default : None) :type cutoff: int :param tortuosity_length: The number of steps used to compute the two tortuosity metrics (Default : 3 steps) :type tortuosity_length: int .. py:method:: to_csv(output_path) Saves the features of all nodes in a CSV file :param output_path: Output path for the CSV file :type output_path: str, Pathlike .. py:method:: to_geotiff(feature, output_path, individual='all', interpolation=None, transform=None) Saves a specific node feature as a GeoTIFF :param feature: Feature of interest :type feature: str :param output_path: Output path for the GeoTIFF file :type output_path: str, Pathlike :param individual: The individual for which we want to output the node feature (Default : "all") :type individual: str :param interpolation: 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" :type interpolation: str or None :param transform: A feature transform method (Default : None) :type transform: sklearn.base.TransformerMixin or None .. py:method:: _get_ecograph(self, trajectory_gdf, individual_name, radius, cutoff, tortuosity_length) :staticmethod: .. py:method:: _update_node(G, node_id, attributes) :staticmethod: .. py:method:: _get_day_night_value(day_night_value) :staticmethod: .. py:method:: _initialize_node(G, node_id, attributes, empty=False) :staticmethod: .. py:method:: _get_dot_product(x, y, z, w) :staticmethod: .. py:method:: _get_tortuosities(self, lines, time_delta) :staticmethod: .. py:method:: _compute_network_metrics(self, G, radius, cutoff) :staticmethod: .. py:method:: _compute_degree(G) :staticmethod: .. py:method:: _compute_collective_influence(self, G, radius) :staticmethod: .. py:method:: _get_collective_influence(G, start, radius) :staticmethod: .. py:method:: _compute_betweenness(G, cutoff) :staticmethod: .. py:method:: _get_feature_mosaic(self, feature, interpolation=None) :staticmethod: .. py:method:: _get_feature_map(self, feature, individual, interpolation) :staticmethod: .. py:method:: _get_regular_feature_map(self, feature, individual) :staticmethod: .. py:method:: _get_interpolated_feature_map(self, feature, individual, interpolation) :staticmethod: .. py:function:: get_feature_gdf(input_path) Convert a GeoTIFF feature map into a GeoDataFrame :param input_path: Input path for the GeoTIFF file :type input_path: str, Pathlike .. py:function:: get_percentile_area(percentile_levels, raster_path, subject_id = '') :param percentile_levels: list of k-th percentile scores. :type percentile_levels: Typing.List[Int] :param raster_path: file path to where the raster is stored. :type raster_path: str or os.PathLike :param subject_id: unique identifier for the subject :type subject_id: str :rtype: GeoDataFrame .. py:class:: SpeedDataFrame(data=None, *args, **kwargs) Bases: :py:obj:`ecoscope.base.EcoDataFrame` `EcoDataFrame` extends `geopandas.GeoDataFrame` to provide customizations and allow for simpler extension. .. py:method:: from_trajectory(trajectory, classification_method = 'equal_interval', num_classes = 6, bins = None, speed_colors = None) :classmethod: