Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subtraction of summed model columns prior to flagging (feature request) #70

Open
IanHeywood opened this issue Sep 4, 2020 · 11 comments

Comments

@IanHeywood
Copy link
Collaborator

I think a useful feature would be to be able to pass column arithmetic to the -smc switch, similar to how CubiCal's model list and shadems operate.

For example, direction-dependent calibration scenarios where the model is partitioned into multiple columns require a lot of messing around in order to perform a flagging operation on the residual visibilities. Something like -smc MODEL_DATA+DIR1_DATA would get around this nicely.

Thanks.

@sjperkins
Copy link
Member

@IanHeywood It sounds like a good addition.

Could I interest you in putting together a PR based on this?

@IanHeywood
Copy link
Collaborator Author

I don't know when I would get the uninterrupted several-hour window that would be necessary for me to even begin to figure this out. The spirit is willing but the calendar is bleak.

@sjperkins
Copy link
Member

The spirit is willing but the calendar is bleak.

I think we're in similar straights. Let's see if my schedule clears up.

@IanHeywood
Copy link
Collaborator Author

It's very much an edge case use case so please don't go to any trouble with it.

@o-smirnov
Copy link

+1 from me.

@sjperkins
Copy link
Member

So at the moment we have --data-column and --subtract-model-column arguments.

I would propose that we remove the --substract-model-column argument and support expressions within the data column argument.

There would be two components to this:

  1. Extending the parsing of the --data-column argument (as done in shadems here). Therefore, the data column argument will have a fair amount flexibility. Lets say that it can just be one column or a binary expression containing two columns.
    i.e. -dc DATA or -dc DATA-MODEL_DATA or -dc DATA+DIR1
  2. Applying the expression on the columns here

/cc @bennahugo for comments on the proposed change

@bennahugo
Copy link
Collaborator

One could, but I would not deprecate the existing smc option to keep backwards compatibility in pipelines. Multi-model column processing is not quite a standard way of most data reductions unless you do dE calibration with a dft

@sjperkins
Copy link
Member

Ok, how about marking SMC for deprecation with a warning?

@bennahugo
Copy link
Collaborator

bennahugo commented Oct 26, 2020 via email

@bennahugo
Copy link
Collaborator

Actually what is even better is DATA / sum(MODELS). RFI typically stands out like a sore thumb

@sjperkins
Copy link
Member

Actually what is even better is DATA / sum(MODELS). RFI typically stands out like a sore thumb

Nice to have, but I think this would need AST parsing, rather than a simple regex for a binary operation.

To help narrow this down, what operators should be supported? A nice simple calculator subset is: +, -, /, *, (, ), for example. Could we do without explicit functions like sum? i.e. could DATA / (DIR1_DATA + DIR2_DATA + MODEL_DATA) work instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants