MWATelescope / mwa_pb

MWA Primary Beam model code
MIT License
2 stars 8 forks source link

Incorrect Jones Matrices #9

Open johnsmorgan opened 4 years ago

johnsmorgan commented 4 years ago

The Jones matrices as currently generated are for Az/El beams, in the sense that the polarisation angle is defined relative to the zenith. In order that observations taken at different Hour Angles can be combined together with coherent polarisation angles, it is necessary that these are rotated into a coordinate system which is constant with time (e.g. equatorial J2000).

I have corrected this issue in my own code: https://github.com/johnsmorgan/mwa_pb_lookup

and the relevant commit is here: https://github.com/johnsmorgan/mwa_pb_lookup/commit/b011ef6aa4b655e18af0bf9dad00c8b88816bffd

Note that in applying this correction and checking for consistency with the RTS, we also discovered a sign error in the Jones matrices. So in summary, if J is the current Jones matrix, the correct Jones matrix, J' is given by:

J' = -P*-J

where P is the rotation matrix: [[cos(phi), -sin(phi)], [sin(phi), cos(phi)]]

where phi is the Parallactic Angle: https://en.wikipedia.org/wiki/Parallactic_angle

Most conveniently given by

def azalt_to_pa(az, alt, lat=np.radians(LAT)):
    """
    calculate parallactic angle from arbitrary azimuth and elevation
    """
    return -np.arctan2(np.sin(az)*np.cos(lat),
              np.cos(alt)*np.sin(lat) - np.sin(alt)*np.cos(lat)*np.cos(az))

where az is the azimuth, alt is the elevation angle above the horizon, and lat is the geographical latitude of the observer.

See the commit referenced above for one python implementation

johnsmorgan commented 4 years ago

Note that an additional advantage of fixing this bug is that the Az/El Jones matrices have a discontinuity at zenith. For example, this is the real part of the the first element of the Jones Matrix across the field of view for a near-zenith pointing.

xxr

This causes issues if the Az/El Jones matrices are later interpolated (unless the grid has very high resolution in the azimuth direction close to the Zenith). After the PA correction is applied, this discontinuity goes away (or is at least replaced by a discontinuity at the South Celestial Pole, which will generally be less of an issue). So for best results, this correction should be applied before interpolation.