threshold finder does not complain for NaN's

An intermediate mask is added to replace the NaN’s with zeros during
the threshold finder, so that it does not give warnings