GNiklasch / GWO-glitch-visualization

Visualizing glitches (transient noise events) in strain data recorded by the LIGO and Virgo gravitational-wave observatories
GNU General Public License v3.0
0 stars 0 forks source link

Distorted output from the constant-Q transform from asymmetrically placed data #11

Closed GNiklasch closed 1 year ago

GNiklasch commented 1 year ago

Commit bebcf90 fixes an unexpected behaviour of gwpy.timeseries.TimeSeries.q_transform() when the start and end of the strain TimeSeries are at different distances from the start and end of the outseg to be plotted. (There may be an underlying dependency issue here. Conceivably no-one in the GWpy community has ever used the method like this before...)

The symptom was that features above a certain frequency were systematically displaced to the left (towards earlier times) by a number of milliseconds. The "cut" frequency varied with the requested Q-value: Working with 128 s of data at Q=5.66, it sat at about 220 Hz, rising proportionally when the Q-value was increased. Working with 512 s of data, it resided much lower (most everything was displaced).

The fix boils down to always pre-cropping the strain data to an interval symmetric around t0 before feeding them to the Q transform.

On the other hand, we really want to use as much padding around outseg as we can afford, in order to keep whitening artefacts under control and in order to have enough raw data to paint the lowest part of the image at high Q-values. 12 seconds of padding beyond the edges of outseg are not enough. We now aim for 20 seconds, resorting to less (we're only guaranteed to have 15.6 seconds by t_elbow_room) when we don't have that much, but keeping the padding symmetric.