From 9c4502faddfb57ad15e31ed8e54832db7e6f8a7d Mon Sep 17 00:00:00 2001
From: Lionel GUEZ <guez@lmd.ens.fr>
Date: Tue, 9 Jul 2024 23:11:05 +0200
Subject: [PATCH] Define method `comp_ishape_n`

---
 Common/util_eddies.py | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/Common/util_eddies.py b/Common/util_eddies.py
index 13a97424..ed100e2d 100644
--- a/Common/util_eddies.py
+++ b/Common/util_eddies.py
@@ -260,6 +260,18 @@ class SHPC_class:
 
         return i_slice, ishape
 
+    def comp_ishape_n(self, node_index, e_overestim, orientation):
+        """Compute the location in the shapefiles, given the inter-date eddy
+        index: return `(i_slice, ishape)`.
+
+        Returns None if ishape_last is None or eddy_index is greater
+        than the maximum value.
+
+        """
+
+        date, eddy_index = node_to_date_eddy(node_index, e_overestim)
+        return self.comp_ishape(date, eddy_index, orientation)
+
     def ishape_range(self, date, orientation):
         """Returns an empty list if ishape_last was not found and could not be
         created.
-- 
GitLab