fronttracker.core.Front

Representation of an individual front.

Parameters

label : int Front identifier. pixels : int Number of pixels per front. longitude : array-like Longitudes of the front pixels. latitude : array-like Latitudes of the front pixels. gm : array-like Gradient magnitude values. epsx : float Maximum distance between two samples in longitude. epsy : float Maximum distance between two samples in latitude. nstd : float Number of standard deviations for ellipse estimation.

epsx instance-attribute

epsx = epsx

epsy instance-attribute

epsy = epsy

gm instance-attribute

gm = array(gm)

label instance-attribute

label = label

latitude instance-attribute

latitude = array(latitude)

longitude instance-attribute

longitude = array(longitude)

nstd instance-attribute

nstd = nstd

pixels instance-attribute

pixels = pixels

__init__

__init__(
    label, pixels, longitude, latitude, gm, epsx, epsy, nstd
)

_area

_area()

Compute the approximate area covered by the front in km².

_skeleton

_skeleton()

Build a skeletonized representation of the front from its pixel coordinates.

Attributes

skeleton : FrontSkeleton Object containing the skeleton grid and its geodesic length.

contouring

contouring(alpha=None)

Compute alpha-shape contour of the front.

Parameters

alpha : float, optional Alpha value for shape generation. If None, defaults to 1/epsx.

front_ellipse

front_ellipse()

Compute the ellipse parameters describing the front.

get_gm_description

get_gm_description(verbose=True)

Get descriptive statistics of the gradient magnitude.

Parameters

verbose : bool, default=True If True, print the description.

Returns

dict Dictionary with statistics (mean, std, min, percentiles, max).

get_greatest_distance

get_greatest_distance()

Compute the greatest geodesic distance between any two pixels using the convex hull of the front.

Returns

tuple (distance in km, coord1, coord2)

metrics

metrics()

Compute area, ellipse and skeleton metrics for the front.

rotate_front

rotate_front(angle=None)

Rotate the front around its ellipse center.

Parameters

angle : float, optional Rotation angle in degrees. Defaults to 0.