Open fxzjshm opened 1 month ago
Hey @fxzjshm! I'll get an answer to the UVFITS question for you here in just a sec, but an immediate question for you: is there some reason why your outputting to UVFITS and importing that via importuvfits
rather than writing out a MeasurementSet (via UVData.write_ms
) from the get go? The importuvfits
has not always been, in my opinion, the most reliable of utilities, and of course is not something that we can fix directly (if it turns out that there's an underlying issue in it) since it's not part of the pyuvdata package.
I'm new to synthesis imaging and someone told me that MeasurementSet format isn't stable even between minor versions of CASA, so I decided to try UVFITS first..
Hi @fxzjshm, as Karto mentioned above, the importuvfits
utility in CASA is known to have some errors, specifically in that it does not always follow the AIPS memo on the UVFITS file convention. We do follow that memo pretty strictly and the memo is pretty clear on this front. Karto and others have done a bunch of testing on the write_ms
functionality and I think sticking to that is the safest approach.
We have done loopback tests using the importuvfits
CASA task and have identified several mistakes that the importuvfits
task makes, but weirdly this isn't one of the ones we've already identified. Thanks for letting us know about this. We'll try to do some testing on this on our end too and we should add some notes in our documentation about the various issues we've found with importuvfits
.
I'm converting some visibility from custom format to UVFITS/MeasurementSets and importing it to CASA. When using UVFITS as intermediate format (
write_uvfits
) and importing it using CASA taskimportuvfits
, antenna positions are not expected:When using MS (
write_ms
), results are expected:After some investigation I think it is related to https://github.com/RadioAstronomySoftwareGroup/pyuvdata/blob/d6e94366758480a31a062fa84632855701aeb521/pyuvdata/uvdata/uvfits.py#L810-L817
But it seems that in casacore, array XYZ and antenna XYZ are added without rotation (if not VLA): https://github.com/casacore/casacore/blob/bf9e411892b3816724eb11737cc32d12f86a6436/msfits/MSFits/MSFitsInput.cc#L2228
Also found a PR related to "modifications to uvfits AN read/write rules": https://github.com/casacore/casacore/pull/400
So is that rotation required/expected? What's best practice to set antenna locations if I want to convert a custom format into UVFITS?