Skip to content

In uvd.check, UVW orientation can be flipped even if it leads to a discrepancy >1m #1632

@adeliegorce

Description

@adeliegorce

When reading a measurement set into a UVData object, the UVW orientation is wrong.

I am loading a measurement set with uvd.read_ms() and get the warning The uvw_array does not match the expected values given the antenna positions. The largest discrepancy is 224341.28399469642 meters [...].
224km is a large discrepancy. It turns out that the UVW orientation is wrong and should be flipped: once flipped, the discrepancy is "only" ~4m.

The reason the flip is not performed is that uvd.check() compares the uvd.uvw_array with the UVW computed from antenna positions (temp_obj.set_uvws_from_antenna_positions()) with an absolute tolerance of 1. If the condition is not satisfied, it tries flipping the convention (uvd.uvw_array *= (-1)) and re-does the comparison with an absolute tolerance of 1 (np.allclose(-temp_obj.uvw_array, self.uvw_array, atol=1). In my case, the max discrepancy after flipping is 4 which means the flip is not performed. However, the match would be better if the flip happened.

I would recommend checking which UVW orientation leads to the smallest discrepancy and apply it to the data, but still print the warning.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions