=== Step 9: Make an ASD from a frame (cache) file === * In this step we will try to make an ASD using a part of GstLAL-inspiral * 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]] * Here is the part to compute the PSD. This pipeline actually give us the whitened data but you can get PSD as a bi-product through PSDHandler {{{#!python from gstlal import reference_psd as rp ... handler = rp.PSDHandler(mainloop, pipeline) ... head = pp.mkwhiten(pipeline, head, psd_mode = 0, zero_pad = 0, fft_length = options.psd_fft_length,\ average_samples = options.average_samples, median_samples = options.median_samples) pp.mkfakesink(pipeline, head) }}} * After running the pipeline we can retrieve PSD data and convert into ASD {{{#!python psd = handler.psd f0 = psd.f0 df = psd.deltaF nf = psd.data.length data = psd.data.data data = np.sqrt(data) # Conver PSD to ASD freq = np.arange(f0, df*nf, df) }}} * The python script is available at git repository {{{ > kagra-cal/Observation/Phase1/tutorials/asd --help Usage: asd [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 input channel name (default= CAL- CS_PROC_MICH_DELTA_TM_DQ) --output=name Set output file name (default= asd.txt) --xrange=min,max Set range of xaxis in case of --output=*.png --yrange=min,max Set range of yaxis in case of --output=*.png --ch-rate=rate Set input channel data rate (default= 16384) --psd-fft-length=s FFT length, default 8s --average-samples=s FFT averaging samples, default 64 --median-samples=s FFT median samples, default 7 }}} * This is an example to produce an ASD of C00 strain and make a png file {{{ > kagra-cal/Observation/Phase1/tutorials/asd --cache=k1.cache --channel=CAL-CS_PROC_C00_STRAIN_DQ --output=asd0.png --xrange=1,5000 --yrange=1e-18,1e-11 GPS: 1209288320 1209288352 seeking GPS start and stop times ... setting pipeline state to playing ... set to playing successfully running pipeline ... progress_src_input (00:00:02): 1209288352 / 32 seconds (3779026100.0 %) }}} * The plot shows the produced ASD [[attachment:asd0.png|{{attachment:asd0.png|ASD of C00 strain|width="600"}}]] * [[KAGRA/Subgroups/CAL/GstLAL/tutorials/step10|(Next) Step 10: Read channel data from shared memory]] * [[KAGRA/Subgroups/CAL/GstLAL/tutorials/step8|(Prev) Step 8: Check the transfer function of FIR filters]] * [[KAGRA/Subgroups/CAL/GstLAL/tutorials|Tutorials]]