image pixels that evalutate to +/- inf are now set to nan.
using np.isfinite() instead of data==data where appropriate