Differences between revisions 1 and 2
Revision 1 as of 2018-08-07 04:44:23
Size: 322
Comment:
Revision 2 as of 2018-08-07 18:31:17
Size: 6716
Comment:
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:
 * [[KAGRA/Subgroups/CAL/GstLAL/tutorials/step6|Step 6: Make FIR filters and save into a npz file]]
 * [[KAGRA/Subgroups/CAL/GstLAL/tutorials/step8|Step 8: Check the transfer function of FIR filters]]
 * For the initialization and running the pipeline, please refer [[KAGRA/Subgroups/CAL/GstLAL/tutorials/step1|step1]]
 * Access frame cache file by specifying frame_cache and instrument as in [[KAGRA/Subgroups/CAL/GstLAL/tutorials/step2|step2]]
 * Define a frame multiplexer(mux) to write channels into a frame as in [[KAGRA/Subgroups/CAL/GstLAL/tutorials/step3|step3]]
 * Prepare for a filter file (filt.npz) following [[KAGRA/Subgroups/CAL/GstLAL/tutorials/step6|step6]]
 * Here is the part to load the filters
{{{#!python
fd = numpy.load('filt.npz')
afilt = fd['a']
cfilt = fd['c']
adelay = fd['dla'] # 16384
cdelay = fd['dlc'] # 4096

alatency = adelay/sample_rate
clatency = cdelay/sample_rate
latency = numpy.amax([alatency, clatency])

output_start = int(gps_start_time+latency)
}}}
 * Here is the part to apply Actuation(A) and inverse-sensing(C) FIR filters on MICH_OUT(Ctrl signal) and MICH_IN(Error signal), respectively
{{{#!python
mco = pp.mktee(pipeline, pipe_dict["MOU"])
mci = pp.mktee(pipeline, pipe_dict["MIN"])
pipe_dict["MOU"] = mco
pipe_dict["MIN"] = mci

afl = pp.mkfirbank(pipeline, mco, latency = int(adelay), fir_matrix = [afilt[::-1]], time_domain = td)
cfl = pp.mkfirbank(pipeline, mci, latency = int(cdelay), fir_matrix = [cfilt[::-1]], time_domain = td)
}}}
 * Here is the part to add two channels (DELTA_TM and RESIDUAL) to produce strain (C01) and add (MICH_IN1/C and MICH_OUT*A) to produce strain (C02)
{{{#!python
afl = pp.mktee(pipeline, afl)
cfl = pp.mktee(pipeline, cfl)
dtm = pp.mktee(pipeline, pipe_dict["DTM"])
res = pp.mktee(pipeline, pipe_dict["RES"])

c01 = cp.mkadder(pipeline, cp.list_srcs(pipeline, [dtm, short_queue],\
                                                  [res, long_queue]))
c02 = cp.mkadder(pipeline, cp.list_srcs(pipeline, [afl, short_queue],\
                                                  [cfl, long_queue]))
c01 = pp.mkaudioamplify(pipeline, c01, 1./arm_length)
c02 = pp.mkaudioamplify(pipeline, c02, 1./arm_length)
}}}
 * The python script is available at git repository
{{{
> kagra-cal/Observation/Phase1/tutorials/filt --help
Usage: filt [options]

Options:
  -h, --help show this help message and exit
  --cache=cache Set the name of the LAL cache listing the frame files
  --gps-start-time=seconds
                        Set the start time of the segment to analyze in GPS
                        seconds.
  --gps-end-time=seconds
                        Set the end time of the segment to analyze in GPS
                        seconds.
  --ifo=name Name of the IFO (default= K1)
  --channel=name Set channel names for MICH_IN1,MICH_OUT,MICH_RESIDUAL,
                        MICH_DELTA_TM,C00_STRAIN (default= LSC-MICH1_IN1_DQ
                        ,LSC-MICH1_OUT_DQ,CAL-CS_PROC_MICH_RESIDUAL_DQ,CAL-
                        CS_PROC_MICH_DELTA_TM_DQ,CAL-CS_PROC_C00_STRAIN_DQ)
  --frame-type=name Set the frame type as input to the frame writing
                        element. (Default=TEST)
  --output-path=name Set the output path for writing frame files.
                        (Default=.)
  --format=format Set input channel(s) format (default= F64LE)
  --ch-rate=rate Set input channel data rate (default= 16384)
  --frame-duration=seconds
                        Set the number of seconds for each frame. (Default =4)
}}}
 * Here is an example to produce C01 and 02 from DELTA_TM+RESIDUAL and (MICH_IN1/C)+(MICH_OUT*A), respectively
 * Frame duration is set short because the first frame should be skipped because of the latency of applying FIR filter
 * It should be OK to ignore the warnings
{{{
> kagra-cal/Observation/Phase1/tutorials/filt --cache=k1.cache GPS: 1209288320 1209288352
[('K1', 'LSC-MICH1_IN1_DQ'), ('K1', 'LSC-MICH1_OUT_DQ'), ('K1', 'CAL-CS_PROC_MICH_RESIDUAL_DQ'), ('K1', 'CAL-CS_PROC_MICH_DELTA_TM_DQ'), ('K1', 'CAL-CS_PROC_C00_STRAIN_DQ')]
delay= 16384.0 4096.0 output_start= 1209288321
seeking GPS start and stop times ...
setting pipeline state to playing ...
set to playing successfully
running pipeline ...
progress_src_MOU (00:00:05): 1209288320 seconds

(python:15041): GStreamer-WARNING **: gstpad.c:5079:store_sticky_event:<framecppchannelmux0:src> Sticky event misordering, got 'segment' before 'stream-start'

(python:15041): GStreamer-WARNING **: gstpad.c:5079:store_sticky_event:<progress_sink_K1:src> Sticky event misordering, got 'segment' before 'stream-start'

(python:15041): GStreamer-WARNING **: gstpad.c:5079:store_sticky_event:<sink:proxypad0> Sticky event misordering, got 'segment' before 'stream-start'

(python:15041): GStreamer-WARNING **: gstpad.c:5079:store_sticky_event:<multifilesink:sink> Sticky event misordering, got 'segment' before 'stream-start'

(python:15041): GStreamer-WARNING **: gstpad.c:5079:store_sticky_event:<framecppfilesink0:sink> Sticky event misordering, got 'segment' before 'stream-start'

(python:15041): GStreamer-WARNING **: gstpad.c:5079:store_sticky_event:<progress_sink_K1:sink> Sticky event misordering, got 'segment' before 'stream-start'
progress_src_C00 (00:00:21): 1209288320 seconds
progress_src_DTM (00:00:21): 1209288320 seconds
progress_src_RES (00:00:21): 1209288320 seconds
progress_src_MIN (00:00:21): 1209288352 / 32 seconds (3779026100.0 %)
progress_src_MOU (00:00:21): 1209288352 / 32 seconds (3779026100.0 %)
progress_src_C00 (00:00:21): 1209288352 / 32 seconds (3779026100.0 %)
progress_src_DTM (00:00:21): 1209288352 / 32 seconds (3779026100.0 %)
progress_src_RES (00:00:21): 1209288352 / 32 seconds (3779026100.0 %)
progress_sink_K1 (00:00:25): 1209288324 seconds
progress_sink_K1 (00:00:31): 1209288336 seconds
progress_sink_K1 (00:00:36): 1209288348 seconds
progress_sink_K1 (00:00:36): 1209288352 / 32 seconds (3779026100.0 %)
}}}
 * Check the contents of the output frame files
{{{
$LAL_PREFIX/bin/framecpp_query --list proc K-TEST-1209288324-4.gwf
Frame Version: 8 Frame Library: frameCPP Library Revision: 1 Originator: IGWD
Frame Offset: 0
K1:CALIB_AFL
K1:CALIB_C00
K1:CALIB_C01
K1:CALIB_C02
K1:CALIB_CFL
K1:CALIB_DTM
K1:CALIB_MIN
K1:CALIB_MOU
K1:CALIB_RES
}}}
 * [[KAGRA/Subgroups/CAL/GstLAL/tutorials/step8|(Next) Step 8: Check the transfer function of FIR filters]]
 * [[KAGRA/Subgroups/CAL/GstLAL/tutorials/step6|(Prev) Step 6: Make FIR filters and save into a npz file]]

