[daip] [!6513]: AIPS - UVAVG fails to average dataset in time
Eskil Varenius
do-not-reply at nrao.edu
Wed May 6 05:15:05 EDT 2015
Eskil Varenius updated #6513
----------------------------
Status: Open (was: Closed)
UVAVG fails to average dataset in time
--------------------------------------
Ticket ID: 6513
URL: https://help.nrao.edu/staff/index.php?/Tickets/Ticket/View/6513
Thank you for this clarification. Indeed, there seem to be errors in the UVFITS-file that the coordinate system is left-handed. The UVFITS file was produced by converting from MeasurementSets producd by LOFAR. I was curious to know when this left-handedness was introduced. I performed some quick testing, by producing UVFITS files in two different ways: via casapy exportuvfits, and via the tool "ms2uvfits with option writesyscal=False". Checking the original ms with casapy task "listobs" it displays a right-handed system and also shows there is a non-zero array center. Everything seems fine, although I'm still waiting for answers from LOFAR people on why this non-zero array center is there.
The MS file I used, 2 min data on 3C295, is available here (6.6MB unzipped):
https://chalmersuniversity.box.com/s/j292i06odulvojdp337fpzn7sx0ffjsl
However, after writing UVFITS files, the coordinate system is now left-handed (I loaded the files in python to read the AN-table data with astropy). ms2uvfits and casapy exportuvfits both write left-handed systems. I guess ms2uvfits is made by ASTRON but using casacore in some way. Hence I wonder if these two errors are in fact the same error present in low-level code used by both? I guess this is a casapy issue, and I may file one in the future - first I want to check with ASTRON about this. But I thought I should included my investigations (attached below) for completeness.
Best regards,
Eskil
Conclusions:
- The original LOFAR MS from the LTA seems to have the correct antenna positions, listobs in CASAPY shows the absolute antenna positions as right handed (positive BY coordinates except for UK which is negative). However, the MS seems to include an "array center", which is close to the Earth's center but not exactly there. This is not a problem, but why is this so?
- MS2UVFITS will read the array center and antenna positions correctly from the ms, but then re-write the center to to the Earth's center in the UVFITS. Antenna positions are written correctly relative to this center, except for the fact that the coordinate system is left-handed (negative BY coordinates, except for UK which is positive).
- CASA exportuvfits will read the array center and coordinates correctly from the MS. Then, it will write UVFITS with this array center and relative coordinates, i.e. different from MS2UVFITS. The positions are correct, when accounting for the array center position, but casapy also seem to write a left-handed system.
- AIPS today seems to read correctly (converting to right-handed) both UVFITS, from casapy and ms2uvfits.
- AIPS before this update was reading the positions in the wrong way. From casapy, the coordinate system was left handed, but positions allright. For ms2uvfits, the positions also seem to be wrong (see below)
- Before fixing AIPS, it seems like positions from ms2uvfits were very wrong, and casapy were left-handed instead of right-handed.
SECTION: READING THE PURE VALUES FROM THE FITS FILES OUTSIDE AIPS USING ASTROPY
-------------------------------------------------------------------------------------------------------------
READING THE FILE PRODUCED BY CASA
f = pf.open('L206684_SB000_uv.dppp.CASAFITS')
an = f[2].data
anlist = an.tolist()
anlist[-2:]
[('SE607HBA', array([ 3370242.39319317, -712122.35532224, 5349952.17016128]), 54,
('UK608HBA', array([ 4008432.67719317, 100380.13467776, 4943677.87916128]), 55,
READING THE FILE PRODUCED BY MS2UVFITS
f = pf.open('L206684_SB000_uv.dppp.MS2UVFITS')
an = f[2].data
anlist = an.tolist()
anlist[-2:]
[('SE607HBA', array([ 3370271.657, -712125.881, 5349991.165]), 54,
('UK608HBA', array([ 4008461.941, 100376.609, 4943716.874]), 55,
-> CONCLUSION: The positions are a little different, but this is because the CASA-file is relative to
a non-zero array center while the ms2uvfits are absolute relative to earth's center. I don't know how to read
the center position in python, but it matches if read in AIPS.
-------------------------------------------------------------------------------------------------------------
SECTION: CHECKING WHAT LISTOBS SAYS FROM THE ORIGINAL MS
MS table antenna coords:
53 SE607HBALOFAR 2.6036 3.6760 6362989.6834 3370271.657000 712125.881000 5349991.165000
54 UK608HBALOFAR -4.2721 -1.6719 6365340.2760 4008461.941000 -100376.609000 4943716.874000
-> CONCLUSION: Listobs seems to show antennas in a right-handed coordinate system (the last three columns here).
So, either the MS is correct and listobs is correct OR the ms is left-handed but listobs displays it as right-handed.
-------------------------------------------------------------------------------------------------------------
SECTION: CHECKING WHAT AIPS DISPLAYS WITH PRTAN BEFORE APPLYING THE "FIX" BY ERIC GREISEN
USING AIPS 31DEC14, before fixing AIPS
OLD AN TABLE IN AIPS before AIPSFIX, from MS2UVFITS:
Array reference position in meters (Earth centered)
Array BX= 0.00000 BY= 0.00000 BZ= 0.00000
Ant 54 = SE607HBA BX= -442422.6769 BY= -305508.7180 BZ= 302922.2098
Ant 55 = UK608HBA BX= 94417.7347 BY= 577242.3836 BZ= -103352.0812
OLD AN TABLE IN AIPS before AIPS FIX, from CASAFITS:
Array reference position in meters (Earth centered)
Array BX= 29.26381 BY= 3.52568 BZ= 38.99484
Ant 54 = SE607HBA BX= 3370242.3932 BY= -712122.3553 BZ= 5349952.1702
Ant 55 = UK608HBA BX= 4008432.6772 BY= 100380.1347 BZ= 4943677.8792
-> CONCLUSIONS: Wrong positions! CASAPY seems to be closest to truth, but left-handed instaed of right-handed.
-------------------------------------------------------------------------------------------------------------
SECTION: CHECKING WHAT AIPS DISPLAYS WITH PRTAN AFTER APPLYING THE "FIX" BY ERIC GREISEN
USING AIPS 31DEC15 including new fix
NEW AN TABLE IN AIPS after AIPSFIX, from MS2UVFITS:
Array reference position in meters (Earth centered)
Array BX= 0.00000 BY= 0.00000 BZ= 0.00000
Ant 54 = SE607HBA BX= 3370271.6570 BY= 712125.8810 BZ= 5349991.1650
Ant 55 = UK608HBA BX= 4008461.9410 BY= -100376.6090 BZ= 4943716.8740
NEW AN table in AIPS, after AIPSFIX, from CASAFITS:
Array reference position in meters (Earth centered)
Array BX= 29.26381 BY= -3.52568 BZ= 38.99484
Ant 54 = SE607HBA BX= 3370242.3932 BY= 712122.3553 BZ= 5349952.1702
Ant 55 = UK608HBA BX= 4008432.6772 BY= -100380.1347 BZ= 4943677.8792
-> CONCLUSIONS: Correct positions! Note that casapy writes relative to a non-zero array center. But now the systems
are right-handed and also the MS2UVFITS coordinates are correct.
------------------------------------------------------
Staff CP: https://help.nrao.edu/staff
More information about the Daip
mailing list