Dive Class

The Dive class is used to encapsulate all the attributes of a dive and the data needed to reconstruct a plot of the dive. The at_depth_threshold defaults to 0.15 which means anything below 85% of the depth of the dive is considered to be at depth.

surface_threshold is used to determine how shallow the animal should be before it is considered to be at the surface. It defualts tp 0 but can be adjusted if the animal is large or you want a larger depth window for surface behaviours. surface_threshold should be passed in meters.

class Dive.Dive(data, columns={'depth': 'depth', 'time': 'time'}, surface_threshold=0, at_depth_threshold=0.15)
Variables:
  • max_depth – the max depth in the dive
  • dive_start – the timestamp of the first point in the dive
  • dive_end – the timestamp of the last point in the dive
  • bottom_start – the timestamp of the first point in the dive when the animal is at depth
  • td_bottom_duration – a timedelta object containing the duration of the time the animal is at depth in seconds
  • td_descent_duration – a timedelta object containing the duration of the time the animal is descending in seconds
  • td_ascent_duration – a timedelta object containing the duration of the time the animal is ascending in seconds
  • td_surface_duration – a timedelta object containing the duration of the time the animal is at the surface in seconds
  • bottom_variance – the variance of the depth while the animal is at the bottom of the dive
  • dive_variance – the variance of the depth for the entire dive.
  • descent_velocity – the average velocity of the descent
  • ascent_velocity – the average velocity of the ascent
  • peaks – the number of peaks found in the dive profile
  • left_skew – a boolean of 1 or 0 indicating if the dive is left skewed
  • right_skew – a boolean of 1 or 0 indicating if the dive is right skewed
  • no_skew – a boolean of 1 or 0 indicating if the dive is not skewed
  • insufficient_data – a boolean indicating whether or not the profile could be completed
get_ascent_duration(at_depth_threshold=0.15)

This function also sets the bottom duration.

Parameters:at_depth_threshold – a value from 0 - 1 indicating distance from the bottom of the dive at which the animal is considered to be at depth
Returns:the ascent duration in seconds
get_ascent_velocity()
Returns:the ascent velocity in m/s
get_descent_duration(at_depth_threshold=0.15)
Parameters:at_depth_threshold – a value from 0 - 1 indicating distance from the bottom of the dive at which the animal is considered to be at depth
Returns:the descent duration in seconds
get_descent_velocity()
Returns:the descent velocity in m/s
get_peaks(surface_threshold=0)
Returns:number of peaks found within a dive
get_surface_duration()
Returns:the surface duration in seconds
plot()
Returns:a plotly graph showing the phases of the dive
set_bottom_variance()

This function also set total dive variance

Returns:the standard variance in depth during the bottom portion of the dive in meters
set_dive_variance()
Returns:the standard variancet in depth during dive in meters
set_skew()

Sets the objects skew as left, right, or no skew

to_dict()
Returns:a dictionary of the dive profile