py_eddy_tracker.dataset.grid.GridDataset¶
- class py_eddy_tracker.dataset.grid.GridDataset(filename, x_name, y_name, centered=None, indexs=None, unset=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
Methods
Add a grid in handler
Centered coordinates to bounds coordinates
Duplicate the variable from grid_in in grid_out
Compute eddy identification on the specified grid
Compute geostrophic speed around successive contours Returns the average
Give the grid required
Give the grid tiles required, without buffer system
Return the high-pass filtered grid, by substracting to the initial grid the low-pass filtered grid (default: order=1)
Check grid circularity
Load variable (data).
Load attrs to be stored in object
Return the low-pass filtered grid (default: order=1)
Get unit from variable
Write dataset output with same format as input
Attributes
Give bounds
Give True if pixel is described with its center’s position or a corner
- 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¶
- 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, 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
shape_error (float,int) – Maximal error allowed for outermost contour in %
sampling (int) – Number of points to store contours and speed profile
sampling_method (str) – Method to resample, ‘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
- filename¶
- static get_amplitude(contour, contour_height, data, anticyclonic_search=True, level=None, **kwargs)[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
- Returns
array asked, reduced by the indexes
- Return type
array
- 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
- 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)
- 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¶