Static frequency mask estimation from visibility data #381
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The overall goal of this PR is to implement a task to come up with a static RFI mask from visibility data directly, without having to rely on a hard-coded set of bad channels.
This produces a flagging metric by reducing over baselines using the existing
ReduceChisqcode as follows:Flagging is then done using a simple 1D MAD metric over the 1D median in time of the chisq metric. Only nighttime data is included in the median (the hook is implemented in a
ch_pipelinePR). It uses an updated version of thearPLSbaseline-fitting code, which is better able to handle the lack of hard-coded static mask.This PR does the following:
containers.group_tasksto be able to handle multiplesetupmethods. This is still a bit fragile, but it works.scale_invariant_rankoperation to be a bit faster (although I didn't use it in the end)MaskBaselinestask to mask polarisation and to optionally combine the mask using anandoperationReduceBasetask with a hook for custom weightspenalized_least_squaresimplementation to support different weighting schemes. This implementation is a bit of a hack, abusing the__new__class method to make it appear like a function, while still being able to subclass with custom hooks. I'm open to thoughts about how else to implement this.I think the commits should be fairly easy to follow.
This code all works and is tested - I just haven't been able to thoroughly test how well the method actually performs on a wide selection of days