HERA-Team / aipy

Astronomical Interferometry in PYthon (AIPY)
http://pypi.python.org/pypi/aipy
Other
43 stars 29 forks source link

Wrong for parse_ants #4

Closed zuoshifan closed 7 years ago

zuoshifan commented 9 years ago

The help message for the ant option in scripting.py says it would include 12 for "(-0,1)(2,-3)":

Select ant_pol/baselines to include. Examples: all (all baselines) auto (of active baselines, only i=j) cross (only i!=j) 0,1,2 (any baseline involving listed ants) 0_2,03 (only listed baselines) "(0,1)(2,3)" (same as 0_2,0_3,1_2,23. Quotes help bash deal with parentheses) "(-0,1)(2,-3)" (exclude 0_2,0_3,1_3 include 1_2). Default is "cross". Select pol by adding appropriate x or y eg 5x_6y.

But function parse_ant gives the wrong result (515, 0, -1):

>>> import aipy as ap
>>> ap.scripting.parse_ants("(-0,1)_(2,-3)", 4)
[(259, 0, -1), (260, 0, -1), (515, 0, -1), (516, 0, -1)]
>>> ap.miriad.bl2ij(259)
(0, 2)
>>> ap.miriad.bl2ij(260)
(0, 3)
>>> ap.miriad.bl2ij(515)
(1, 2)
>>> ap.miriad.bl2ij(516)
(1, 3)
AaronParsons commented 7 years ago

Resolved this issue in commit 9f6685b.