             (map #(for [[m n] % :while (bad-set n)] m)
                  [m-coll r-coll])))))
 
-(defn act-on-good
-  "apply function `func` to all non-nil values within a collection `coll`"
+(defn apply-to-valid
+  "apply function `f` to all valid (non-nil) values within a collection `coll`"
   [f coll]
   (f (filter (complement nil?) coll)))
 

  `neutralize-ends` will return the original time-series. `bad-set` is a set of
  `reli-coll` values that indicate unreliable pixels."
  [bad-set reli-coll val-coll]
  (let [avg (act-on-good u/coll-avg
                         (mask bad-set reli-coll val-coll))]
    (replace-index-set (bad-ends bad-set reli-coll)
                       avg

  "calculate a linear interpolation between `x1` and `x2` with the specified
  `length` between them."
  [x1 x2 length]
  (let [delta (/ (- x2 x1) length)]
    (vec
     (for [n (range length)]
       (float (+ x1 (* n delta)))))))
