analysis
index
/Users/samuelveliveli/Downloads/marine-tracker/src/analysis.py

Per-individual and per-study movement analysis.
 
Distance/speed/activity-pattern metrics work for any study in the common
event schema (see ingest.py). Dive metrics only apply to studies whose raw
data includes a depth/pressure sensor column -- none of this project's three
default studies are depth-instrumented (they're Argos/GPS location-only), so
dive_metrics() detects that and returns None rather than fabricating numbers.

 
Modules
       
numpy
pandas

 
Functions
       
activity_pattern(individual_df)
Fix count by hour-of-day (0-23, UTC as provided by Movebank), a simple activity proxy.
 
Not a true diel activity/dive-behavior classification -- just how the
fixes are distributed across the day, which can hint at surfacing
patterns if the tag only reports while at the surface.
dive_metrics(individual_df)
Dive/surface summary if the raw data includes a depth or pressure column, else None.
individual_summary(individual_df)
Total distance (km), average speed (km/h), and track span for one individual's fixes.
movement_corridor_bins(study_df, grid_size_deg=0.5)
Aggregate all individuals' fixes into a lat/lon grid for a movement-corridor density overlay.
 
Returns a DataFrame of (lat_bin, lon_bin, count), suitable for a heatmap
showing which areas the study's tracked individuals used most, as a
reasonable "movement corridor" proxy without fitting a formal utilization
distribution model.
study_summary(study_df)
Per-individual summary table for every individual in a study's DataFrame.

 
Data
        DEPTH_COLUMN_CANDIDATES = ['depth', 'pressure', 'argos:depth', 'eobs:pressure']