jjtobin / auto_selfcal

MIT License
17 stars 8 forks source link

Fix per spw imaging and weblog reporting of per-spw quantities now that spws are tracked per-EB #23

Closed psheehan closed 1 year ago

psheehan commented 1 year ago

When we made the change to track spw properties on a per-EB basis, this led to the per-SPW stats table in the weblog to no longer be rendered properly, as the information it was requesting was now under a vis layer. In fixing this, I also realized that per-spw imaging would no longer work, or really was never working correctly for cases where spws differed between EBs. This PR is to fix both issues, so now the weblog will render correctly and per-spw images will be done with the correct sets of spws.

As a note, as the PR currently stands, the code now creates a "spw_map" that maps the real spws in each EB to a virtual spw id that is 0-based. I.e. the virtual spw numbers have nothing to do with the original spw IDs. I did this because it was much simpler to do it this way. Nominally if there's a 1-to-1 mapping between the spws in all EBs, it is ok to just use a reference EB to set the virtual spws. But when there isn't that 1-to-1 mapping, it gets a little harder to determine how to do this properly, so I thought it was most straightforward to just start with 0 and count up.

That said, we did discuss that this could be confusing, so it may be worth reviewing a weblog to see if there's any additional information we could put in before we merge this.

Another note: I have tested that this works with check_all_spws=True and check_all_spws=False for ALMA data. We have hard-coded that check_all_spws=False for VLA data, and it works in that case. For good measure I'm overriding that check_all_spws=False to force it to make the per-spw images. That may take a while to run through, and given that the release will have that hard-coded False, we may not need to wait on that to actually merge.

psheehan commented 1 year ago

Ok, caught an error where the vislist/spw list wasn't getting passed to tclean properly when some EBs were missing spws and have now fixed this. I also added some additional details to the per-spw information table to make it easier to parse.

Not necessarily related to this PR, but I noticed that SPW matching for getting the SPWs to fit for uvcontsub didn't get the SPW matching updates that are on my main, so I merged those in here.

All my checks are done and this looks good to go now.