Commit 887498eb authored by Tyson Littenberg's avatar Tyson Littenberg
Browse files

Create O2 tag


git-svn-id: https://svn.ligo.caltech.edu/svn/bayeswave/tags/O2@609 c56465c9-8126-4a4f-9d7d-ac845eff4865
parents
body {
font: 90% Lucida Sans;
margin: 20px;
line-height: 26px;
}
.container {
min-width: 1220px;
}
.wrapper {
position: relative;
overflow: auto;
}
/*#top, #sidebar, #bottom, .menuitem { */
#top, #bottom, .menuitem {
border-radius: 4px;
margin: 4px;
}
#top {
background-color: #71B09F;
color: #ffffff;
border: 1px solid #374040;
padding: 15px;
}
#menubar {
width: 200px;
float: left
}
#main {
padding: 10px;
margin: 0 210px;
/*padding-right: 0px;
margin-right: 0px;*/
min-width: 1010px;
}
/* #sidebar {
background-color: #32a4e7;
color: #ffffff;
padding: 10px;
width: 180px;
bottom: 0;
top: 0;
right: 0;
position: absolute;
} */
#bottom {
border: 1px solid #d4d4d4;
background-color: #f1f1f1;
text-align: center;
padding: 10px;
font-size: 70%;
line-height: 14px;
}
#top h1, #top p, #menulist {
margin: 0;
padding: 0;
}
.menuitem {
background-color: #B1C7C7;
border: 1px solid #333333;
list-style-type: none;
padding: 2px;
cursor: pointer;
}
.menuitem:hover {
background-color: #7A8787;
}
a {
color: #000000;
text-decoration: underline;
}
a:hover {
text-decoration: none;
}
table {
width:100%;
}
table, th, td {
border: 1px solid #333333;
border-collapse: collapse;
}
th, td {
padding: 5px;
text-align: left;
}
table#tab1 tr:nth-child(even) {
background-color: #d4d4d4;
}
table#tab1 tr:nth-child(odd) {
background-color:#fff;
}
table#tab1 th {
background-color: #71B09F;
color: white;
}
#!/usr/bin/python
#
# Copyright (C) 2011 Leo Singer
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
"""
Convert a list of posterior samples to a HEALPix FITS image using an adaptively
refined HEALPix tree, subdividing each node if it contains more than
--samples-per-bin posterior samples. By default, the resolution is set to the
deepest resolution of the tree.
If an input filename is specified, then the posterior samples are read from it.
If no input filename is provided, then input is read from stdin.
"""
__author__ = "Leo Singer <leo.singer@ligo.org>"
# Command line interface
from optparse import Option, OptionParser
from lalinference.bayestar import command
parser = OptionParser(
formatter=command.NewlinePreservingHelpFormatter(),
description = __doc__,
usage = "%prog [options] [INPUT] -o OUTPUT.fits[.gz]",
option_list = [
Option("--nside", "-n", type=int, default=-1,
help="HEALPix lateral resolution [default: auto]"),
Option("-o", "--output", metavar="OUTPUT.fits[.gz]",
help="name of output FITS file [required]"),
Option("--samples-per-bin", type=int, default=30,
help="Samples per bin [default: %default]"),
Option("--objid",
help="Event ID to be stored in FITS header [default: %default]"),
]
)
opts, args = parser.parse_args()
infilename = command.get_input_filename(parser, args)
if opts.output is None:
parser.error('--output: missing required argument')
# Late imports.
import matplotlib as mpl
mpl.use('Agg')
import numpy as np
import healpy as hp
import lalinference.bayestar.fits
import lalinference.bayestar.postprocess
import pylal.bayespputils
# --- Read input file
samples = np.recfromtxt(infilename, names=True)
# -- Undo sin(dec)
phi = samples['ra']
dec = np.arcsin(samples['sin_dec'])
theta = 0.5*np.pi - dec
p = lalinference.bayestar.postprocess.adaptive_healpix_histogram(
theta, phi, opts.samples_per_bin, nside=opts.nside)
# Write output to FITS file.
lalinference.bayestar.fits.write_sky_map(opts.output, p,
creator=parser.get_prog_name(), objid=opts.objid)
#!/usr/bin/python
#
# Copyright (C) 2011 Leo Singer
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
"""
Plot an all-sky map on a Mollweide projection.
By default, plot in celestial coordinates (RA, Dec).
To plot in geographic coordinates (longitude, latitude) with major
coastlines overlaid, provide the --geo flag.
Public-domain cartographic data is courtesy of Natural Earth
(http://www.naturalearthdata.com) and processed with MapShaper
(http://www.mapshaper.org).
"""
__author__ = "Leo Singer <leo.singer@ligo.org>"
# Command line interface
from optparse import Option, OptionParser
from lalinference.bayestar import command
from matplotlib import cm
colormap_choices = sorted(cm.cmap_d.keys())
parser = OptionParser(
description = __doc__,
usage = "%prog [options] [INPUT]",
option_list = [
Option("-o", "--output", metavar="FILE.{pdf,png}",
help="name of output file [default: plot to screen]"),
Option("--colormap", default="jet", choices=colormap_choices,
metavar='|'.join(colormap_choices),
help="name of matplotlib colormap [default: %default]"),
Option("--figure-width", metavar="INCHES", type=float, default=8.,
help="width of figure in inches [default: %default]"),
Option("--figure-height", metavar="INCHES", type=float, default=6.,
help="height of figure in inches [default: %default]"),
Option("--dpi", metavar="PIXELS", type=int, default=300,
help="resolution of figure in dots per inch [default: %default]"),
Option("--contour", metavar="PERCENT", type=float, action="append",
default=[], help="plot contour enclosing this percentage of"
+ " probability mass [may be specified multiple times, default: none]"),
Option("--radec", nargs=2, metavar="RA Dec", type=float, action="append",
default=[], help="right ascension (deg) and declination (deg) to mark"
+ " [may be specified multiple times, default: none]"),
Option("--geo", action="store_true", default=False,
help="Plot in geographic coordinates, (lat, lon) instead of (RA, Dec) [default: %default]")
]
)
opts, args = parser.parse_args()
infilename = command.get_input_filename(parser, args)
# Late imports
# Choose a matplotlib backend that is suitable for headless
# rendering if output to file is requested
import matplotlib
if opts.output is not None:
matplotlib.use('agg')
import os
import json
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import rcParams
import healpy as hp
import lal
from lalinference.bayestar import fits
from lalinference.bayestar import plot
fig = plt.figure(figsize=(opts.figure_width, opts.figure_height), frameon=False)
ax = plt.subplot(111,
projection='mollweide' if opts.geo else 'astro mollweide')
ax.cla()
ax.grid()
skymap, metadata = fits.read_sky_map(infilename)
nside = hp.npix2nside(len(skymap))
if opts.geo:
dlon = -lal.GreenwichMeanSiderealTime(lal.LIGOTimeGPS(metadata['gps_time'])) % (2*np.pi)
else:
dlon = 0
# Convert sky map from probability to probability per square degree.
probperdeg2 = skymap / hp.nside2pixarea(nside, degrees=True)
# Plot sky map.
vmax = probperdeg2.max()
plot.healpix_heatmap(probperdeg2, dlon=dlon,
vmin=0., vmax=vmax, cmap=plt.get_cmap(opts.colormap))
# Plot colorbar.
cb = plot.colorbar(vmax)
# -- KLUDGE Jonah is trying to clean up junk under color bar
etick = "{0:.1e}".format(vmax)
# cb.ax.set_xticklabels(['0','','','','', etick])
cb.set_ticks([0,vmax])
cb.set_ticklabels(['0', etick])
# Set colorbar label.
cb.set_label(r'prob. per sq. deg')
# Add contours.
if opts.contour:
indices = np.argsort(-skymap)
region = np.empty(skymap.shape)
region[indices] = 100 * np.cumsum(skymap[indices])
cs = plot.healpix_contour(region, dlon=dlon,
colors='k', linewidths=0.5, levels=opts.contour)
fmt = r'%g\%%' if rcParams['text.usetex'] else '%g%%'
plt.clabel(cs, fmt=fmt, fontsize=6, inline=True)
if opts.geo:
geojson_filename = os.path.join(os.path.dirname(plot.__file__),
'ne_simplified_coastline.json')
with open(geojson_filename, 'r') as geojson_file:
geojson = json.load(geojson_file)
for shape in geojson['geometries']:
verts = np.deg2rad(shape['coordinates'])
plt.plot(verts[:, 0], verts[:, 1], color='black', linewidth=1, alpha=0.5)
# Add markers (e.g., for injections or external triggers).
for ra, dec in np.deg2rad(opts.radec):
# Convert the right ascension to either a reference angle from -pi to pi
# or a wrapped angle from 0 to 2 pi, depending on the version of Matplotlib.
# FIXME: Remove this after all Matplotlib monkeypatches are obsolete.
if opts.geo or plot.mpl_version < '1.2.0':
ra = plot.reference_angle(ra + dlon)
else:
ra = plot.wrapped_angle(ra + dlon)
ax.plot(ra, dec, '*', markerfacecolor='white', markeredgecolor='black', markersize=10)
# If we are using a new enough version of matplotlib, then
# add a white outline to all text to make it stand out from the background.
plot.outline_text(ax)
fig.patch.set_alpha(0.)
ax.patch.set_alpha(0.)
ax.set_alpha(0.)
if opts.output is None:
plt.show()
else:
plt.savefig(opts.output, dpi=opts.dpi)
#!/bin/bash
# Get path of BayesWaveBurst to figure out where the postprocessing scripts are
pathtoBWB=$(which BayesWaveBurst)
# The argument for this script is the path to the job we want to analyze
dirname=$1
# The user may provide the sky-location (right ascension "ra" and declination "dec") of an injected
# signal, a request to compute matches between injected and reconsturcted signals, none of the above,
# or all of the above
echo
if [ "$#" -eq 3 ] ; then
echo "You requested to display the sky location of the injections"
ra=$2
dec=$3
fi
if [ "$#" -eq 2 ] ; then
echo "You provided an MDC log file"
mdc=$2
fi
if [ -s "$pathtoBWB" ] ; then
pathtoBWB=${pathtoBWB%src*}
echo
echo "Entering $dirname ..."
cd $dirname
MDC="$(grep MDC *bayeswave.run)"
inj="$(grep \\.xml *bayeswave.run)"
echo
echo " * Running skymap..."
if [ ${#MDC} -ne "0" -o ${#inj} -ne "0" ] ; then
#$pathtoBWB/postprocess/run_skymap.sh $ra $dec
if [ "$#" -eq 3 ] ; then
python $pathtoBWB/postprocess/skymap/megasky.py --ra=$ra --dec=$dec
elif [ "$#" -eq 2 ] ; then
python $pathtoBWB/postprocess/skymap/megasky.py --mdc=$mdc
else
echo " Failed to generate skymap!"
fi
else
python $pathtoBWB/postprocess/skymap/megasky.py
fi
echo
echo " * Running megaplot..."
python -W ignore $pathtoBWB/postprocess/megaplot.py
#echo
#echo " * Running plot_evidence..."
#python -W ignore $pathtoBWB/postprocess/plot_evidence.py
#echo
#echo " * Running skyview..."
#export PYTHONPATH=$PYTHONPATH:$pathtoBWB/postprocess/skymap:/home/jkanner/lib64/python:/home/jkanner/lib/python:$pathtoBWB/postprocess/s6
#python -W ignore $pathtoBWB/postprocess/skyview.py
echo
echo " * Compressing analyzed data..."
#tar -cf waveforms.tar waveforms
#tar -cf chains.tar chains
#tar -cf snr.tar *snr
cd ..
echo
echo " * ...DONE!"
echo
echo
echo
echo "To move the postprocessing results in order to make them visible. Run:"
echo "rsync -av --progress <path to this directory> <path to the desired directory in the public_html> --exclude '*/*snr' --exclude '*/waveforms' --exclude '*/chains' --exclude '*/post' --include='*/' --include='*html' --include '*/html/*' --include '*/plots/*' --include '*/tables/*' --include condorOut*txt --include *bayeswave.run --exclude='*'"
echo
echo
else
echo "Make sure the BayesWaveBurst command is in your path before running this script!"
fi
#!/bin/bash
# Get path of BayesWaveBurst to figure out where the postprocessing scripts are
pathtoBWB=$(which BayesWaveBurst)
if [ -s "$pathtoBWB" ] ; then
pathtoBWB=${pathtoBWB%src*}
fulldirname="$(pwd)"
for dirname in $fulldirname/job*; do
echo
echo "Entering $dirname ..."
cd $dirname
MDC="$(grep MDC *bayeswave.run)"
if [ ${#MDC} -ne "0" ]
then
echo
echo " * Running plot_waveform..."
python -W ignore $pathtoBWB/postprocess/plot_waveform.py --mdc=True
#python -W ignore /home/francesco.pannarale/scripts/BayesWaveTools/plot_waveform.py --mdc=True
echo
echo " * Running plot_evidence..."
else
echo
echo " * Running plot_waveform..."
python -W ignore $pathtoBWB/postprocess/plot_waveform.py --mdc=False
#python -W ignore /home/francesco.pannarale/scripts/BayesWaveTools/plot_waveform.py --mdc=False
fi
echo
echo " * Running skymap..."
$pathtoBWB/postprocess/run_skymap.sh
echo
echo " * Compressing analyzed data..."
tar -cf waveforms.tar waveforms
tar -cf chains.tar chains
tar -cf snr.tar *snr
cd ..
echo
echo " * ...DONE!"
echo
done
echo
echo
echo "To move the postprocessing results in order to make them visible. Run:"
echo " rsync -av --progress <path to this directory> <path to the desired directory in the public_html> --exclude '*/*snr' --exclude '*/waveforms' --exclude '*/chains' --exclude '*/post' --include='*/' --include '*html' --include '*png' --include condorOut_BWB.txt --exclude='*'"
echo
echo
else
echo "Make sure the BayesWaveBurst command is in your path before running this script!"
fi
#!/bin/bash
# Get path of BayesWaveBurst to figure out where the postprocessing scripts are
pathtoBWB=$(which BayesWaveBurst)
# The argument for this script is the path to the job we want to analyze
dirname=$1
# The user may provide the sky-location (right ascension "ra" and declination "dec") of an injected
# signal, a request to compute matches between injected and reconsturcted signals, none of the above,
# or all of the above
echo
if [ "$#" -eq 2 ] ; then
echo "You requested to display matches and injected signals"
match=$2
fi
if [ "$#" -eq 3 ] ; then
echo "You requested to display the sky location of the injections"
ra=$2
dec=$3
fi
if [ "$#" -eq 4 ] ; then
echo "You requested to display matches, injected signals, and the sky location of the injections"
ra=$2
dec=$3
match=$4
fi
if [ -s "$pathtoBWB" ] ; then
pathtoBWB=${pathtoBWB%src*}
echo
echo "Entering $dirname ..."
cd $dirname
MDC="$(grep MDC *bayeswave.run)"
if [ ${#MDC} -ne "0" ] ; then
echo
echo " * Running plot_waveform..."
if [ "$match" = "True" ]; then
python -W ignore $pathtoBWB/postprocess/plot_waveform.py --mdc=True --match=True
else
python -W ignore $pathtoBWB/postprocess/plot_waveform.py --mdc=True
fi
#echo
#echo " * Running plot_evidence..."
#python -W ignore $pathtoBWB/postprocess/plot_evidence.py
else
echo
echo " * Running plot_waveform..."
if [ "$match" = "True" ]; then
python -W ignore $pathtoBWB/postprocess/plot_waveform.py --mdc=False --match=True
else
python -W ignore $pathtoBWB/postprocess/plot_waveform.py --mdc=False
fi
#echo
#echo " * Running plot_evidence..."
#python -W ignore $pathtoBWB/postprocess/plot_evidence.py
fi
echo
echo " * Running skymap..."
$pathtoBWB/postprocess/run_skymap.sh $ra $dec
echo
echo " * Compressing analyzed data..."
tar -cf waveforms.tar waveforms
tar -cf chains.tar chains
tar -cf snr.tar *snr
cd ..
echo
echo " * ...DONE!"
echo
echo
echo
echo "To move the postprocessing results in order to make them visible. Run:"
echo " rsync -av --progress <path to this directory> <path to the desired directory in the public_html> --exclude '*/*snr' --exclude '*/waveforms' --exclude '*/chains' --exclude '*/post' --include='*/' --include '*html' --include '*png' --include condorOut_BWB.txt --exclude='*'"
echo
echo
else
echo "Make sure the BayesWaveBurst command is in your path before running this script!"
fi
This diff is collapsed.
$(document).ready(function(){
$("#summary").click(function(){
$("#main").load("./html/summary.html");
});
});
$(document).ready(function(){
$("#timedomain").click(function(){
$("#main").load("./html/timedomain.html");
});
});
$(document).ready(function(){
$("#freqdomain").click(function(){
$("#main").load("./html/freqdomain.html");
});
});
$(document).ready(function(){
$("#timefreq").click(function(){
$("#main").load("./html/timefreq.html");
});
});
$(document).ready(function(){
$("#overlap").click(function(){
$("#main").load("./html/overlap.html");
});
});
$(document).ready(function(){
$("#energy").click(function(){
$("#main").load("./html/energy.html");
});
});
$(document).ready(function(){
$("#t0").click(function(){
$("#main").load("./html/t0.html");
});
});
$(document).ready(function(){
$("#duration").click(function(){
$("#main").load("./html/duration.html");
});
});
$(document).ready(function(){
$("#f0").click(function(){
$("#main").load("./html/f0.html");
});
});
$(document).ready(function(){
$("#band").click(function(){
$("#main").load("./html/band.html");
});
});
$(document).ready(function(){
$("#hmax").click(function(){
$("#main").load("./html/hmax.html");
});
});
$(document).ready(function(){
$("#t_at_hmax").click(function(){
$("#main").load("./html/t_at_hmax.html");
});