Skip to content

Commit 207de7c

Browse files
committed
Correction to identify rotation type
1 parent 5290549 commit 207de7c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/py_eddy_tracker/observations/observation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def observation_number(self):
208208

209209
@property
210210
def sign_legend(self):
211-
return "Cyclonic" if self.sign_type == -1 else "Anticyclonic"
211+
return "Cyclonic" if self.sign_type != 1 else "Anticyclonic"
212212

213213
@property
214214
def shape(self):
@@ -487,7 +487,6 @@ def load_from_zarr(cls, filename, raw_data=False, remove_vars=None, include_vars
487487
if eddies.sign_type == 0:
488488
logger.debug("File come from another algorithm of identification")
489489
eddies.sign_type = -1
490-
491490
return eddies
492491

493492
@classmethod
@@ -561,7 +560,8 @@ def load_from_netcdf(cls, filename, raw_data=False, remove_vars=None, include_va
561560
var_inv = VAR_DESCR_inv[variable]
562561
if var_inv == "type_cyc":
563562
eddies.sign_type = h_nc.variables[variable][0]
564-
eddies.sign_type = getattr(h_nc, "rotation_type", 0)
563+
if eddies.sign_type is None:
564+
eddies.sign_type = getattr(h_nc, "rotation_type", 0)
565565
if eddies.sign_type == 0:
566566
logger.debug("File come from another algorithm of identification")
567567
eddies.sign_type = -1

0 commit comments

Comments
 (0)