Skip to content

Commit 5001165

Browse files
committed
Correction to define type
1 parent d274496 commit 5001165

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

src/py_eddy_tracker/appli.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ def merge_eddies():
1212
args = parser.parse_args()
1313

1414
obs = TrackEddiesObservations.load_file(args.filename[0], raw_data=True, include_vars=args.include_var)
15-
obs = obs.add_rotation_type()
15+
if args.add_rotation_variable:
16+
obs = obs.add_rotation_type()
1617
for filename in args.filename[1:]:
1718
other = TrackEddiesObservations.load_file(filename, raw_data=True, include_vars=args.include_var)
18-
other = other.add_rotation_type()
19+
if args.add_rotation_variable:
20+
other = other.add_rotation_type()
1921
obs = obs.merge(other)
2022
obs.write_file(filename=args.out)
2123

src/py_eddy_tracker/observations/observation.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,11 @@ def load_from_netcdf(cls, filename, raw_data=False, remove_vars=None, include_va
568568
if var_inv == "type_cyc":
569569
eddies.sign_type = h_nc.variables[variable][0]
570570
if eddies.sign_type is None:
571-
eddies.sign_type = getattr(h_nc, "rotation_type", 0)
571+
title = getattr(h_nc, 'title', None)
572+
if title is None:
573+
eddies.sign_type = getattr(h_nc, "rotation_type", 0)
574+
else:
575+
eddies.sign_type = -1 if title == 'Cyclonic' else 1
572576
if eddies.sign_type == 0:
573577
logger.debug("File come from another algorithm of identification")
574578
eddies.sign_type = -1

src/scripts/EddyTracking

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ def usage():
123123

124124
if __name__ == '__main__':
125125
CONFIG, SAVE_STOP, CORRESPONDANCES_IN, CORRESPONDANCES_OUT, BLANK_PERIOD, ZARR, RAW = usage()
126-
print(RAW)
127126
# Create output directory
128127
SAVE_DIR = CONFIG['PATHS'].get('SAVE_DIR', None)
129128
if SAVE_DIR is not None and not exists(SAVE_DIR):

0 commit comments

Comments
 (0)