MWATelescope / mwa_hyperdrive

Calibration software for the Murchison Widefield Array (MWA) radio telescope
https://MWATelescope.github.io/mwa_hyperdrive
Mozilla Public License 2.0
98 stars 4 forks source link

Visibility flags are removed after 'solutions-apply' #21

Open physicistsam opened 1 year ago

physicistsam commented 1 year ago

I am new to this particular package, so my interpretation or usage could be wrong. Issue: The coarse channel flags, that have been applied using COTTER, exsits in the ms files before calibration using Hyperdrive. However, after I do 'solutions-apply' , the visibilities in those channels are being set to zero, which is acceptable, but the weights are being modified such that CASA figures that as unflagged (i.e. all the coarse channel flags do not exists any more, visibilities are set to zero in thoes channels). This is an issue if I perform UVSUB (after imaging with WSCLEAN) using CASA at a later stage, as the channels are now unflagged.

Maybe I am missing something here. If anyone can kindly comment on that, it would be helpful.

cjordan commented 1 year ago

Hi @physicistsam, I'm sorry you've encountered trouble with my software. I'll try to fix this very soon, but first, can you tell me:

  1. What version of hyperdrive you used,
  2. How you installed it, and
  3. The commands you used to produce the problematic data?

Cheers.

physicistsam commented 1 year ago

Dear @cjordan thanks for your prompt reply. As I have mentioned, I am very new to this and my interpretations could be very wrong, my apologies for that. 1) mwa_hyperdrive 0.2.1. 2) I did a cargo install from source. 3) Apply solution part is as follows:

Apply the solutions to the data

hyperdrive solutions-apply \ -d /dir_path/1159885312/1159885312.ms \ /dir_path/1159885312/1159885312.metafits \ -s /dir_path/1159885312/hyperdrivesolutions${num_source}.fits \ -o /dir_path/1159885312/1159885312_cal.ms

I should also clarify why I am raising this issue, I am attaching two CASA plots, red points show the flagged, green for unflagged. I am unable to find any flagged data in display when I plot the calibrated MS.

org_data cal_data

cjordan commented 1 year ago

Hi @physicistsam, thanks for providing the details. Indeed, I see the behaviour you describe, and it was not my intention to have this behaviour. However, I have fixed the behaviour in unreleased code; if you checkout the peel branch and compile with that, can you re-run your processing and see if that fixes things for you?

I am working on formally releasing this code, but there is a bit more to be done. But, knowing that users like you are encountering bugs on the stable version does keep me motivated!

physicistsam commented 1 year ago

@cjordan Thanks for the effort and clarification.

cjordan commented 1 year ago

Hi @physicistsam , I've (finally) released a new version of hyperdrive. This version should've fixed your issue, but would you be able to check this on your end, please?