== How to read Cache file and Time Series Data == === Cache file direction === * In k1det1 {{{ [detchar@k1det1~]$ cd /home/detchar/Cache [detchar@k1det1 Cache]$ ls K1-Cache.cache mkCache.py nohup.out }}} {{{ >>> /home/detchar/Cache/K1-Cache.cache }}} * In seikai, only the ikagra data cache is stored. {{{ [user@seikai~]$ cd /home/detchar/Cache/ikagra_cache/ [user@seikai ikagra_cache]$ ls ikagra_cachefile.cache mkCache.py }}} {{{ >>> /home/detchar/Cache/ikagra_cache/ikagra_cachefile.cache }}} === Read Cache file === {{{ #!python from glue.lal import Cache gwf_cache = '/home/detchar/Cache/K1-Cache.cache' # Specify 'Cache file path' here with open(gwf_cache, 'r') as fobj: # Read the cache file using glue.lal cache = Cache.fromfile(fobj) type(cache) # type of cache is glue.lal.Cache glue.lal.Cache cache # Contants of cache [, , . . . , , ...] }}} === Read Time Series Data === * Reference Link : https://gwpy.github.io/docs/stable/api/gwpy.timeseries.TimeSeries.html#gwpy.timeseries.TimeSeries {{{ #!python import os # os and sys modules are required to load gwf file using cache import sys from gwpy.timeseries import TimeSeries ch = 'K1:LSC-MICH_CTRL_CAL_OUT_DQ' # Specify 'Channel Name' by string type gst = 1199756064.0 # Specify 'GPS start time' by float or integer type get = 1199756064.0 + 600 # Specify 'GPS end time' by float or integer type data = TimeSeries.read(cache, ch , gst, get, format='lalframe') data # Contants of TimeSeries data , dt=, name='K1:LSC-MICH_CTRL_CAL_OUT_DQ', channel=)> }}} === Save Plot === If you want to save plot, please import the following modules. Because GUI is not supported. {{{ #!python import numpy as np import matplotlib matplotlib.use('agg') # This code is required because GUI is not supported. }}}