ratt-ru / pfb-imaging

Preconditioned forward/backward clean algorithm
MIT License
6 stars 5 forks source link

Hi-Res Predict for Polarisation Images #51

Open Mulan-94 opened 2 years ago

Mulan-94 commented 2 years ago

@landmanbester @o-smirnov As per the discussion, we are in need of a high resolution predict for Stokes' I, Q, U, V. So far, pfb-clean is able to do this for Stokes' I, and predicts directly into the MS. My contribution hopefully, would be to implement for Q, U and V.

landmanbester commented 2 years ago

It should be pretty easy to modify the predict worker to do this if you pass in an image cube with the relevant wsums in the header. Internally I assume a WCS with four axes in the order [stokes, freq, l, m] which is reversed in the fits file. So, if you can somehow combine your wsclean output into a fits file like that we can simply loop over the stokes axis and use the convert function in africanus to go from Stokes to correlations. Hopefully I will have full polarisation clean working soon so you don't have to stack fits files. But I think @o-smirnov is working on fitstools' stack functionality, maybe he can help you hack something together. Not sure what the best way to do this is. Maybe we can label the wsums in the header 'WSUM{I/Q/U/V}{B}' where B is the band number at low frequency resolution?

landmanbester commented 2 years ago

You can have a look at the fits headers produced by the init worker here

https://github.com/ratt-ru/pfb-clean/blob/4220117ace23466f453f372bb46f9ab09efdfa97/pfb/workers/grid/init.py#L506

This defines the Stokes <-> index convention. I might just go ahead and put this in the predict myself so if you want to work on getting your wsclean outputs stacked correctly we could have this working pretty quickly

landmanbester commented 3 months ago

Just noting that this is what smops

https://pypi.org/project/smops/

is doing (in a somewhat roundabout way).

The universal model format we developed should allow doing this on the fly in QuartiCal. Full Pol not supported yet but getting there.