Commit fdd43e2e authored by Meg Millhouse's avatar Meg Millhouse
Browse files

ER7 online scripts (minor change)

git-svn-id: https://svn.ligo.caltech.edu/svn/bayeswave/trunk@382 c56465c9-8126-4a4f-9d7d-ac845eff4865
parent 2e97872d
......@@ -7,7 +7,7 @@ import os
import sys
from pylal.xlal.datatypes.ligotimegps import LIGOTimeGPS
from pylal.xlal.date import XLALGreenwichSiderealTime
#import find_trig as ft
import find_trig as ft
import healpy as hp
from subprocess import call
# from scipy.optimize import curve_fit
......@@ -15,7 +15,7 @@ import acor
from pylal import bayespputils
import sky_area.sky_area_clustering as sky
import getopt
#from readbwb import BwbParams
from readbwb import BwbParams
# -------------------------------------------
# Module to make skymaps, skyview webpage, etc.
......@@ -74,13 +74,13 @@ def make_skyview(directory='.', mdc=None, NSIDE=256, ra=None, dec=None, results=
# Create skymap summary statistics
# --------------------------------
# -- Get run name
#params = BwbParams()
#jobname = params.jobname
params = BwbParams()
jobname = params.jobname
# -- Input skymap data
# num, L, ralist, sin_dec, psi, e, dA, dphi, dt = np.loadtxt(filename, unpack=True)
print "Extracting RA/DEC samples"
filename = './chains/signal_extchain.dat.0'
filename = './chains/' + jobname + 'signal_extchain.dat.0'
try:
data = np.loadtxt(filename, unpack=True)
except:
......@@ -116,9 +116,7 @@ def make_skyview(directory='.', mdc=None, NSIDE=256, ra=None, dec=None, results=
count = 0
while redo:
try:
#kde = sky.ClusteredKDEPosterior(radec)
kde = sky.ClusteredSkyKDEPosterior(radec)
# kde = sky.Clustered3DKDEPosterior(radec)
kde = sky.ClusteredKDEPosterior(radec)
redo = False
except:
count += 1
......@@ -146,11 +144,11 @@ def make_skyview(directory='.', mdc=None, NSIDE=256, ra=None, dec=None, results=
print injtheta, injra
# -- Special handling for injections drawn from prior
#if params.ra is not None:
# injdec = params.dec
# injra = params.ra
# injtheta = np.pi/2 - injdec
# mdc = True
if params.ra is not None:
injdec = params.dec
injra = params.ra
injtheta = np.pi/2 - injdec
mdc = True
# -- Make plots directory, if needed
plotsDir = './plots'
......@@ -295,12 +293,11 @@ if __name__ == "__main__":
if opt=='--mdc':
# -- mdc argument should be the name of the MDC log
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
try:
mdc = ft.Mdc(arg)
except:
print "WARNING! Failed to read MDC log file"
mdc = None
if opt == '--directory':
directory = arg
if opt == '--NSIDE':
......
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