In alog 48378, when comparing the broadband + sweeps measurements (CALCS) to pyDARM (GDS), an overall 40-microsecond delay is required to get make the two results consistent with each other, which is not understood.
After step-by-step investigation and fixing a few bugs in the following two scripts, the 40-microsecond delay mystery is solved. Now by applying the R_GDS/R_CALCS corrections, the blue dots are corrected to green dots (see attachments). Details are documented in T1900169
Broadband: /ligo/svncommon/CalSVN/aligocalibration/trunk/Runs/O3/H1/Scripts/CALCS_FE/process_broadband_pcal_20190410.py
Sweep-sine: /ligo/svncommon/CalSVN/aligocalibration/trunk/Runs/O3/H1/Scripts/FullIFOSensingTFs/process_sweep_pcal2darm_20190410.py
The steps are: (see details in the scripts)
1) The delta_C and delta_A are obtained by using the following variables:
delta_C = sensProd.calcsResid2gdsInvSensOut
delta_A = actProd.calcs2gdsResidActFiltOut_NoDAQDownSample_removeCALCSdelay #The DAQ downsampling is not used in CALCS, so we do not include it
2) The delay between C and A in CALCS is not seen by GDS. So we need to correct it.
R_cor = (1/delta_C) * (1+C*A*D) / (1 + C*A*D / (delta_C * delta_A / delay_between_C_and_A))
When taking the 0410 measurements at LHO, a 7-cycle delay was installed. (not 9 cycles updated after processing the measurements).
Also we have fixed the script of computing relative delay between A and C (Scripts/CALCS_FE/compute_relativedelay_AvsC_20190404.py) Now the correct delay estimate for 0404 model is 7.7 cycles. (See attachment) We will install 8 cycles.
3) Apply dewhitening (from CS_DARM_DELTAL_EXTERNAL_WHITEN filter)
4) Apply the total PCAL correction sensProd.pcalCorrection
The comparison between the sweep-sine measurements and the uncertainty envelope is also updated (see attachment).
I have added the option of plotting PCAL to DARM measurements on top of the uncertainties in RRNom.py. The measurement data file needs to be specified. Other temporary scripts are removed from svn.
See examples in aligocalibration/trunk/Common/pyDARM/README