This is an automated email from the ASF dual-hosted git repository.

rkk pushed a commit to branch tmp-stv
in repository https://gitbox.apache.org/repos/asf/sdap-nexus.git

commit 4d959ef33c60d67725a9e7e92f447ca47a6ee7ed
Author: rileykk <[email protected]>
AuthorDate: Tue Dec 5 12:57:57 2023 -0800

    SIGNIFICANT improvement of tomogram processing time
---
 analysis/webservice/algorithms/Tomogram.py | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/analysis/webservice/algorithms/Tomogram.py 
b/analysis/webservice/algorithms/Tomogram.py
index eb85281..37ddc85 100644
--- a/analysis/webservice/algorithms/Tomogram.py
+++ b/analysis/webservice/algorithms/Tomogram.py
@@ -162,15 +162,10 @@ class TomogramBaseClass(NexusCalcHandler):
             elevation = d['elevation']
             d_copy = dict(**d)
 
-            binned = False
+            a = np.argwhere(np.absolute(elevation_range - elevation) <= margin)
 
-            for e in elevation_range:
-                if abs(elevation - e) <= margin:
-                    d_copy['elevation'] = e
-                    binned = True
-                    break
-
-            if binned:
+            if a.shape[0] > 0:
+                d_copy['elevation'] = elevation_range[a[0][0]]
                 binned_subset.append(d_copy)
             else:
                 logger.warning(f'Could not bin point {d_copy}')

Reply via email to