Skip to content

Commit f5d27a7

Browse files
author
adelepoulle
committed
simplify call to collection_loop
1 parent cd23abb commit f5d27a7

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

src/py_eddy_tracker/property_functions.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -361,19 +361,11 @@ def _fit_circle_path(self):
361361
BasePath._fit_circle_path = _fit_circle_path
362362

363363

364-
def collection_loop(contours, grd, rtime, a_list_obj, c_list_obj,
364+
def collection_loop(contours, grd, rtime, eddy,
365365
x_i=None, c_s_xi=None):
366366
"""
367367
Loop over each collection of contours
368368
"""
369-
if a_list_obj is not None and c_list_obj is not None:
370-
raise Exception('Only one of this two parameters '
371-
'(a_list_obj, c_list_obj) must be defined')
372-
if a_list_obj is not None:
373-
eddy = a_list_obj
374-
if c_list_obj is not None:
375-
eddy = c_list_obj
376-
377369
if eddy.diagnostic_type not in ['Q', 'SLA']:
378370
raise Exception('Unknown Diagnostic : %s' % eddy.diagnostic_type)
379371

src/scripts/EddyIdentification

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -294,12 +294,10 @@ if __name__ == '__main__':
294294
# Now we loop over the CS collection
295295
if 'SLA' in DIAGNOSTIC_TYPE:
296296
logging.info("Anticyclonic research")
297-
A_EDDY = collection_loop(CONTOURS, SLA_GRD, grd_int_date,
298-
a_list_obj=A_EDDY, c_list_obj=None)
297+
A_EDDY = collection_loop(CONTOURS, SLA_GRD, grd_int_date, A_EDDY)
299298
# Note that C_CS is reverse order
300299
logging.info("Cyclonic research")
301-
C_EDDY = collection_loop(CONTOURS, SLA_GRD, grd_int_date,
302-
a_list_obj=None, c_list_obj=C_EDDY)
300+
C_EDDY = collection_loop(CONTOURS, SLA_GRD, grd_int_date, C_EDDY)
303301

304302
# clear the current axis
305303
CONT_AX.cla()

0 commit comments

Comments
 (0)