Step 7: Apply FIR filters and make a strain frame file

  • For the initialization and running the pipeline, please refer step1

  • Access frame cache file by specifying frame_cache and instrument as in step2

  • Define a frame multiplexer(mux) to write channels into a frame as in step3

  • Prepare for a filter file (filt.npz) following step6

  • Here is the part to load the filters

   1 fd = numpy.load('filt.npz')
   2 afilt  = fd['a']
   3 cfilt  = fd['c']
   4 adelay = fd['dla']  # 16384                                                     
   5 cdelay = fd['dlc']  #  4096                                                     
   6 
   7 alatency = adelay/sample_rate
   8 clatency = cdelay/sample_rate
   9 latency  = numpy.amax([alatency, clatency])
  10 
  11 output_start   = int(gps_start_time+latency)
  • Here is the part to apply Actuation(A) and inverse-sensing(C) FIR filters on MICH_OUT(Ctrl signal) and MICH_IN(Error signal), respectively

   1 mco = pp.mktee(pipeline, pipe_dict["MOU"])
   2 mci = pp.mktee(pipeline, pipe_dict["MIN"])
   3 pipe_dict["MOU"] = mco
   4 pipe_dict["MIN"] = mci
   5 
   6 afl = pp.mkfirbank(pipeline, mco, latency = int(adelay), fir_matrix = [afilt[::-1]], time_domain = td)
   7 cfl = pp.mkfirbank(pipeline, mci, latency = int(cdelay), fir_matrix = [cfilt[::-1]], time_domain = td)
  • Here is the part to add two channels (DELTA_TM and RESIDUAL) to produce strain (C01) and add (MICH_IN1/C and MICH_OUT*A) to produce strain (C02)

   1 afl = pp.mktee(pipeline, afl)
   2 cfl = pp.mktee(pipeline, cfl)
   3 dtm = pp.mktee(pipeline, pipe_dict["DTM"])
   4 res = pp.mktee(pipeline, pipe_dict["RES"])
   5 
   6 c01 = cp.mkadder(pipeline, cp.list_srcs(pipeline, [dtm, short_queue],\
   7                                                   [res,  long_queue]))
   8 c02 = cp.mkadder(pipeline, cp.list_srcs(pipeline, [afl, short_queue],\
   9                                                   [cfl,  long_queue]))
  10 c01 = pp.mkaudioamplify(pipeline, c01, 1./arm_length)
  11 c02 = pp.mkaudioamplify(pipeline, c02, 1./arm_length)
  • The python script is available at git repository

