pyuvdata
pyuvdata copied to clipboard
UVFlag clearing unused attributes is wonky
UVFlag currently implements a clear_unused_attributes function to try to get rid of old attributes that no long make sense when changing forms (e.g. going to waterfall, or antenna mode). Some issue with this function have been brought up in #948. I will summarize briefly here:
- Slowly bloating case statement is really highlighting the limitations we have imposed on ourselves with this function. Needs to be rethought.
- Possible solution A: During changes, just remove the attributes that don't make sense anymore. This would basically hard code it into each of the
to_???functions explicitly. - Possible solution B: Mirror the pyuvdata style of different file objects to handle the
to_???transitions. The subclass would then re-initialize a UVFlag object and retain all the optional keywords while removing the ones that don't make sense anymore.
Both of my ideas are very similar, B might be more work than it is worth, but we have to do something.
Considering how much it is used in INS, maybe @mwilensky768 has other ideas how we can clean this up.
We decided today option A is probably the most straight forward and easiest