pyuvdata
pyuvdata copied to clipboard
MIRIAD reader doesn't act on changing "extra" variables
There is a minor issue w/ the MIRIAD file reader, where so-called "extra" variables (i.e., those other than the explicitly listed/known variables found in default_miriad_variables
and other_miriad_variables
) in the MIRIAD file are only read once at the top of the file and assumed static, without verification that the values are not changing over the course of the track. This primarily seems to be an issue with the CARMA test file, which contains several values that are not part of the "standard" set of MIRIAD variables.
Note that the code below exists (as of v2.1.6) in the main loop of read_miriad
, where check_variables
carried forward the first instance of each of the values within extra_variables
to verify whether or not these values changed but a) this loop is incredibly slow, and b) the values within check_variables never get propagated forward into the extra_keywords
attribute of the UVData
object.
# check extra variables for changes compared with initial value
for extra_variable in list(check_variables.keys()):
if type(check_variables[extra_variable]) == str:
if uv[extra_variable] != check_variables[extra_variable]:
check_variables.pop(extra_variable)
else:
if not np.allclose(
uv[extra_variable], check_variables[extra_variable]
):
check_variables.pop(extra_variable)