@@ -130,38 +130,6 @@ def strcompare(str1, str2):
130
130
return str1 in str2 and str2 in str1
131
131
132
132
133
- #def find_nearest_contour(contcoll, x, y):
134
- #"""
135
- #Finds contour that is closest to a point.
136
-
137
- #Returns a tuple containing the contour & segment.
138
-
139
- #Call signature::
140
-
141
- #segmin = find_nearest_contour(contcoll, x, y)
142
-
143
- #"""
144
- #dmin = 1e10
145
- #segmin = None
146
- #linepathmin = None
147
-
148
- #paths = contcoll.get_paths()
149
- #for segNum, linepath in enumerate(paths):
150
- #lc = linepath.vertices
151
- #ds = lc[:,0] - x
152
- #ds **= 2
153
- #dss = lc[:,1] - y
154
- #dss **= 2
155
- #ds += dss
156
- ##print 'ds', ds
157
- #d = ds.min()
158
- #if d < dmin:
159
- #dmin = d
160
- #segmin = segNum
161
- #linepathmin = linepath
162
- #return (segmin, linepathmin)
163
-
164
-
165
133
class Track (object ):
166
134
"""
167
135
Class that holds eddy tracks and related info
@@ -265,7 +233,6 @@ class TrackList (object):
265
233
old_lon, old_lat: old lon/lat centroids
266
234
index: index of eddy in track_list
267
235
"""
268
- #def __init__(self, DATATYPE, TRACK_DURATION_MIN, TRACK_EXTRA_VARIABLES):
269
236
def __init__ (self , DATATYPE , SIGN_TYPE , SAVE_DIR , grd , search_ellipse ,
270
237
** kwargs ):
271
238
"""
@@ -318,7 +285,6 @@ def __init__(self, DATATYPE, SIGN_TYPE, SAVE_DIR, grd, search_ellipse,
318
285
self .EVOLVE_AREA_MIN = np .float64 (kwargs .get ('EVOLVE_AREA_MIN' , 0.0005 ))
319
286
self .EVOLVE_AREA_MAX = np .float64 (kwargs .get ('EVOLVE_AREA_MAX' , 500 ))
320
287
321
-
322
288
self .AREA0 = np .pi * np .float64 (kwargs .get ('RAD0' , 60000. ))** 2
323
289
self .AMP0 = np .float64 (kwargs .get ('AMP0' , 2. ))
324
290
self .DIST0 = np .float64 (kwargs .get ('DIST0' , 25000. ))
@@ -370,10 +336,10 @@ def __init__(self, DATATYPE, SIGN_TYPE, SAVE_DIR, grd, search_ellipse,
370
336
self .old_contour_s = []
371
337
self .old_uavg_profile = []
372
338
self .old_shape_error = []
373
- self .new_list = True # flag indicating new list
374
- self .index = 0 # counter
375
- self .ncind = 0 # index to write to nc files, will increase and increase
376
- self .ch_index = 0 # index for Chelton style nc files
339
+ self .new_list = True # flag indicating new list
340
+ self .index = 0 # counter
341
+ self .ncind = 0 # index to write to nc files, will increase and increase
342
+ self .ch_index = 0 # index for Chelton style nc files
377
343
self .PAD = 2
378
344
self .search_ellipse = None
379
345
self .PIXEL_THRESHOLD = None
@@ -638,7 +604,6 @@ def create_netcdf(self, directory, savedir,
638
604
nc .variables ['cyc' ].long_name = 'cyclonic'
639
605
nc .variables ['cyc' ].description = 'cyclonic -1; anti-cyclonic +1'
640
606
641
-
642
607
#nc.variables['eddy_duration'].units = 'days'
643
608
nc .variables ['lon' ].units = 'deg. longitude'
644
609
nc .variables ['lon' ].min_val = self .LONMIN
@@ -686,7 +651,6 @@ def create_netcdf(self, directory, savedir,
686
651
nc .variables ['radius_e' ].long_name = 'effective radius scale'
687
652
nc .variables ['radius_e' ].description = 'effective eddy radius'
688
653
689
-
690
654
if 'Q' in self .DIAGNOSTIC_TYPE :
691
655
nc .variables ['qparameter' ].units = 's^{-2}'
692
656
@@ -842,13 +806,9 @@ def write2netcdf(self, rtime):
842
806
self .ch_index += 1
843
807
nc .sync ()
844
808
845
- #print 'eddy.ncind', self.ncind
846
-
847
809
# Get index to first currently active track
848
810
try :
849
811
lasti = self .get_active_tracks (rtime )[0 ]
850
- #print '__________________lasti', lasti
851
- #print '__________________rtime', rtime
852
812
except Exception :
853
813
lasti = None
854
814
@@ -862,7 +822,6 @@ def write2netcdf(self, rtime):
862
822
863
823
# Update old_lon and old_lat...
864
824
self .old_lon = self .new_lon [lasti :]
865
- #print '______________________self.old_lon', self.old_lon
866
825
self .old_lat = self .new_lat [lasti :]
867
826
self .old_radii_s = self .new_radii_s [lasti :]
868
827
self .old_radii_e = self .new_radii_e [lasti :]
0 commit comments