pyuvdata
pyuvdata copied to clipboard
Add option in UVData to exclude set of antennas
Currently, the UVData object has the functionality to select a set of antennas to keep, but often we have a set of antennas that are flagged and that we want to exclude. This is easy to work around with a few lines of code, but it would be simple and more efficient to have that as an option within UVData, either within the select method or as a separate method.
It would also be useful to have this functionality for UVCal.
@dstorer it looks like there's a branch allow_exclude_ants
that works toward this issue. Should that be made into a PR?
@dstorer apparently this is already possible with the ant_str option, using the minus sign. Also, did you start working on this already?
@bhazelton I didn't know you could do it with a minus sign, that would solve the problem! I had started working on it a long time ago on the allow_exclude_ants
branch but wound up letting it drop - if there's already functionality for it then we can probably just close this issue and delete that branch
The docs do not make this obvious, we should minimally update the docstring. There is a section on it in the tutorial but existing users may not look there.
Just a note on this: I tried using ant_str
and negative values to select out a set of antennas from a uvdata object, but it seems like doing it that way is incredibly slow. For context, trying to remove about 30 antennas from a uvdata object with ~2 minutes of data took almost 30 minutes. In comparison using antenna_nums
to specify which antennas to keep only takes a few seconds.
This isn't a big problem for me, but worth noting.