diff --git a/src/observations.cpp b/src/observations.cpp
index 00a140f972981c48582fa02e9df9207ca313f80d..cb43c9113feded557ab7f33552a1ca1c26407d27 100644
--- a/src/observations.cpp
+++ b/src/observations.cpp
@@ -311,13 +311,12 @@ std::set<int> Observations::filterByElevationSnr(const Azels& azels,
 {
     std::set<int> remove_sats;
 
-    //for (int obs_i = 0; obs_i < obs_.size(); obs_i++)
-    for (auto& azel_pair : azels)
+    for (auto&& sat_idx_pair : sat_2_idx_)
     {
-      const int& sat_number = azel_pair.first;
-      const double& elevation(azel_pair.second(1));
-      assert(hasSatellite(sat_number));
-      auto&& obs_sat = getObservationBySat(sat_number);
+      const int& sat_number = sat_idx_pair.first;
+      assert(azels.count(sat_number) && "azel missing for a satellite of this observation");
+      const double& elevation(azels.at(sat_number)(1));
+      auto&& obs_sat = getObservationByIdx(sat_idx_pair.second);
 
       // check elevation
       if (elevation < elmin)