RadioAstronomySoftwareGroup / pyuvdata

A pythonic interface for radio astronomy interferometry data (uvfits, miriad, others)
https://pyuvdata.readthedocs.io/en/latest/index.html
BSD 2-Clause "Simplified" License
83 stars 26 forks source link

Handle 2 pi azimuth wrap arounds in `uvbeam._interp_az_za_rect_spline` #1033

Open aewallwi opened 3 years ago

aewallwi commented 3 years ago

The function for converting enu to az_za in vis_cpu (a standard HERA simulator method)

https://github.com/HERA-Team/vis_cpu/blob/b602819508dee05742014b99dfce363a57cc4ffd/src/vis_cpu/conversions.py#L10

which is used to produce azimuths to be interpolated by uvbeam

https://github.com/HERA-Team/vis_cpu/blob/b602819508dee05742014b99dfce363a57cc4ffd/src/vis_cpu/conversions.py#L286

outputs azimuths between -pi and pi.

Many uvbeam objects can be expected to only have positive azimuths (for example, cst beams only run from 0 to 2pi) and this raises the error in uvbeam at

https://github.com/RadioAstronomySoftwareGroup/pyuvdata/blob/4c66208245db29be8b9920434d6d48d23b29e367/pyuvdata/uvbeam/uvbeam.py#L1387

This could be avoided if uvbeam recognized negative azimuth values as being identical to positive azimuth values (mod 2 pi).

aewallwi commented 3 years ago

I've added a fix in vis_cpu for the specific problem that raised this

https://github.com/HERA-Team/vis_cpu/pull/17

but this should probably also be fixed in pyuvdata.