RadioAstronomySoftwareGroup / RadioAstronomySoftwareGroup/pyuvdata
MIRIAD reader doesn't act on changing "extra" variables
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 102
- Forks
- 35
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 14
Description
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)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in the read_miriad main loop, using default_miriad_variables, other_miriad_variables, check_variables, and the UVData extra_keywords attribute as the relevant entry points. Reproduce the behavior with the CARMA test file and examine how changing extra variables should be retained without the current slow loop. Done means changing extra-variable values are correctly represented in extra_keywords and the reader remains acceptably performant.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100