matteolucchini1 / nDspec

A modular X-ray spectral-timing astronomy modelling package
MIT License
2 stars 0 forks source link

Ignore channels in response matrix #4

Open bjricketts opened 4 months ago

bjricketts commented 4 months ago

It would be useful to have a way of ignoring energy channels in response matrices for when convolving it with a model output with a smaller (but otherwise identical in terms of energy bins) energy grid than the complete response.

Either adjusting this to be a change to the response matrix itself or a response matrix can ignore channels as specified when a model is evaluated would work.

matteolucchini1 commented 2 months ago

For future reference, I should also a) do this for all operators, not just response matrices and b) allow the FourierProduct operator to ignore a range of frequencies

edit: also for future reference, the easiest way to implement this and not mess up plots might be with a mask of some sort, setting things to nan to make them disappear from 2d plots. Do this implementation in the Operator class, checking that we are passing and returning ndspec objects with an additional "mask" attribute.

bjricketts commented 1 week ago

I'm currently linking the active branch dev_response_utils with a somewhat stop gap solution to this for Response matrices. We should revise this to be in-line with the above suggestion eventually.

bjricketts commented 1 week ago

dev_response_utils has now implemented a ignore_channels method to the Response class. Currently, this returns a new Response object which retains channel indexes (e.g. [0,1,3,4,5] for a 6 channel energy grid where the 3rd channel is ignored). This might screw up plots as specified above:

edit: also for future reference, the easiest way to implement this and not mess up plots might be with a mask of some sort, setting things to nan to make them disappear from 2d plots. Do this implementation in the Operator class, checking that we are passing and returning ndspec objects with an additional "mask" attribute.