> kagra-cal/Observation/Phase1/tutorials/filt --help
Usage: filt [options]

Options:
  -h, --help            show this help message and exit
  --cache=cache         Set the name of the LAL cache listing the frame files
  --gps-start-time=seconds
                        Set the start time of the segment to analyze in GPS
                        seconds.
  --gps-end-time=seconds
                        Set the end time of the segment to analyze in GPS
                        seconds.
  --ifo=name            Name of the IFO (default= K1)
  --channel=name        Set channel names for MICH_IN1,MICH_OUT,MICH_RESIDUAL,
                        MICH_DELTA_TM,C00_STRAIN (default= LSC-MICH1_IN1_DQ
                        ,LSC-MICH1_OUT_DQ,CAL-CS_PROC_MICH_RESIDUAL_DQ,CAL-
                        CS_PROC_MICH_DELTA_TM_DQ,CAL-CS_PROC_C00_STRAIN_DQ)
  --frame-type=name     Set the frame type as input to the frame writing
                        element. (Default=TEST)
  --output-path=name    Set the output path for writing frame files.
                        (Default=.)
  --format=format       Set input channel(s) format (default= F64LE)
  --ch-rate=rate        Set input channel data rate (default= 16384)
  --frame-duration=seconds
                        Set the number of seconds for each frame. (Default =4)
  • Here is an example to produce C01 and 02 from DELTA_TM+RESIDUAL and (MICH_IN1/C)+(MICH_OUT*A), respectively
  • Frame duration is set short because the first frame should be skipped because of the latency of applying FIR filter
  • It should be OK to ignore the warnings

