API reference#
The API reference is automatically generated from the function docstrings in the ocetrac package. Refer to the examples in the sidebar for reference on how to use the functions.
SurfTrack#
Tracker#
|
End-to-end surface marine heatwave tracker. |
|
Execute the full pipeline: clean → filter → track → postprocess |
|
Binarise the input field, apply morphological close→open per (lat, lon) slice, then apply the ocean mask. |
|
Label 2-D slices, make IDs consecutive across time, wrap across the date line, then filter by area using: |
|
Label connected objects and wrap across the date line. |
|
Wrap the tracked array as an |
|
Number of unique tracked events in the final result. |
|
Return |
|
Print event count, duration distribution, and parameters. |
Measures — motion#
|
Calculates motion characteristics of labeled geospatial objects. |
Measures — shape#
|
Calculates shape characteristics of labeled geospatial objects. |
Measures — intensity#
|
Calculate intensity metrics from anomaly data. |
Measures — temporal#
|
Gets the duration of the time coordinate in an xarray object. |
|
Gets the initial detection time from an xarray object. |
Measures — plotting#
|
Plots the displacement of centroids over time on an intensity map. |
DeepTrack#
Tracker#
|
4-D event tracker |
|
Execute the full pipeline: clean → label → connect_depth → prefilter → track → postprocess |
|
Binarise and morphologically clean (close→open) the input field. |
|
Label each (t, z) slice with 2-D connected components, then apply longitude wrapping so objects that straddle the date line are merged before area filtering |
|
Area filter → relabel → 3-D depth connectivity. |
|
Drop globally smallest 3-D objects by voxel count. |
|
Containment-based temporal tracking with lineage preservation. |
|
Wrap tracked array as an xr.DataArray result. |
|
Number of unique tracked events in the final result. |
|
Return {event_id: n_timesteps_present} from the final result. |
|
Print event count, duration distribution, and parameters. |
Grid#
|
Convert depth midpoints to layer thicknesses via central differencing; forward/backward differencing at the boundaries. |
|
Compute a 3-D cell-volume array (z_t, nlat, nlon) for a POP-style grid. |
|
Build a (3, 3, 3) boolean structuring element for 3-D connected-component labelling. |
Core algorithms#
|
Connected-component labelling on each (t, z) slice independently. |
|
Remove small 2-D objects per depth level using an area distribution computed across ALL timesteps. |
|
Apply 3-D connected-component labelling across (z, nlat, nlon) for every timestep independently. |
|
Remove the smallest frac fraction of 3-D objects by total voxel count summed across ALL timesteps. |
|
Track objects across time using containment with lineage preservation. |