from virgotools import * from virgotools.frame_lib import FrVect2array import matplotlib.pyplot as plt import numpy as np # horizon stable at 30 Mpc, no big glitch +- 5 min, half hour before end of last good lock gold = utc2gps(2018, 6, 26, 5, 15, 0) # short lock after the extra noise has appeared. Note that input power was changed as well gnew = utc2gps(2018, 6, 29, 20, 10, 0) # get all channel names and exact gps of spectrum def get_channels(gps): chans = {} with FrameFile('spectro') as ffl: for i in range(300): try: with ffl.get_frame(gps+i) as frame: print 'Found frame at gps = %i' % frame.gps p = frame._frame.contents.procData while p: name = str(p.contents.name) chans[name] = frame.gps print '->', name p = p.contents.next except: pass return chans old = get_channels(gold) new = get_channels(gnew) def get_asd(chan, table): with FrameFile('spectro') as ffl: with ffl.get_frame(table[chan]) as frame: p_proc = fd.FrProcDataFind(frame._frame, chan) assert p_proc p_vect = p_proc.contents.data asd = FrVect2array(p_vect) df = float(p_vect.contents.dx[0]) # fd.FrProcDataFree(p_proc) # this core dumps freq = df * np.arange(asd.size) return freq, asd def compare(chan): f1, a1 = get_asd(chan, old) f2, a2 = get_asd(chan, new) plt.loglog(f1, a1, label=gps2str(old[chan])) plt.loglog(f2, a2, label=gps2str(new[chan])) plt.title(chan) plt.legend() plt.grid() plt.show() def compare_all(): for c in old: compare(c)