From 72fb9e5001c3d4ea25885d3a2b2058713e3f1daa Mon Sep 17 00:00:00 2001
From: Lionel GUEZ <guez@lmd.ens.fr>
Date: Sat, 5 Jun 2021 01:28:12 +0200
Subject: [PATCH] Assume that the input has a single orientation

Assume that the input shapefile collection contains a single orientation.
---
 Inst_eddies/Analysis/distribution_function.py | 21 +++++++------------
 1 file changed, 7 insertions(+), 14 deletions(-)

diff --git a/Inst_eddies/Analysis/distribution_function.py b/Inst_eddies/Analysis/distribution_function.py
index 3908e1c0..e571fd4b 100755
--- a/Inst_eddies/Analysis/distribution_function.py
+++ b/Inst_eddies/Analysis/distribution_function.py
@@ -56,8 +56,9 @@ def read(dirname):
                 amp_speed.append(rec_extr.ssh - rec_max.ssh)
 
     return {"speed": np.array(speed), "rad_outer": np.array(rad_outer),
-            "rad_speed": np.array(rad_speed), "amp_outer": np.array(amp_outer),
-            "amp_speed": np.array(amp_speed)}
+            "rad_speed": np.array(rad_speed),
+            "amp_outer": np.abs(np.array(amp_outer)),
+            "amp_speed": np.abs(np.array(amp_speed))}
 
 def fig_hist(xlabel, x, label):
     """Complete figure with histogram. x and label can also be sequences."""
@@ -111,21 +112,13 @@ def plot_all(dict_list, label = None):
 
     fig_hist("amplitude of outermost contour, in m",
              [d["amp_outer"] for d in dict_list], label)
-    fig_distr_funct("amplitude of outermost contour, anticyclones, in m",
-                    [d["amp_outer"][d["amp_outer"] >= 0] for d in dict_list],
-                    label)
-    fig_distr_funct("amplitude of outermost contour, cyclones, in m",
-                    [- d["amp_outer"][d["amp_outer"] < 0] for d in dict_list],
-                    label)
+    fig_distr_funct("amplitude of outermost contour, in m",
+                    [d["amp_outer"] for d in dict_list], label)
 
     fig_hist("amplitude of max-speed contour, in m",
              [d["amp_speed"] for d in dict_list], label)
-    fig_distr_funct("amplitude of max-speed contour, anticyclones, in m",
-                    [d["amp_speed"][d["amp_speed"] >= 0] for d in dict_list],
-                    label)
-    fig_distr_funct("amplitude of max-speed contour, cyclones, in m",
-                    [- d["amp_speed"][d["amp_speed"] < 0] for d in dict_list],
-                    label)
+    fig_distr_funct("amplitude of max-speed contour, in m",
+                    [d["amp_speed"] for d in dict_list], label)
     
 if __name__ == "__main__":
     import sys
-- 
GitLab