> kagra-cal/Observation/Phase1/tutorials/filt --cache=k1.cache                             GPS:  1209288320 1209288352
[('K1', 'LSC-MICH1_IN1_DQ'), ('K1', 'LSC-MICH1_OUT_DQ'), ('K1', 'CAL-CS_PROC_MICH_RESIDUAL_DQ'), ('K1', 'CAL-CS_PROC_MICH_DELTA_TM_DQ'), ('K1', 'CAL-CS_PROC_C00_STRAIN_DQ')]
delay= 16384.0 4096.0 output_start= 1209288321
seeking GPS start and stop times ...
setting pipeline state to playing ...
set to playing successfully
running pipeline ...
progress_src_MOU (00:00:05): 1209288320 seconds

(python:15041): GStreamer-WARNING **: gstpad.c:5079:store_sticky_event:<framecppchannelmux0:src> Sticky event misordering, got 'segment' before 'stream-start'

(python:15041): GStreamer-WARNING **: gstpad.c:5079:store_sticky_event:<progress_sink_K1:src> Sticky event misordering, got 'segment' before 'stream-start'

(python:15041): GStreamer-WARNING **: gstpad.c:5079:store_sticky_event:<sink:proxypad0> Sticky event misordering, got 'segment' before 'stream-start'

(python:15041): GStreamer-WARNING **: gstpad.c:5079:store_sticky_event:<multifilesink:sink> Sticky event misordering, got 'segment' before 'stream-start'

(python:15041): GStreamer-WARNING **: gstpad.c:5079:store_sticky_event:<framecppfilesink0:sink> Sticky event misordering, got 'segment' before 'stream-start'

(python:15041): GStreamer-WARNING **: gstpad.c:5079:store_sticky_event:<progress_sink_K1:sink> Sticky event misordering, got 'segment' before 'stream-start'
progress_src_C00 (00:00:21): 1209288320 seconds
progress_src_DTM (00:00:21): 1209288320 seconds
progress_src_RES (00:00:21): 1209288320 seconds
progress_src_MIN (00:00:21): 1209288352 / 32 seconds (3779026100.0 %)
progress_src_MOU (00:00:21): 1209288352 / 32 seconds (3779026100.0 %)
progress_src_C00 (00:00:21): 1209288352 / 32 seconds (3779026100.0 %)
progress_src_DTM (00:00:21): 1209288352 / 32 seconds (3779026100.0 %)
progress_src_RES (00:00:21): 1209288352 / 32 seconds (3779026100.0 %)
progress_sink_K1 (00:00:25): 1209288324 seconds
progress_sink_K1 (00:00:31): 1209288336 seconds
progress_sink_K1 (00:00:36): 1209288348 seconds
progress_sink_K1 (00:00:36): 1209288352 / 32 seconds (3779026100.0 %)
  • Check the contents of the output frame files

$LAL_PREFIX/bin/framecpp_query --list proc K-TEST-1209288324-4.gwf
Frame Version: 8 Frame Library: frameCPP Library Revision: 1 Originator: IGWD
Frame Offset: 0
K1:CALIB_AFL
K1:CALIB_C00
K1:CALIB_C01
K1:CALIB_C02
K1:CALIB_CFL
K1:CALIB_DTM
K1:CALIB_MIN
K1:CALIB_MOU
K1:CALIB_RES

KAGRA/Subgroups/CAL/GstLAL/tutorials/step7 (last edited 2018-08-08 02:09:07 by SadakazuHaino)