ptrail.visualization package

Submodules

ptrail.visualization.HydrationTrends module

This File contains the visualization that is a Radar Scatter plot showing how many number of days around each Running Water Body has an individual element spent. It is an interactive visualization as such the user can change the water body and check the distribution of animals around it.

Warning

The visualizations in this module are currently developed with a focus around the starkey.csv data as it has been developed as a side project by the developers. It will further be integrated into the library as a general class of visualizers in the time to come. Some of the visualization types may or may not work with other datasets.

Authors: Yaksh J Haranwala
class ptrail.visualization.HydrationTrends.HydrationTrends[source]

Bases: object

Plot the interactive plotly Radar chart that shows the number of days spent by animals around a specific water body.

Note

The water bodies in the original dataset do not have any specific names. Hence, they are just given names such as Water-body #1, Water-body #2 and so on.

Parameters:
  • trajectories (PTRAILDataFrame) – The dataframe containing the trajectory data.

  • habitat (pd.DataFrame) – The dataframe containing the habitat data.

  • dist_from_water (int) – The maximum distance from the water water body that the animal should be in.

Return type:

None

ptrail.visualization.InteractiveDonut module

This File contains the visualization that is a Donut chart depicting the breakdown of animals by each pasture. The user can change the pasture to see the breakdown of individual pastures.

Warning

The visualizations in this module are currently developed with a focus around the starkey.csv data as it has been developed as a side project by the developers. It will further be integrated into the library as a general class of visualizers in the time to come. Some of the visualization types may or may not work with other datasets.

Authors: Yaksh J Haranwala
class ptrail.visualization.InteractiveDonut.InteractiveDonut[source]

Bases: object

static animals_by_pasture(trajectories: PTRAILDataFrame, habitat: pandas.DataFrame)[source]

Plot a donut chart that shows the proportion of animals for each pasture.

Parameters:
  • trajectories (PTRAILDataFrame) – The dataframe that contains trajectory data.

  • habitat (pd.DataFrame) – The dataframe that contains habitat data.

Return type:

None

static plot_area_donut(habitat: pandas.DataFrame)[source]

Given the trajectories and the habitat dataset, plot a donut plot which shows the area of each individual pasture as a ring and then has an interactive element that shows the distribution of animals upon clicking the pasture ring.

Parameters:

habitat (pd.core.dataframe.DataFrame) – The dataset containing the habitat data.

Return type:

None

ptrail.visualization.TrajPlotter module

This File contains TrajectoryPlotter for the Starkey dataset. An interactive experience is added to this plot in order to view the trajectory of an individual or multiple animals together.

Warning

The visualizations in this module are currently developed with a focus around the starkey.csv data as it has been developed as a side project by the developers. It will further be integrated into the library as a general class of visualizers in the time to come.

Authors: Yaksh J Haranwala
class ptrail.visualization.TrajPlotter.TrajectoryPlotter[source]

Bases: object

static show_trajectories(dataset, weight: float = 3, opacity: float = 0.8)[source]

Use folium to plot the trajectory on a map.

Parameters:
  • dataset

  • weight (float) – The weight of the trajectory line on the map.

  • opacity (float) – The opacity of the trajectory line on the map.

Returns:

The map with plotted trajectory.

Return type:

folium.folium.Map

ptrail.visualization.statViz module

This File contains static visualizations i.e the ones that do not require the use of ipywidgets.

Warning

The visualizations in this module are currently developed with a focus around the starkey.csv data as it has been developed as a side project by the developers. It will further be integrated into the library as a general class of visualizers in the time to come. Some of the visualization types may or may not work with other datasets.

Authors: Yaksh J Haranwala
class ptrail.visualization.statViz.StatViz[source]

Bases: object

static trajectory_distance_treemap(dataset: PTRAILDataFrame, path: list)[source]

Plot a treemap of distance travelled by the moving object on a particular date.

Parameters:
  • dataset (PTRAILDataFrame) – The dataframe containing all the trajectory data.

  • map_date (str) – The date for which the TreeMap is to be plotted.

  • path (list) – The hierarchy of the treemap. This is passed directly into plotly’s Treemap API.

Returns:

Treemap depicting the distance travelled.

Return type:

plotly.graph_objects.Figure

Module contents