Reports until 19:02, Sunday 19 November 2017
H1 CAL (CAL)
aaron.viets@LIGO.ORG - posted 19:02, Sunday 19 November 2017 - last comment - 11:27, Saturday 25 November 2017(39480)
gstlal calibration pipeline resampler fix for C02
I have added new features to the element lal_resample used in the gstlal calibration pipeline so that it can perform upsampling for the actuation equal in quality to the old gstreamer (version 1.4.5) resampler. The upgrade to gsteramer-1.10.4 on the clusters introduced a ~2% systematic error in the C01 frames from ~50 Hz to ~1 kHz during the month of August. See, e.g.,
https://ldas-jobs.ligo.caltech.edu/~alexander.urban/O2/calibration/C00_vs_C01/H1/day/20170802/

The change made was the addition of a sinc table filter in the upsampling routine. Several tests were done, and plots are attached:

The first two plots show the filter's response to a series of impulses separated by 4 seconds. This input data was upsampled from 128 Hz to 1024 Hz. The first of these plots shows 30 seconds of data, and the second is a close-up on a single impulse.
The 3rd plot is a 10-second sinusoid upsampled from 8192 Hz to 16384 Hz.
The 4th plot is a 30-second stream of ones upsampled from 128 Hz to 1024 Hz. The apparent thickness of the line indicates the amount of digital error, of order ~10^-8.
The 5th and 7th plots are ASD comparisons between the output produced by the calibration pipeline using this new resampler and the C00 frames from August.
The 6th and 8th plots are ASD comparisons between the output produced by the calibration pipeline using this new resampler and output pruduced with no resampling at all (i.e., all actuation was filtered at 16384 Hz). I suspect the wiggle above 1 kHz is due to a ~2% contribution from the actuation that is lost in downsampling to 2 kHz for the filtering.

For information on filters to be used for C02 production, see
https://alog.ligo-wa.caltech.edu/aLOG/index.php?callRep=39419
https://alog.ligo-la.caltech.edu/aLOG/index.php?callRep=36707
Images attached to this report
Comments related to this report
aaron.viets@LIGO.ORG - 11:27, Saturday 25 November 2017 (39519)
[Greg Mendell, Maddie Wade, Aaron Viets]

Greg's tests revealed problems with the new gstlal-calibration code that were not present in the old versions, producing error messages like:

*** Error in 'python': munmap_chunk(): invalid pointer:
0x00002babb1345780 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x7ab54)[0x2ba8010eab54] ...
...

I've found and fixed two bugs in the new resampler:
1) In certain places, a  pointer to the next output buffer being produced was being incremented (but not dereferenced) beyond the end of the allocated memory of that buffer.
2) There was a particular corner-case where a pointer to where input data from previous buffers was being temporarily stored was being shifted to an incorrect location.

After the fix, I ran the same tests, and they produced identical results. The only difference was that the jobs I found that produced errors no longer produced those errors.