Closed kartographer closed 4 months ago
Yeah great catch. I can see why this happens. In the case where pyuvim creates the uvdata object, it has already set the uvws before calling run_uvdata_uvsim
to populate the data array. It already assumes the object has the desired uvws.
I stumbled upon an interesting feature when helping out a user who was running into an issue taking a
UVData
object from a prior observation, passing it through pyuvsim, and then writing out the result as an MS file (via theUVData.write_ms
method). Long story short, what we found was that when passing aUVData
object,run_uvdata_uvsim
does not use theuvw_array
values for calculating the interferometer response, favoring instead using the antenna positions to internally generate ENUs (and then calculating fringe response from there). This would be fine, except thatrun_uvdata_uvsim
does not appear to updateuvw_array
when it returns the object, which means that an object with incorrect uvw coordinates gets passed back.At a minimum it would be helpful to raise an error when the values in
uvw_array
are not consistent w/ the antenna position-based values, though I think a better solution would be to simply overwrite theuvw_array
values and wipe out any info on the phase centers (though I don't know the downstream ramifications of this, and figure this is a question for a more experienced dev/user to address). Happy to a write up a PR if someone wants to recommend which path to take.