py_eddy_tracker.dataset.grid.GridDataset

class py_eddy_tracker.dataset.grid.GridDataset(filename, x_name, y_name, centered=None, indexs=None, unset=False, nan_masking=False)[source]

Bases: object

Class for basic tools on NetCDF Grid

Parameters:
  • filename (str) – Filename to load

  • x_name (str) – Name of longitude coordinates

  • y_name (str) – Name of latitude coordinates

  • centered (bool,None) – Allow to know how coordinates could be used with pixel

  • indexs (dict) – A dictionary that sets indexes to use for non-coordinate dimensions

  • unset (bool) – Set to True to create an empty grid object without file

  • nan_masking (bool) – Set to True to replace data.mask with isnan method result

Methods

add_grid

Add a grid in handler

c_to_bounds

Centered coordinates to bounds coordinates

clean

copy

Duplicate the variable from grid_in in grid_out

eddy_identification

Compute eddy identification on the specified grid

get_amplitude

get_mask

get_uavg

Compute geostrophic speed around successive contours Returns the average

grid

Give the grid required

grid_tiles

Give the grid tiles required, without buffer system

high_filter

Return the high-pass filtered grid, by substracting to the initial grid the low-pass filtered grid (default: order=1)

is_circular

Check grid circularity

load

Load variable (data).

load_general_features

Load attrs to be stored in object

low_filter

Return the low-pass filtered grid (default: order=1)

populate

setup_coordinates

units

Get unit from variable

write

Write dataset output with same format as input

Attributes

x_c

y_c

x_bounds

y_bounds

centered

x_dim

y_dim

coordinates

filename

dimensions

indexs

variables_description

global_attrs

vars

contours

nan_mask

EARTH_RADIUS

GRAVITY

N

bounds

Give bounds

is_centered

Give True if pixel is described with its center's position or a corner

variables

EARTH_RADIUS = 6370997.0
GRAVITY = 9.807
N = 1
add_grid(varname, grid)[source]

Add a grid in handler

Parameters:
  • varname (str) – name of the future grid

  • grid (array) – grid array

property bounds

Give bounds

static c_to_bounds(c)[source]

Centered coordinates to bounds coordinates

Parameters:

c (array) – centered coordinates to translate

Returns:

bounds coordinates

centered
clean()[source]
contours
coordinates
copy(grid_in, grid_out)[source]

Duplicate the variable from grid_in in grid_out

Parameters:
  • grid_in

  • grid_out

dimensions
eddy_identification(grid_height, uname, vname, date, step=0.005, shape_error=55, presampling_multiplier=10, sampling=50, sampling_method='visvalingam', pixel_limit=None, precision=None, force_height_unit=None, force_speed_unit=None, **kwargs)[source]

Compute eddy identification on the specified grid

Parameters:
  • grid_height (str) – Grid name of Sea Surface Height

  • uname (str) – Grid name of u speed component

  • vname (str) – Grid name of v speed component

  • date (datetime.datetime) – Date to be stored in object to date data

  • step (float,int) – Height between two layers in m

  • shape_error (float,int) – Maximal error allowed for outermost contour in %

  • presampling_multiplier (int) – Evenly oversample the initial number of points in the contour by nb_pts x presampling_multiplier to fit circles

  • sampling (int) – Number of points to store contours and speed profile

  • sampling_method (str) – Method to resample the stored contours, ‘uniform’ or ‘visvalingam’

  • pixel_limit ((int,int),None) – Min and max number of pixels inside the inner and the outermost contour to be considered as an eddy

  • precision (float,None) – Truncate values at the defined precision in m

  • force_height_unit (str) – Unit used for height unit

  • force_speed_unit (str) – Unit used for speed unit

  • kwargs (dict) – Arguments given to amplitude (mle, nb_step_min, nb_step_to_be_mle). Look at py_eddy_tracker.eddy_feature.Amplitude() The amplitude threshold is given by step*nb_step_min

Returns:

Return a list of 2 elements: Anticyclones and Cyclones

Return type:

py_eddy_tracker.observations.observation.EddiesObservations

Eddy detection : Med

Eddy detection : Med

Eddy detection : Gulf stream

Eddy detection : Gulf stream

Eddy detection and filter

Eddy detection and filter

Eddy detection on SLA and ADT

Eddy detection on SLA and ADT

Eddy detection : Antartic Circumpolar Current

Eddy detection : Antartic Circumpolar Current

LAVD detection and geometric detection

LAVD detection and geometric detection

Collocating external data

Collocating external data
filename
static get_amplitude(contour, contour_height, data, anticyclonic_search=True, level=None, **kwargs)[source]
static get_mask(a)[source]
get_uavg(all_contours, centlon_e, centlat_e, original_contour, anticyclonic_search, level_start, pixel_min=3)[source]

Compute geostrophic speed around successive contours Returns the average

global_attrs
grid(varname, indexs=None)[source]

Give the grid required

Parameters:
  • varname (str) – Variable to get

  • indexs (dict,None) – If defined dict must have dimensions name as key

Returns:

array asked, reduced by the indexes

Return type:

array

Shape error gallery

Shape error gallery

Get mean of grid in each eddies

Get mean of grid in each eddies

Eddy detection : Med

Eddy detection : Med

Eddy detection : Gulf stream

Eddy detection : Gulf stream

Eddy detection and filter

Eddy detection and filter

Select pixel in eddies

Select pixel in eddies

LAVD experiment

LAVD experiment

Get Okubo Weis

Get Okubo Weis

Grid advection

Grid advection

FSLE experiment in med

FSLE experiment in med

LAVD detection and geometric detection

LAVD detection and geometric detection

Collocating external data

Collocating external data
grid_tiles(varname, slice_x, slice_y)[source]

Give the grid tiles required, without buffer system

high_filter(grid_name, w_cut, **kwargs)[source]

Return the high-pass filtered grid, by substracting to the initial grid the low-pass filtered grid (default: order=1)

Parameters:
  • grid_name – the name of the grid

  • w_cut (int,) – the half-power wavelength cutoff (km)

indexs
property is_centered

Give True if pixel is described with its center’s position or a corner

Returns:

True if centered

Return type:

bool

is_circular()[source]

Check grid circularity

load()[source]

Load variable (data). Get coordinates and setup coordinates function

load_general_features()[source]

Load attrs to be stored in object

low_filter(grid_name, w_cut, **kwargs)[source]

Return the low-pass filtered grid (default: order=1)

Parameters:
  • grid_name – the name of the grid

  • w_cut (int,) – the half-power wavelength cutoff (km)

nan_mask
populate()[source]
setup_coordinates()[source]
units(varname)[source]

Get unit from variable

property variables
variables_description
vars
write(filename)[source]

Write dataset output with same format as input

Parameters:

filename (str) – filename used to save the grid

x_bounds
x_c
x_dim
y_bounds
y_c
y_dim