Grid¶
-
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
-
EARTH_RADIUS
= 6370997.0¶
-
GRAVITY
= 9.807¶
-
N
= 1¶
-
bounds
¶ Give bound
-
centered
¶
-
contours
¶
-
coordinates
¶
-
dimensions
¶
-
eddy_identification
(grid_height, uname, vname, date, step=0.005, shape_error=55, sampling=50, pixel_limit=None, precision=None, force_height_unit=None, force_speed_unit=None)[source]¶ Compute eddy identification on specified grid
Parameters: - grid_height (str) – Grid name of height
- uname (str) – Grid name of u speed component
- vname (str) – Grid name of v speed component
- date (datetime.datetime) – Date which will be store in object to date data
- step (float,int) – Height between two layers in m
- shape_error (float,int) – Maximal error allow for outter contour in %
- sampling (int) – Sampling of contour and speed profile
- pixel_limit ((int,int),None) – Min and max of pixel which must be inside inner and outer contour to be considered like an eddy
- precision (float,None) – Truncate value at the defined precision in m
- force_height_unit (str) – Unit to used for height unit
- force_speed_unit (str) – Unit to used for speed unit
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, step=None)[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
¶
-
indexs
¶
-
interpolators
¶
-
is_centered
¶ Give information if pixel is describe with center position or a corner
-
speed_coef
¶
-
variables_description
¶
-
vars
¶
-
x_bounds
¶
-
x_c
¶
-
x_dim
¶
-
xinterp
¶
-
y_bounds
¶
-
y_c
¶
-
y_dim
¶
-
yinterp
¶
-
class
py_eddy_tracker.dataset.grid.
RegularGridDataset
(*args, **kwargs)[source]¶ Bases:
py_eddy_tracker.dataset.grid.GridDataset
Class only for regular grid
-
compute_pixel_path
(x0, y0, x1, y1)[source]¶ Give a series of index which describe the path between to position
-
convolve_filter_with_dynamic_kernel
(grid, kernel_func, lat_max=85, extend=False, **kwargs_func)[source]¶
-
interp
(grid_name, lons, lats)[source]¶ Compute z over lons, lats
Parameters: - grid_name (str) – Grid which will be interp
- lons – new x
- lats – new y
Returns: new z
-
kernel_lanczos
(lat, wave_length, order=1)[source]¶ Not really operational wave_length in km order must be int
-
speed_coef_mean
(contour)[source]¶ some nan can be compute over contour if we are near border, something to explore
-
x_size
¶
-
xstep
¶ Only for regular grid with no step variation
-
ystep
¶ Only for regular grid with no step variation
-
-
class
py_eddy_tracker.dataset.grid.
UnRegularGridDataset
(filename, x_name, y_name, centered=None, indexs=None, unset=False)[source]¶ Bases:
py_eddy_tracker.dataset.grid.GridDataset
Class which manage unregular 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
-
bounds
¶ Give bound
-
index_interp
¶
-
py_eddy_tracker.dataset.grid.
bbox_slice
¶
-
py_eddy_tracker.dataset.grid.
compute_pixel_path
[source]¶ Give a series of index which describe the path between to position
-
py_eddy_tracker.dataset.grid.
filter2D
(src, ddepth, kernel[, dst[, anchor[, delta[, borderType]]]]) → dst¶ . @brief Convolves an image with the kernel. . . The function applies an arbitrary linear filter to an image. In-place operation is supported. When . the aperture is partially outside the image, the function interpolates outlier pixel values . according to the specified border mode. . . The function does actually compute correlation, not the convolution: . . f[texttt{dst} (x,y) = sum _{ substack{0leq x’ < texttt{kernel.cols}\{0leq y’ < texttt{kernel.rows}}}} texttt{kernel} (x’,y’)* texttt{src} (x+x’- texttt{anchor.x} ,y+y’- texttt{anchor.y} )f] . . That is, the kernel is not mirrored around the anchor point. If you need a real convolution, flip . the kernel using #flip and set the new anchor to (kernel.cols - anchor.x - 1, kernel.rows - . anchor.y - 1). . . The function uses the DFT-based algorithm in case of sufficiently large kernels (~`11 x 11` or . larger) and the direct algorithm for small kernels. . . @param src input image. . @param dst output image of the same size and the same number of channels as src. . @param ddepth desired depth of the destination image, see @ref filter_depths “combinations” . @param kernel convolution kernel (or rather a correlation kernel), a single-channel floating point . matrix; if you want to apply different kernels to different channels, split the image into . separate color planes using split and process them individually. . @param anchor anchor of the kernel that indicates the relative position of a filtered point within . the kernel; the anchor should lie within the kernel; default value (-1,-1) means that the anchor . is at the kernel center. . @param delta optional value added to the filtered pixels before storing them in dst. . @param borderType pixel extrapolation method, see #BorderTypes. #BORDER_WRAP is not supported. . @sa sepFilter2D, dft, matchTemplate
-
py_eddy_tracker.dataset.grid.
lat
¶
-
py_eddy_tracker.dataset.grid.
lon
¶
-
py_eddy_tracker.dataset.grid.
mean_coordinates
¶
-
py_eddy_tracker.dataset.grid.
nb_pixel
¶
-
py_eddy_tracker.dataset.grid.
pixels_index
¶