Skip to content

Commit 88fa7f6

Browse files
committed
add lifetime as attribut (item)
1 parent 6620604 commit 88fa7f6

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/py_eddy_tracker/observations/observation.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,8 @@ def __getitem__(self, attr: str):
288288
return self.obs[attr]
289289
elif attr in VAR_DESCR_inv:
290290
return self.obs[VAR_DESCR_inv[attr]]
291+
elif attr in ("lifetime", "age"):
292+
return getattr(self, attr)
291293
raise KeyError("%s unknown" % attr)
292294

293295
def __getattr__(self, attr):
@@ -1104,12 +1106,7 @@ def cost_function(records_in, records_out, distance):
11041106

11051107
def shifted_ellipsoid_degrees_mask(self, other, minor=1.5, major=1.5):
11061108
return shifted_ellipsoid_degrees_mask2(
1107-
self.lon,
1108-
self.lat,
1109-
other.lon,
1110-
other.lat,
1111-
minor,
1112-
major,
1109+
self.lon, self.lat, other.lon, other.lat, minor, major,
11131110
)
11141111

11151112
def fixed_ellipsoid_mask(

0 commit comments

Comments
 (0)