pyuvdata icon indicating copy to clipboard operation
pyuvdata copied to clipboard

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

Open aewallwi opened this issue 4 years ago • 1 comments

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 avatar Jul 13 '21 21:07 aewallwi

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.

aewallwi avatar Jul 13 '21 21:07 aewallwi