diff --git a/modules/util/util.py b/modules/util/util.py
index 423fc7c38f9f0628832bdc47804d150f63ef888e..2ee0baefaaeb688892ad53885ae83a2a8671cf65 100644
--- a/modules/util/util.py
+++ b/modules/util/util.py
@@ -142,6 +142,15 @@ def get_breaks(t, threshold):
     return idxs
 
 
+# return indexes of ts where value is within ts[i] - threshold < value < ts[i] + threshold
+def get_indexes_within_threshold(ts, value, threshold):
+    idx_s = []
+    for k, v in enumerate(ts):
+        if (ts[k] - threshold) < value < (ts[k] + threshold):
+            idx_s.append(k)
+    return idx_s
+
+
 def pressure_to_altitude(pres, temp, prof_pres, prof_temp, sfc_pres=None, sfc_temp=None, sfc_elev=0):
     if not np.all(np.diff(prof_pres) > 0):
         raise GenericException("target pressure profile must be monotonic increasing")