Skip to content

Replace any non-finite image values by zero before degridding

André Offringa requested to merge avoid-nans-when-beam-response-zero into master

Because the beam response might legitimately be (near) zero, it can happen that the model image is divided by zero. In those cases, the model image is likely undefined anyway, and changing their contribution does not affect the visibilities. In most cases, the model image will also be zero at those positions, but dividing zero by zero is still undefined. Hence, such values can be safely replaced by zero.

I've tested this on a VLA mosaicking observation, and this commit removes a lot of problems that I had when imaging this set. I temporarily added a debug statement that showed whether any non-finite values were found & replaced (not part of this commit), and indeed they were.

Merge request reports