Package: divebomb
DivebombDivebomb is a python package that uses pandas to divide a timeseries of depths into individual dives. The dives are profiled as aDiveorDeepDivedepending on the animal. TheDiveclass is used for frequently surfacing animals, such as seals and whales. TheDeepDiveclass is used for  infrequently surfaceing animals, like sharks.The dive profiles are reduced to 8 dimensions using Principal Component Analsysis. Guassian Mixed Models are generated using theses variables
and the minimal Bayesian Information Criterion is used to determine the optimal number of clusters. The dives are split into the clusters using
Agglomerative Hierarchical Clustering (from sklearn). The dives are then display through iPython notebooks or saved to netCDF files organized by cluster.DocumentationThe official documentation is hosted on here:http://divebomb.readthedocs.io/en/latest/DiveADiveis then profiled with the following attributes:max_depth- the max depth in the divedive_start- the timestamp of the first point in the divedive_end- the timestamp of the last point in the divebottom_start- the timestamp of the first point in the dive when the animal is at depthtd_bottom_duration- a timedelta object containing the duration of the time the animal is at depth in secondstd_descent_duration- a timedelta object containing the duration of the time the animal is descending in secondstd_ascent_duration- a timedelta object containing the duration of the time the animal is ascending in secondstd_surface_duration- a timedelta object containing the duration of the time the animal is at the surface in secondsbottom_variance- the variance of the depth while the animal is at the bottom of the divedive_variance- the variance of the depth for the entire dive.descent_velocity- the average velocity of the descentascent_velocity- the average velocity of the descentpeaks- the number of peaks found in the dive profileleft_skew- a boolean of 1 or 0 indicating if the dive is left skewedright_skew- a boolean of 1 or 0 indicating if the dive is right skewedno_skew- a boolean of 1 or 0 indicating if the dive is not skewedDeepDiveADeepDiveis then profiled with the following attributes:max_depth- the max depth in the divemin_depth- the max depth in the divedive_start- the timestamp of the first point in the divedive_end- the timestamp of the last point in the divetd_total_duration- a timedelta (in seconds since 1970-01-01) containing the duration of the divedepth_variance- the variance of the depth for the entire dive.average_vertical_velocity- the mean velocity of the animal over the entire dive with negative value indicating upward movementaverage_descent_velocity- the average velocity of any downward movement as positive valueaverage_ascent_velocity- the average velocity of any upward movement as positive valuenumber_of_descent_transitions- the number of times and animal moves descends any distance in the dive periodnumber_of_ascent_transitions- the number of times and animal moves ascends any distance in the dive periodtotal_descent_distance_traveled- the total absolute distance in meters in which the anaimal moves downtotal_ascent_distance_traveled- the total absolute distance in meters in which the anaimal moves upoverall_change_in_depth- the difference between the minimum and maximum depth within the dive periodtd_time_at_depth- the duration in seconds at which the animal spends in the deepest part of the vertical movement (< 85% depth)td_time_pre_depth- the duration in seconds befor the deepest part of the vertical movement (< 85% depth)td_time_post_depth- the duration in seconds after the deepest part of the vertical movement (< 85% depth)peaks- the number of peaks found in the dive profileleft_skew- a boolean of 1 or 0 indicating if the dive is left skewedright_skew- a boolean of 1 or 0 indicating if the dive is right skewedno_skew- a boolean of 1 or 0 indicating if the dive is not skewedSurface ThresholdsA surface threshold is used for surfacing animals to define a depth window for what is considered to be at surface. Thesurface_thresholdargument defaults to0but can be changed in theprofile_dives()function. For examplesurface_threshold=2might be passed for animal that is~2meters long.surface_thresholdis always passed in meters.At Depth ThresholdsAn at depth threshold is used in bothe theDiveand theDeepDiveclass. Theat_depth_thresoldargument is a value between0and1that determines the window for when an animal is considered to be at bottom of its dive. The default value is0.15which means the bottom15%of the relative depth is considered to be at bottom.at_depth_thresoldis always as value between0and1expressing a percentage.SkewsA skew is defined as any difference one way or the other in descent or ascent times for theDiveclass and any difference in pre-depth or post-depth time for aDeepDive. This method was chosen as researchers found skew was most accurately represented when any difference between the values existed.TimestampsThe input timestamps are expected to be in a datetime format. The output timestamps are inseconds since 1970-01-01.
Every netCDF file has the time unit saved as an attribute as a reminder. All dive attributes that start withtd_are
a duration in seconds. Thetime,dive_start,dive_end, andbottom_startwill use the units mentioned above.
the netCDF4 library has anum2datefunction that will convert the values back to a datetime object.DivebombDivebomb is a python package that uses pandas to divide a timeseries of depths into individual dives. The dives are profiled as aDiveorDeepDivedepending on the animal. TheDiveclass is used for frequently surfacing animals, such as seals and whales. TheDeepDiveclass is used for  infrequently surfaceing animals, like sharks.The dive profiles are reduced to 8 dimensions using Principal Component Analsysis. Guassian Mixed Models are generated using theses variables
and the minimal Bayesian Information Criterion is used to determine the optimal number of clusters. The dives are split into the clusters using
Agglomerative Hierarchical Clustering (from sklearn). The dives are then display through iPython notebooks or saved to netCDF files organized by cluster.DiveADiveis then profiled with the following attributes:max_depth- the max depth in the divedive_start- the timestamp of the first point in the divedive_end- the timestamp of the last point in the divebottom_start- the timestamp of the first point in the dive when the animal is at depthtd_bottom_duration- a timedelta object containing the duration of the time the animal is at depth in secondstd_descent_duration- a timedelta object containing the duration of the time the animal is descending in secondstd_ascent_duration- a timedelta object containing the duration of the time the animal is ascending in secondstd_surface_duration- a timedelta object containing the duration of the time the animal is at the surface in secondsbottom_variance- the variance of the depth while the animal is at the bottom of the divedive_variance- the variance of the depth for the entire dive.descent_velocity- the average velocity of the descentascent_velocity- the average velocity of the descentpeaks- the number of peaks found in the dive profileleft_skew- a boolean of 1 or 0 indicating if the dive is left skewedright_skew- a boolean of 1 or 0 indicating if the dive is right skewedno_skew- a boolean of 1 or 0 indicating if the dive is not skewedDeepDiveADeepDiveis then profiled with the following attributes:max_depth- the max depth in the divemin_depth- the max depth in the divedive_start- the timestamp of the first point in the divedive_end- the timestamp of the last point in the divetd_total_duration- a timedelta (in seconds since 1970-01-01) containing the duration of the divedepth_variance- the variance of the depth for the entire dive.average_vertical_velocity- the mean velocity of the animal over the entire dive with negative value indicating upward movementaverage_descent_velocity- the average velocity of any downward movement as positive valueaverage_ascent_velocity- the average velocity of any upward movement as positive valuenumber_of_descent_transitions- the number of times and animal moves descends any distance in the dive periodnumber_of_ascent_transitions- the number of times and animal moves ascends any distance in the dive periodtotal_descent_distance_traveled- the total absolute distance in meters in which the anaimal moves downtotal_ascent_distance_traveled- the total absolute distance in meters in which the anaimal moves upoverall_change_in_depth- the difference between the minimum and maximum depth within the dive periodtd_time_at_depth- the duration in seconds at which the animal spends in the deepest part of the vertical movement (< 85% depth)td_time_pre_depth- the duration in seconds befor the deepest part of the vertical movement (< 85% depth)td_time_post_depth- the duration in seconds after the deepest part of the vertical movement (< 85% depth)peaks- the number of peaks found in the dive profileleft_skew- a boolean of 1 or 0 indicating if the dive is left skewedright_skew- a boolean of 1 or 0 indicating if the dive is right skewedno_skew- a boolean of 1 or 0 indicating if the dive is not skewedSurface ThresholdsA surface threshold is used for surfacing animals to define a depth window for what is considered to be at surface. Thesurface_thresholdargument defaults to0but can be changed in theprofile_dives()function. For examplesurface_threshold=2might be passed for animal that is~2meters long.surface_thresholdis always passed in meters.At Depth ThresholdsAn at depth threshold is used in bothe theDiveand theDeepDiveclass. Theat_depth_thresoldargument is a value between0and1that determines the window for when an animal is considered to be at bottom of its dive. The default value is0.15which means the bottom15%of the relative depth is considered to be at bottom.at_depth_thresoldis always as value between0and1expressing a percentage.SkewsA skew is defined as any difference one way or the other in descent or ascent times for theDiveclass and any difference in pre-depth or post-depth time for aDeepDive. This method was chosen as researchers found skew was most accurately represented when any difference between the values existed.TimestampsThe input timestamps are expected to be in a datetime format. The output timestamps are inseconds since 1970-01-01.
Every netCDF file has the time unit saved as an attribute as a reminder. All dive attributes that start withtd_are
a duration in seconds. Thetime,dive_start,dive_end, andbottom_startwill use the units mentioned above.
the netCDF4 library has anum2datefunction that will convert the values back to a datetime object.