Commit fdf706a2 authored by Hannah Middleton's avatar Hannah Middleton
Browse files

updating scripts and plot scripts

parent 98c111d0
......@@ -28,7 +28,7 @@ def batchARLS(order,timeseries,adap,delayed,P,primary,reference,lambd):
I=np.eye(order)
#P=I
print (adap, 'in func')
#print (adap, 'in func')
# run the filter on this batch
for i in range(n):
......@@ -43,6 +43,6 @@ def batchARLS(order,timeseries,adap,delayed,P,primary,reference,lambd):
timeseries.value[i] = cancelled
print (adap, 'in func')
#print (adap, 'in func')
return adap, delayed, P, timeseries
......@@ -66,8 +66,8 @@ def main():
#startTime = 1126621184
startTime = 1166401536
batchDuration = 64#128
startTime = 1169428480
batchDuration = 64*64
# get first 5 characters of time string for locating files
timeDir = str(startTime)[:5]
......@@ -84,31 +84,57 @@ def main():
resampleRate = 1024
for i in range(64): # temp -> should calculate batches later
print ('batch number: ', i)
nBatches = int(256)
nBatches = int(5)
firstIter=True
gwfFileStart = 1169428480 #1166401536 #startTime
for i in range(nBatches): # temp -> should calculate batches later
print ('''
batch number: {}
startTime : {} -> {}
first iter: {}
'''.format(i,startTime,startTime%4096,firstIter))
endTime = startTime + batchDuration
# which gw frame file to use
if startTime%4096 == 0 and firstIter == False:
gwfFileStart+=4096
#print ("\n\n\n\n\n advance file \n\n\n\n\n")
else: pass
"""
temproary test where we are resetting the filter on every 64 s batch
"""
#adapNow, delayedNow, PNow = initialFilterSetUp(order,args.filtedResultsDir,startTime)
# change to define location above when working
# get primary
# get primar
print('get primary data')
#primaryFrame = str('/home/hannah.middleton/CW/makeFakeData/scripts/powerTestData/injectionsIntoO1Data/H-H1_HOFT_C02-combined-1126621184-4096.gwf')
#primaryFrame = str('/home/hannah.middleton/CW/makeFakeData/scripts/injTest/H-H1_combinedInj-1126621184-4096.gwf')
primaryFrame = str('/hdfs/frames/O2/hoft_C02/H1/H-H1_HOFT_C02-11664/H-H1_HOFT_C02-1166401536-4096.gwf')
primaryFrame = str('/hdfs/frames/O2/hoft_C02/H1/H-H1_HOFT_C02-{0}/H-H1_HOFT_C02-{1}-4096.gwf'.format(str(gwfFileStart)[:5],gwfFileStart))
primaryChannelName = str('H1:DCS-CALIB_STRAIN_C02')
primBatch = TimeSeries.read(primaryFrame,primaryChannelName,start=startTime,\
end=endTime,resample=resampleRate)
# get reference
referenceFrame = str('/archive/frames/O2/raw/H1/H-H1_R-11664/H-H1_R-{0}-64.gwf'.format(startTime))
print('get reference data')
referenceFrame = str('/archive/frames/O2/raw/H1/H-H1_R-{0}/H-H1_R-{1}-64.gwf'.format(str(gwfFileStart)[:5],startTime))
referenceChannelName = str('H1:PEM-CS_MAINSMON_EBAY_1_DQ')
startTimeList = [ startTime+((i)*64) for i in range(int(batchDuration/64)) ]
referenceFrame = [ str('/archive/frames/O2/raw/H1/H-H1_R-{0}/H-H1_R-{1}-64.gwf'.format(str(st)[:5],st)) for st in startTimeList]
#print(referenceFrame)
refBatch = TimeSeries.read(referenceFrame,referenceChannelName,start=startTime,\
end=endTime,resample=resampleRate)
maxRef = max(np.atleast_1d(refBatch.value))
scaledRefBatch = refBatch
#scaledRefBatch = refBatch.lowpass(100.) / 1E18
#print (scaledRefBatch)
# temporary to test doing 2 batches at once
#referenceFrameB = str('/archive/frames/O1/raw/H1/H-H1_R-11266/H-H1_R-{0}-64.gwf'.format(startTime+64))
#refBatch128 = TimeSeries.read([referenceFrame,referenceFrameB],referenceChannelName,start=startTime,\
......@@ -152,7 +178,7 @@ def main():
adapNow, delayedNow, PNow = adapNext, delayedNext, PNext ##
startTime = startTime + batchDuration
firstIter = False
if __name__ == '__main__':
main()
......@@ -45,7 +45,7 @@ for i, (data, label, col) in enumerate([
color=col)
#plot.show()
ax.grid(color='darkgrey', linewidth=1, linestyle='--')
#ax.grid(color='darkgrey', linewidth=1, linestyle='--')
......@@ -78,6 +78,7 @@ ax2.set_ylim(7e-24,3e-23)
ax2.set_xlim(57,63)
ax.legend()
plot.save('/home/hannah.middleton//public_html/o2catalog-asd.pdf')
#plot.save('~/hannah.middleton/public_html/o2catalog-asd.png')
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment