Closed paoloserra closed 6 months ago
@gigjozsa
This is what I think is happening. Channels masked in at least 1 LOS of the cube are excluded from the polynomial fit of all LOS's. Only channels with no masked LOS's at all are included in the fit of each and every LOS. Those channels are used to build the independent variable of the fit x
mentioned in the error message above.
In the case of my error, all channels are masked in at least 1 LOS (but by no means in all LOS's), with the result that x
is empty.
I think this is not the desired behaviour. Each LOS should get its own x
. The fact that a channel is masked in a given LOS does not mean that it should be masked in all LOS's.
In fact, that's one of the main advantages of image-based continuum subtraction compared to UVLIN. A channel with line emission at x1,y1 should be excluded from the fit at x1,y1 but can be used at all other positions in the cube.
What do you think?
@gigjozsa kind reminder
I think it may be a problem of np.ma.polyfit as discussed here: https://github.com/numpy/numpy/issues/9193
Yep, agreed, which just means we need a different implementation altogether.
Will be implemented in stimela2
and in the next caracal
updates.
The error looks like this
@gigjozsa rings a bell?
Currently investigating the cause ...