changeset 321:afaa7bcc730e draft

Uploaded
author luca_milaz
date Mon, 05 Aug 2024 13:10:37 +0000
parents fbda3a0cc8b1
children 2c9fd99b709c
files marea_2/flux_to_map.py
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/marea_2/flux_to_map.py	Mon Aug 05 13:05:27 2024 +0000
+++ b/marea_2/flux_to_map.py	Mon Aug 05 13:10:37 2024 +0000
@@ -904,8 +904,8 @@
     metabMap_median = copy.deepcopy(metabMap)
 
     # Compute medians and means
-    medians = {key: np.median(np.array(value), axis=1) for key, value in class_pat.items()}
-    means = {key: np.mean(np.array(value), axis=1) for key, value in class_pat.items()}
+    medians = {key: np.round(np.median(np.array(value), axis=1), 6) for key, value in class_pat.items()}
+    means = {key: np.round(np.mean(np.array(value), axis=1),6) for key, value in class_pat.items()}
 
     # Normalize medians and means
     max_flux_medians = max(np.max(np.abs(arr)) for arr in medians.values())
@@ -925,12 +925,12 @@
     for key in class_pat:
         # Create color mappings for median and mean
         colors_median = {
-            rxn_id: rgb_to_hex(cmap(abs(np.round(medians[key][i], 6)))) if medians[key][i] != 0 else '#bebebe'  #grey blocked
+            rxn_id: rgb_to_hex(cmap(abs(medians[key][i]))) if medians[key][i] != 0 else '#bebebe'  #grey blocked
             for i, rxn_id in enumerate(ids)
         }
 
         colors_mean = {
-            rxn_id: rgb_to_hex(cmap(abs(np.round(means[key][i], 6)))) if means[key][i] != 0 else '#bebebe'  #grey blocked
+            rxn_id: rgb_to_hex(cmap(abs(means[key][i]))) if means[key][i] != 0 else '#bebebe'  #grey blocked
             for i, rxn_id in enumerate(ids)
         }