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 to have basic tool 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 which set indexs 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
Centred coordinates to bounds coordinates
Duplicate the variable from grid_in in grid_out
Compute eddy identification on the specified grid
Calculate geostrophic speed around successive contours Returns the average
Give the grid required
Give the grid tiles required, without buffer system
Return the grid high-pass filtered, by substracting to the grid the low-pass filter (default: order=1)
Check grid circularity
Load variable (data).
Load attrs to be stored in object
Return the grid low-pass filtered (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]¶ Centred coordinates to bounds coordinates
- Parameters
c (array) – centred 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 which will be stored in object to date data
shape_error (float,int) – Maximal error allowed for outter 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 outer 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) – Argument given to amplitude
- Returns
Return a list of 2 elements: Anticyclone and Cyclone
- 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]¶ Calculate 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 grid high-pass filtered, by substracting to the grid the low-pass filter (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 grid low-pass filtered (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
¶