Open anawas opened 3 months ago
Can you add a minimal repro?
This is not a bug. The observed behaviour is due to how the two imagers handle multi-channel images. For the OSKAR backend, the dirty image will always have intensities added across all frequency channels.
By default, the RASCIL Imager produces a 4D Image object, with shape corresponding to (frequency channels, polarisations, pixels_x, pixels_y). There is an image for each channel.
The parameter combine_across_frequencies
in the ImagerConfig is used to control how the imagers process multi-channel images. If set to True
, which is the default, then RASCIL adds up all channels and displays the summed flux. This is done in imager_rascil.py
on line 121:
if self.config.combine_across_frequencies is True:
image.header["NAXIS4"] = 1
assert image.data.ndim == 4
image.data = np.array([np.sum(image.data, axis=0)])
image.write_to_file(path=output_fits_path, overwrite=True)
If an image as 10 channels, then the flux in the RASCIL image will be 10 times higher. This is what we see when we compare the images.
The OSKAR Imager always produces one image by combining all frequency channels. Thus, this parameter has no influence here. It must be set to True, which it is by default.
I suggest to close this issue. If you need images that are equally scaled you set combine_across_frequencies=False
for RASCIL.
Summary
Dirty images created from Rascil and OSKAR are scaled differently. Rascil output pixel values that are 10x higher. We need to investigate where this comes from.
How to reproduce