cta-observatory / ctapipe_io_lst

ctapipe IO plugin for LST prototype data

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

interpolation of spike A slices close to the edge of ROI

jsitarek opened this issue · comments

if 2 < spike_A_position < (N_SAMPLES - 2):

There are two small issues with this this code.

  1. it is only making interpolation, but sometimes you might need to extrapolate if the spike happens at the beginning of the readout window
  2. the interpolation might use the first slices that are later on excluded because they are too noise

For example if ROI size =40, and if the spike is expected to occur on position 'x' and 'x+1', the current code interpolates is if x=[3, 37] (both including
since we remove later on slices [0,2] and 39 I think it should work instead like this:
x=[0, 1] - the affected slices are either way excluded so we do not need to interpolate those - current code is ok
x=2 - we need to interpolate slices [2,3], the first one is going to be removed, but slice 3 should be set to value of slice 4 - difference to current behaviour
x=3 - we need to interpolate slices [3,4], the current code will intepolate it from slices 2 and 5, but 2 is noisy, so it might be better to extrapolate it and set 3 and 4 to 5 - difference to current behaviour
x=[4, 36] - interpolation from the neighbouring slices - current code is ok
x=37 - current code will interpolate slices 37 and 38 from 36 and 39,last of which is noisy, we should instead only use slice 36 and copy its value to slices 37 and 38 - difference to current behaviour
x=38 - need to interpolate 38 (and 39 that is removed) - current code does not do interpolation, but we should extrapolate and use the value from slide 37 in slice 38 difference to current behaviour
x=39 - need to interpolate only the last slice that is removed - current code is ok
@SeiyaNozaki any opinion on this?
@pawel21 can you have a look into making the implementation?

@jsitarek This all is rendered obsolete by switching to subtracting the height of spikes, which is anyway the preferred option of @SeiyaNozaki, right?

Another reason why subtraction is much simpler (and possibly more correct) than the interpolation approach.

Hi @maxnoe

Yes, I agree, but the spike subtraction is not implemented yet (the PR is handing since April), so if it takes long we might want to implement this fix as well. And either way, if the possibility of the spike interpolation stays in the code it should either have this fix, or at least explained this caveat in the code.

Spike subtraction is the default since quite some time, closing this