Skip to content
Snippets Groups Projects
Commit 163716bc authored by Jonah Kanner's avatar Jonah Kanner :nerd:
Browse files

Got Elliptical injections working

git-svn-id: https://svn.ligo.caltech.edu/svn/bayeswave/trunk@54 c56465c9-8126-4a4f-9d7d-ac845eff4865
parent 76ba0d56
No related branches found
No related tags found
No related merge requests found
......@@ -12,18 +12,19 @@ from glob import glob
start = 961545615
end = 971654415
ifo = 'GHLV'
frtype = 'BRST_S6'
# ifo = 'GHLV'
# frtype = 'BRST_S6'
basedir = '/archive/frames/S6/Burst-MDC/GHLV-BRST_S6'
# basedir = '/archive/frames/S6/Burst-MDC/GHLV-BRST_S6'
basedir = '/archive/frames/S6/Burst-MDC/GHLV-ELPTC_S6'
sfour = 9615
efour = 9716
outfile = open('brst_s6.cache','w')
outfile = open('elptc_s6.cache','w')
for four in range(sfour, efour+1):
print "Starting directory " + str(four)
dirname = "{0}/GHLV-BRST_S6-{1}/".format(basedir, four)
dirname = "{0}/GHLV-ELPTC_S6-{1}/".format(basedir, four)
filelist = glob(dirname + '*')
for filename in filelist:
......
import numpy as np
# -- Helper function for removing triggers outside a trigger list
def find_in_segs(triglist, segs):
indx = np.zeros(len(triglist), dtype=bool)
for n in range(len(triglist)):
gps = triglist[n]
indx[n] = np.any( np.logical_and( gps>(segs['start']+8), gps<(segs['stop']-4)) )
return indx
namestring = """
GravEn_SimID SimHrss SimEgwR2 GravEn_Ampl Internal_x Internal_phi External_x External_phi External_psi FrameGPS EarthCtrGPS SimName SimHpHp SimHcHc SimHpHc GEO GEOctrGPS GEOfPlus GEOfCross H1 H1ctrGPS H1fPlus H1fCross H2 H2ctrGPS H2fPlus H2fCross L1 L1ctrGPS L1fPlus L1fCross V1 V1ctrGPS V1fPlus V1fCross
"""
namelist = namestring.split()
data = np.recfromtxt('BurstMDC-ELPTC_S6-Log.txt', names=namelist)
waveform = data['SimName']
hrss = data['SimHrss']
phi = data['External_phi']
x = data['External_x']
theta = np.arccos(x)
dec = np.pi/2 - theta
gps = data['EarthCtrGPS']
sgname = 'SG153Q8d9'
wnbname = 'WNB_100_100_0d1'
loudsg = [gps[i] for i in range(len(gps)) if (waveform[i] == sgname) and (gps[i] > 961545615) and (gps[i] < 971654415) ]
# ---------------------
# Read in segment lists
# ---------------------
segfmt = ['start', 'stop', 'dur']
h1segs = np.recfromtxt('H1_BURST_CAT2_LONG.txt', names=segfmt)
l1segs = np.recfromtxt('L1_BURST_CAT2_LONG.txt', names=segfmt)
# -- Find which triggers are in the segment list somewhere
h1sg = find_in_segs(loudsg, h1segs)
l1sg = find_in_segs(loudsg, l1segs)
indx = np.logical_and(h1sg, l1sg)
goodsg = np.array(loudsg)[indx]
print "Found {0} SGs in good times".format(goodsg.size)
# -- Set how many triggers we want
N = 20
outfile = open('setup_sg153_elptc.sh','w')
for time in goodsg[0:N]:
outfile.write("./condor_setup.sh {0} \n".format(time) )
outfile.close()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment