Differences between revisions 1 and 3 (spanning 2 versions)
Revision 1 as of 2018-08-07 05:47:58
Size: 212
Comment:
Revision 3 as of 2018-08-07 23:39:08
Size: 3097
Comment:
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:
 * [[KAGRA/Subgroups/CAL/GstLAL/tutorials/step8|Step 8: Check the transfer function of FIR filters]]  * 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=name Set range of xaxis in case of --output=*.png
  --yrange=name 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=AVERAGE_SAMPLES
                        FFT averaging samples, default 64
  --median-samples=MEDIAN_SAMPLES
                        FFT median samples, default 7
  -v, --verbose Be verbose (optional).
}}}
 * 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 ...
XLAL Error - XLALDestroyREAL8FFTPlan (CudaRealFFT.c:458): Invalid pointer
XLAL Error - XLALDestroyREAL8FFTPlan (CudaRealFFT.c:458): Invalid pointer
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/step8|(Prev) Step 8: Check the transfer function of FIR filters]]

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 step1

  • Access frame cache file by specifying frame_cache and instrument as in 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

   1 from gstlal import reference_psd as rp
   2 ...
   3 handler  = rp.PSDHandler(mainloop, pipeline)
   4 ...
   5 head = pp.mkwhiten(pipeline, head, psd_mode = 0, zero_pad = 0, fft_length = options.psd_fft_length,\
   6                    average_samples = options.average_samples, median_samples = options.median_samples)
   7 pp.mkfakesink(pipeline, head)
  • After running the pipeline we can retrieve PSD data and convert into ASD

   1 psd  = handler.psd
   2 f0   = psd.f0
   3 df   = psd.deltaF
   4 nf   = psd.data.length
   5 data = psd.data.data
   6 
   7 data = np.sqrt(data)  # Conver PSD to ASD                                       
   8 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=name         Set range of xaxis in case of --output=*.png
  --yrange=name         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=AVERAGE_SAMPLES
                        FFT averaging samples, default 64
  --median-samples=MEDIAN_SAMPLES
                        FFT median samples, default 7
  -v, --verbose         Be verbose (optional).
  • 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 ...
XLAL Error - XLALDestroyREAL8FFTPlan (CudaRealFFT.c:458): Invalid pointer
XLAL Error - XLALDestroyREAL8FFTPlan (CudaRealFFT.c:458): Invalid pointer
progress_src_input (00:00:02): 1209288352 / 32 seconds (3779026100.0 %)
  • The plot shows the produced ASD

ASD of C00 strain

KAGRA/Subgroups/CAL/GstLAL/tutorials/step9 (last edited 2018-08-15 07:45:06 by SadakazuHaino)