Commit 1bebc140 authored by Tyson Littenberg's avatar Tyson Littenberg
Browse files

adapting python to new src


git-svn-id: https://svn.ligo.caltech.edu/svn/bayeswave/trunk@541 c56465c9-8126-4a4f-9d7d-ac845eff4865
parent 2e07ac5e
......@@ -79,6 +79,10 @@ def make_skyview(directory='.', mdc=None, NSIDE=128, ra=None, dec=None, results=
# --------------------------------
# -- Get run name
params = BwbParams()
print params.event
jobname = params.jobname
# -- Input skymap data
......@@ -119,6 +123,8 @@ def make_skyview(directory='.', mdc=None, NSIDE=128, ra=None, dec=None, results=
sidtime = sidtime % (np.pi*2)
# -- Get the injection location
print "GOT MDC?"
print mdc
if mdc is None:
injtheta = 0
injphi = 0
......@@ -128,6 +134,7 @@ def make_skyview(directory='.', mdc=None, NSIDE=128, ra=None, dec=None, results=
injtheta, injphi = mdc.get_theta_phi(trigtime)
injra = injphi + sidtime
injdec = np.pi/2 - injtheta
print "GOT INJECTION PARAMTERS"
print injtheta, injra
# -- Special handling for injections drawn from prior
......@@ -242,12 +249,13 @@ if __name__ == "__main__":
print opt
if opt=='--mdc':
# -- mdc argument should be the name of the MDC log
mdc = ft.Mdc(arg)
print "Reading MDC log {0}".format(arg)
try:
mdc = ft.Mdc(arg)
except:
print "WARNING! Failed to read MDC log file"
mdc = None
#mdc = None
if opt == '--directory':
directory = arg
if opt == '--NSIDE':
......
......@@ -30,6 +30,7 @@ class Mdc:
# -- Read a CBC XML table
if fileExtension == '.xml':
print "READING CBC XML TABLE"
xmldoc = glue.ligolw.utils.load_filename(filename, verbose=False)
injs = glue.ligolw.table.get_table(xmldoc,glue.ligolw.lsctables.SimInspiralTable.tableName)
......
......@@ -56,7 +56,11 @@ class BwbParams:
runfile = open(bayeswaverunfile, 'r')
# -- Parse command line arguments
cmdline = runfile.readline().split(' ')
#cmdline = runfile.readline().split(' ')
# -- Parse command line arguments
lines = runfile.readlines()
cmdline = lines[7].split(' ')
foundit = False
for line in runfile:
......
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