@@ -295,6 +295,14 @@ class GridDataset(object):
295
295
def __init__ (
296
296
self , filename , x_name , y_name , centered = None , indexs = None , unset = False
297
297
):
298
+ """
299
+ :param str filename: Filename to load
300
+ :param str x_name: Name of longitude coordinates
301
+ :param str y_name: Name of latitude coordinates
302
+ :param bool,None centered: Allow to know how coordinates could be used with pixel
303
+ :param dict indexs: A dictionary which set indexs to use for non-coordinate dimensions
304
+ :param bool unset: Set to True to create an empty grid object without file
305
+ """
298
306
self .dimensions = None
299
307
self .variables_description = None
300
308
self .global_attrs = None
@@ -457,11 +465,9 @@ def units(self, varname):
457
465
def copy (self , grid_in , grid_out ):
458
466
"""
459
467
Duplicate a variable
460
- Args:
461
- grid_in:
462
- grid_out:
463
468
464
- Returns:
469
+ :param grid_in:
470
+ :param grid_out:
465
471
466
472
"""
467
473
h_dict = self .variables_description [grid_in ]
@@ -580,19 +586,22 @@ def eddy_identification(
580
586
force_speed_unit = None ,
581
587
):
582
588
"""
583
-
584
- Args:
585
- grid_height:
586
- uname:
587
- vname:
588
- date:
589
- step: must be in meter (m)
590
- shape_error: must be in percent (%)
591
- sampling:
592
- pixel_limit:
593
- precision: must be in meter(m)
594
-
595
- Returns:
589
+ Compute eddy identification on specified grid
590
+
591
+ :param str grid_height: Grid name of height
592
+ :param str uname: Grid name of u speed component
593
+ :param str vname: Grid name of v speed component
594
+ :param datetime.datetime date: Date which will be store in object to date data
595
+ :param float,int step: Height between two layers in m
596
+ :param float,int shape_error: Maximal error allow for outter contour in %
597
+ :param int sampling: Sampling of contour and speed profile
598
+ :param (int,int),None pixel_limit: Min and max of pixel which must be inside inner and outer contour to be considered like an eddy
599
+ :param float,None precision: Truncate value at the defined precision in m
600
+ :param str force_height_unit: Unit to used for height unit
601
+ :param str force_speed_unit: Unit to used for speed unit
602
+
603
+ :return: Return a list of 2 elements: Anticyclone and Cyclone
604
+ :rtype: py_eddy_tracker.observations.observation.EddiesObservations
596
605
597
606
"""
598
607
if not isinstance (date , datetime ):
@@ -1752,16 +1761,19 @@ def display(self, ax, name, factor=1, **kwargs):
1752
1761
def interp (self , grid_name , lons , lats ):
1753
1762
"""
1754
1763
Compute z over lons, lats
1755
- Args:
1756
- grid_name: Grid which will be interp
1757
- lons: new x
1758
- lats: new y
1759
1764
1760
- Returns:
1761
- new z
1765
+ :param str grid_name: Grid which will be interp
1766
+ :param lons: new x
1767
+ :param lats: new y
1768
+
1769
+ :return: new z
1762
1770
"""
1763
1771
g = self .grid (grid_name )
1764
- return interp2d_geo (self .x_c , self .y_c , g , g .mask , lons , lats )
1772
+ if len (g .mask .shape ):
1773
+ m = g .mask
1774
+ else :
1775
+ m = ones (g .shape ) if g .mask else zeros (g .shape )
1776
+ return interp2d_geo (self .x_c , self .y_c , g , m , lons , lats )
1765
1777
1766
1778
1767
1779
@njit (cache = True , fastmath = True )
0 commit comments