def huge(start, end): source = filelist(start, end, trend='full', place='kashiwa') data = TimeSeriesDict.read(source, channels, start=start, end=end, nproc=4) c = 299792458 # m/sec lam = 1064e-9 # m gif = data['K1:VIS-ETMX_GIF_ARM_L_OUT16'] xarm = data['K1:CAL-CS_PROC_XARM_FILT_AOM_OUT16'] * 3000.0 / ( c / lam) * 1e6 # [um] etmx_seis = data['K1:PEM-SEIS_EXV_GND_X_OUT16'] itmx_seis = data['K1:PEM-SEIS_IXV_GND_X_OUT16'] diff_seis = etmx_seis - itmx_seis comm_seis = etmx_seis + itmx_seis # Coherence coh_gif2xarm = gif.coherence(xarm, fftlength=fftlen, overlap=ovlp) coh_gif2seis = gif.coherence(diff_seis, fftlength=fftlen, overlap=ovlp) coh_xarm2seiscomm = xarm.coherence(comm_seis, fftlength=fftlen, overlap=ovlp) # ASD gif = gif.asd(fftlength=fftlen, overlap=ovlp) xarm = xarm.asd(fftlength=fftlen, overlap=ovlp) diff_seis = diff_seis.asd(fftlength=fftlen, overlap=ovlp) comm_seis = comm_seis.asd(fftlength=fftlen, overlap=ovlp) w = 2.0 * np.pi * (diff_seis.frequencies.value) diff_seis = diff_seis / w comm_seis = comm_seis / w return xarm
elif hoge == 'sc4_6': start = tconvert('Sep 24 2019 22:42:00 JST') end = tconvert('Sep 24 2019 22:52:00 JST') else: start = int(hoge) # end = start + 1 # filterbank = True if filterbank: # Read filter names with open('./filtername.txt','r') as f: channels = map(lambda x:x.replace('\n',''),f.readlines()) # source = filelist(start,end,trend='full',place='kamioka') f = open('./results/{0}.txt'.format(hoge), mode='w') f.write('# NAME,STATUS,[FILTER_NUMBER],GAIN,OFFSET,LIMIT'+'\n') for name in channels: names = [name+_suffix for _suffix in ['_SWSTAT','_GAIN','_OFFSET','_LIMIT']] data = TimeSeriesDict.read(source,names,start=start,end=end,nproc=4, format='gwf.lalframe') swstat = int(data[name+'_SWSTAT'].mean()) gain = data[name+'_GAIN'].mean() offset = data[name+'_OFFSET'].mean() limit = data[name+'_LIMIT'].mean() txt = '{0},{2:3.5e},{3:3.5e},{4:3.5e},{1}'.format(name,filt_status(swstat), gain,offset,limit) print(txt) f.write(txt+'\n') f.close()
if __name__ == '__main__': # Parse arguments import argparse parser = argparse.ArgumentParser(description='description') parser.add_argument('dataname',help='data name which you want to calculate') args = parser.parse_args() dataname = args.dataname # Read timeseries data of Trillium120 from Kozapy.utils import filelist from lib.channel import get_seis_chname m31 = True if m31: start = tconvert('May31 2019 00:00:00') end = start + 2**13 fname = filelist(start,end) chname = get_seis_chname(start,end,place='EXV') print(chname) else: fname = fname_gwf_tr120(dataname) chname = frtools.get_channels(fname) try: data = TimeSeriesDict.read(fname,chname,**kwargs) except: print(fname) raise ValueError('!') exv,ixv,ixv2,eyv = check_channel_name(chname) exv = check_data(data,exv) ixv = check_data(data,ixv) ixv2 = check_data(data,ixv2)