Skip to content

Commit ffcade0

Browse files
committed
Add area of contour field on eddy detection
1 parent 50885c2 commit ffcade0

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

src/py_eddy_tracker/__init__.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,28 @@ def parse_args(self, *args, **kwargs):
235235
"the eddy and the SSH around the effective contour defining the eddy edge",
236236
),
237237
),
238+
speed_area=dict(
239+
attr_name="speed_area",
240+
nc_name="speed_area",
241+
nc_type="float32",
242+
nc_dims=("obs",),
243+
nc_attr=dict(
244+
long_name="Speed area",
245+
units="m^2",
246+
comment="Area enclosed by speed contour in m^2",
247+
),
248+
),
249+
effective_area=dict(
250+
attr_name="effective_area",
251+
nc_name="effective_area",
252+
nc_type="float32",
253+
nc_dims=("obs",),
254+
nc_attr=dict(
255+
long_name="Effective area",
256+
units="m^2",
257+
comment="Area enclosed by effective contour in m^2",
258+
),
259+
),
238260
speed_average=dict(
239261
attr_name="speed_average",
240262
scale_factor=0.0001,

src/py_eddy_tracker/dataset/grid.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -819,6 +819,12 @@ def eddy_identification(
819819
obs.obs["radius_e"] = eddy_radius_e
820820
obs.obs["shape_error_e"] = aerr_e
821821
obs.obs["shape_error_s"] = aerr_s
822+
obs.obs["speed_area"] = poly_area(
823+
*coordinates_to_local(*xy_s, lon0=centlon_s, lat0=centlat_s)
824+
)
825+
obs.obs["effective_area"] = poly_area(
826+
*coordinates_to_local(*xy_e, lon0=centlon_s, lat0=centlat_s)
827+
)
822828
obs.obs["lon"] = centlon_s
823829
obs.obs["lat"] = centlat_s
824830
obs.obs["lon_max"] = centlon_i

src/py_eddy_tracker/observations/observation.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ class EddiesObservations(object):
138138
"time",
139139
"shape_error_e",
140140
"shape_error_s",
141+
"speed_area",
142+
"effective_area",
141143
"nb_contour_selected",
142144
"num_point_e",
143145
"num_point_s",

0 commit comments

Comments
 (0)