Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions src/py_eddy_tracker/observations/observation.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,8 @@ def __getitem__(self, attr: str):
return self.obs[attr]
elif attr in VAR_DESCR_inv:
return self.obs[VAR_DESCR_inv[attr]]
elif attr in ("lifetime", "age"):
return getattr(self, attr)
raise KeyError("%s unknown" % attr)

def __getattr__(self, attr):
Expand Down Expand Up @@ -1104,12 +1106,7 @@ def cost_function(records_in, records_out, distance):

def shifted_ellipsoid_degrees_mask(self, other, minor=1.5, major=1.5):
return shifted_ellipsoid_degrees_mask2(
self.lon,
self.lat,
other.lon,
other.lat,
minor,
major,
self.lon, self.lat, other.lon, other.lat, minor, major,
)

def fixed_ellipsoid_mask(
Expand Down
3 changes: 3 additions & 0 deletions tests/test_track.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,6 @@ def test_area_tracking_parameter():
c.to_netcdf(h)
c_reloaded = Correspondances.from_netcdf(h)
assert class_kw == c_reloaded.class_kw

# test access to the lifetime (item)
eddies_tracked["lifetime"]