Step 2: Dump lock flags from a frame cache file

   1 instrument = 'K1'
   2 src = pp.mklalcachesrc(pipeline, location = frame_cache, cache_dsc_regex = instrument)

   1 channel_list = []
   2 headkeys     = []
   3 head_dict    = {}
   4 channel_list.append((instrument, 'GRD-LSC_MICH_STATE_N'))
   5 demux = pp.mkframecppchanneldemux(pipeline, src, do_file_checksum = do_file_checksum, skip_bad_files = skip_bad_files, channel_list = map("%s:%s".__mod__, channel_list))

   1 headkeys.append("FLG")
   2 for key, chan in zip(headkeys, channel_list):
   3     head_dict[key] = cp.hook_up(pipeline, demux, chan[1],instrument, buf_length)

   1 caps  = "audio/x-raw, format=F64LE, rate=%d" % int(channel_rate)
   2 capsr = "audio/x-raw, format=F64LE, rate=%d" % int(out_rate)
   3 for key in headkeys:
   4     head_dict[key] = cp.caps_and_progress(pipeline, head_dict[key], caps, key)
   5     head_dict[key] = cp.mkresample(pipeline, head_dict[key], 0, False, capsr)

   1 pp.mknxydumpsink(pipeline, head_dict["FLG"], output)

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

Options:
  -h, --help       show this help message and exit
  --cache=cache    Set the name of the LAL cache listing the frame files
  --ifo=name       Name of the IFO (default= K1)
  --channel=name   Set channel name to dump (default= GRD-LSC_MICH_STATE_N)
  --output=name    Set output file name (default= flag.txt)
  --ch-rate=rate   Set input channel data rate (default= 16)
  --out-rate=rate  Set output data rate (default= 1)

> kagra-cal/Observation/Phase1/tutorials/flag --cache=k1.cache
GPS:  1209288320 1209288352
seeking GPS start and stop times ...
setting pipeline state to playing ...
set to playing successfully
running pipeline ...
progress_src_FLG (00:00:01): 1209288352 / 32 seconds (3779026100.0 %)
FLAG:  1209288320 1000

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

Options:
  -h, --help           show this help message and exit
  --lock=lock.dat      File name containing lock flag list (default= lock.dat)
  --frlist=cache/list  List of the frame file names to be searched
  --outdir=cache/lock  Directory name where the output files are stored

> kagra-cal/Observation/Phase1/tutorials/lcache --outdir=cache/lock
1208761495 1208761531    36 1208761472 1208761504 2
1208761814 1208762443   629 1208761792 1208762432 21
1208762460 1208764322  1862 1208762432 1208764320 60
1208770528 1208771616  1088 1208770528 1208771616 35
1208771932 1208772607   675 1208771904 1208772576 22
1208772696 1208772735    39 1208772672 1208772704 2
1208773299 1208773317    18 1208773280 1208773312 2
1208775247 1208777094  1847 1208775232 1208777088 59
...

> head cache/lock/1208762460-1208764322                       
K K1_C 1208762432 32 file://localhost/data/full/12087/K-K1_C-1208762432-32.gwf
K K1_C 1208762464 32 file://localhost/data/full/12087/K-K1_C-1208762464-32.gwf
K K1_C 1208762496 32 file://localhost/data/full/12087/K-K1_C-1208762496-32.gwf
K K1_C 1208762528 32 file://localhost/data/full/12087/K-K1_C-1208762528-32.gwf
K K1_C 1208762560 32 file://localhost/data/full/12087/K-K1_C-1208762560-32.gwf
K K1_C 1208762592 32 file://localhost/data/full/12087/K-K1_C-1208762592-32.gwf
K K1_C 1208762624 32 file://localhost/data/full/12087/K-K1_C-1208762624-32.gwf
K K1_C 1208762656 32 file://localhost/data/full/12087/K-K1_C-1208762656-32.gwf
K K1_C 1208762688 32 file://localhost/data/full/12087/K-K1_C-1208762688-32.gwf
K K1_C 1208762720 32 file://localhost/data/full/12087/K-K1_C-1208762720-32.gwf

KAGRA/Subgroups/CAL/GstLAL/tutorials/step2 (last edited 2018-08-08 00:09:49 by SadakazuHaino)