jjtobin / auto_selfcal

MIT License
17 stars 8 forks source link

Get multi-EB ephemeris selfcal working again #55

Closed psheehan closed 2 months ago

psheehan commented 2 months ago

When we started tracking sub-fields for mosaic selfcal, this broke ephemeris selfcal for multi-EB datasets because the sub-fields were identified based on phasecenter, and for an ephemeris target, the phase center is constantly changing. This was ok for a single EB dataset because it just used the phasecenter at the start of an observation, but for multi-EB datasets, this led to each EB having a different sub-field, which then caused problems down the line.

This PR gets selfcal working for multi-EB ephemeris targets again by pulling the phasecenter for each field from the FIELD table, specifically the PHASE_DIR column. For regular targets, this is just the RA/Dec phasecenter, but for ephemeris targets, this value is the offset from the ephemeris, and is therefore constant for all EBs. To make this work with mosaics, then, tclean_wrapper needs to grab the image center from the image header, and add the offsets to get the sub-fields.

I have tested this on both a mosaic ephemeris and regular ephemeris dataset and it is now working well for both.