From 90bc2a28f812e94fb5a22d8095627a219e630dd2 Mon Sep 17 00:00:00 2001 From: Lionel GUEZ <guez@lmd.ens.fr> Date: Fri, 7 Apr 2023 22:22:05 +0200 Subject: [PATCH] Polish --- Common/util_eddies.py | 7 +++++++ Inst_eddies/Documentation_texfol/documentation.tex | 8 ++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Common/util_eddies.py b/Common/util_eddies.py index 2dabadbf..734e1805 100644 --- a/Common/util_eddies.py +++ b/Common/util_eddies.py @@ -95,6 +95,11 @@ class SHPC_class: return self._n_dates[i_slice] def get_ishape_last(self, i_slice, orientation): + """Can return None if ishape_last.txt does not exist and cannot be + created. + + """ + if self._ishape_last[i_slice][orientation] is None: fname = path.join(self.dir, f"Slice_{i_slice}", orientation, "ishape_last.txt") @@ -140,6 +145,8 @@ class SHPC_class: return self._n_shapes[i_slice][orientation] def _create_ishape_last(self, i_slice, orientation): + """Can fail if it cannot get a reader.""" + last_date = self.d_init[i_slice] date_ishape = [] # list of tuples (date, ishape) reader = self.get_reader(i_slice, "extremum", orientation) diff --git a/Inst_eddies/Documentation_texfol/documentation.tex b/Inst_eddies/Documentation_texfol/documentation.tex index 39a9ae86..bae4f3bd 100644 --- a/Inst_eddies/Documentation_texfol/documentation.tex +++ b/Inst_eddies/Documentation_texfol/documentation.tex @@ -249,8 +249,12 @@ index of the array be a date present in the slice. We have : \begin{equation*} l(d) = \sum_{d' = d_0} ^d e_\mathrm{max}(d') - 1 \end{equation*} -$e_\mathrm{max}(d) = 0$ if $d$ is not in the slice. So the shape index -$i$ of the eddy with eddy index $e$ at date $d$ is: +$e_\mathrm{max}(d) = 0$ if $d$ is not in the slice. So, if; +\begin{equation*} + 1 \le e \le e_\mathrm{max}(d) +\end{equation*} +then the shape index $i$ of the eddy with eddy index $e$ at date $d$ +is: \begin{equation*} i = \begin{array}{|ll} -- GitLab