py_eddy_tracker.eddy_feature.Contours

class py_eddy_tracker.eddy_feature.Contours(x, y, z, levels, wrap_x=False, keep_unclose=False)[source]

Bases: object

Class to calculate average geostrophic velocity along a contour, uavg, and return index to contour with maximum uavg within a series of closed contours.

Attributes:
contour:

A matplotlib contour object of high-pass filtered SSH

eddy:

A tracklist object holding the SSH data

grd:

A grid object

c_i : index to contours l_i : index to levels

Methods

check_closing

display

Display contour

find_wrapcut_path_and_join

get_index_nearest_path_bbox_contain_pt

Get index from the nearest path in the level, if the bbox of the path contain pt

get_next

iter

label_contour_unused_which_contain_eddies

Select contour containing several eddies

Attributes

contours

x_value

y_value

contour_index

level_index

x_min_per_contour

y_min_per_contour

x_max_per_contour

y_max_per_contour

nb_pt_per_contour

nb_contour_per_level

DELTA_PREC

DELTA_SUP

cvalues

levels

DELTA_PREC = 1e-10
DELTA_SUP = 0.01
check_closing(path)[source]
contour_index
contours
property cvalues
display(ax, step=1, only_used=False, only_unused=False, only_contain_eddies=False, display_criterion=False, field=None, bins=None, cmap='Spectral_r', **kwargs)[source]

Display contour

Parameters:
  • ax (matplotlib.axes.Axes) –

  • step (int) – display only contour every step

  • only_used (bool) – display only contour used in an eddy

  • only_unused (bool) – display only contour unused in an eddy

  • only_contain_eddies (bool) – display only contour which enclosed an eddiy

  • display_criterion (bool) –

    display only unused contour with criterion color

      • Accepted (green)

      • Reject for shape error (red)

      • Masked value in contour (blue)

      • Under or over pixel limit bound (black)

      • Amplitude criterion (yellow)

  • field (str) – Must be ‘shape_error’, ‘x’, ‘y’ or ‘radius’. If defined display_criterion is not use. bins argument must be defined

  • bins (array) – bins used to colorize contour

  • cmap (str) – Name of cmap for field display

  • kwargs (dict) – look at matplotlib.collections.LineCollection()

Eddy detection : Med

Eddy detection : Med

Eddy detection : Gulf stream

Eddy detection : Gulf stream

Eddy detection : Antartic Circumpolar Current

Eddy detection : Antartic Circumpolar Current
find_wrapcut_path_and_join(x0, x1)[source]
get_index_nearest_path_bbox_contain_pt(level, xpt, ypt)[source]

Get index from the nearest path in the level, if the bbox of the path contain pt

overhead of python is huge with numba, cython little bit best??

get_next(origin, paths_left, paths_right)[source]
iter(start=None, stop=None, step=None)[source]
label_contour_unused_which_contain_eddies(eddies)[source]

Select contour containing several eddies

level_index
property levels
nb_contour_per_level
nb_pt_per_contour
x_max_per_contour
x_min_per_contour
x_value
y_max_per_contour
y_min_per_contour
y_value