Commit bb5f7154 authored by Badri Krishnan's avatar Badri Krishnan
Browse files

Merge branch 'master' of ligo-vcs.phys.uwm.edu:/usr/local/git/lalsuite

Original: e107a66982c56a9cf589babdfa01637bf888e387
parents add60fd4 e5aa2831
......@@ -34,7 +34,8 @@ lalsuite_top_builddir='$(top_builddir)/..'
lalsuite_top_srcdir='$(top_srcdir)/..'
LALSUITE_BUILD="true"
export LALSUITE_BUILD
LALSUITE_SUBDIRS="${ac_subdirs_all}"
export LALSUITE_BUILD LALSUITE_SUBDIRS
LAL_LIBS="-L${libdir} ${lalsuite_top_builddir}/lal/lib/lal/liblal.la"
LAL_CFLAGS="-I${lalsuite_top_builddir}/lal/include"
......
# SWIG configuration
# Author: Karl Wette, 2011, 2012
#
# serial 32
# serial 34
# enable SWIG wrapping modules
AC_DEFUN([LALSUITE_ENABLE_SWIG],[
......@@ -243,21 +243,29 @@ AC_DEFUN([LALSUITE_USE_SWIG],[
])
AC_SUBST(SWIG_LD_LIBPATH_NAME)
])
# list of other LAL SWIG modules that this module depends on
AC_SUBST(SWIG_MODULE_DEPENDS,[""])
for arg in ${swig_save_LIBS}; do
swig_module=["`echo ${arg} | ${SED} -n 's|^.*/lib\(lal[^.]*\)\.la$|\1|p'`"]
AS_IF([test "x${swig_module}" != x && test "x${swig_module}" != xlalsupport],[
SWIG_MODULE_DEPENDS="${SWIG_MODULE_DEPENDS} ${swig_module}"
])
done
# string to add to user environment setup scripts
AC_SUBST(SWIG_USER_ENV,[""])
# scripting-language path to search for pre-installed SWIG modules
AC_SUBST(SWIG_PREINST_PATH,["\$(SWIG_OUTDIR)"])
AS_IF([test "x${LALSUITE_BUILD}" = xtrue],[
for dir in ${LALSUITE_SUBDIRS}; do
SWIG_PREINST_PATH="${SWIG_PREINST_PATH}:\$(abs_top_builddir)/../${dir}/\$(subdir)/${objdir}"
done
])
])
# configure SWIG languages
LALSUITE_USE_SWIG_OCTAVE
LALSUITE_USE_SWIG_PYTHON
# list of other LAL libraries SWIG wrapping module depends on
AC_SUBST(SWIG_MODULE_DEPENDS,[""])
# scripting-language path to search for pre-installed SWIG modules
AC_SUBST(SWIG_PREINST_PATH,["\$(SWIG_OUTDIR)"])
# restore global compiler/linker variables
CPPFLAGS=${swig_save_CPPFLAGS}
CFLAGS=${swig_save_CFLAGS}
......@@ -267,20 +275,6 @@ AC_DEFUN([LALSUITE_USE_SWIG],[
])
# add to list of other LAL libraries SWIG wrapping module depends on
# args: $1=LAL library, $2=enable dependency?
AC_DEFUN([LALSUITE_SWIG_DEPENDS],[
AS_IF([test "x$2" = xtrue],[
SWIG_MODULE_DEPENDS="${SWIG_MODULE_DEPENDS} $1"
# add to scripting-language path to search for pre-installed SWIG modules
AS_IF([test "x${LALSUITE_BUILD}" = xtrue],[
SWIG_PREINST_PATH="${SWIG_PREINST_PATH}:\$(abs_top_builddir)/../$1/\$(subdir)/${objdir}"
])
])
])
# configure SWIG language wrapping module
# args: $1=language, $2=actions if enabled
AC_DEFUN([LALSUITE_USE_SWIG_LANGUAGE],[
......@@ -390,9 +384,6 @@ AC_DEFUN([LALSUITE_USE_SWIG_OCTAVE],[
AC_MSG_RESULT([${octexecdir}])
AC_SUBST(octexecdir)
# string to add to user environment setup scripts
SWIG_USER_ENV="${SWIG_USER_ENV}"'prepend OCTAVE_PATH $(octexecdir)\n'
])
])
......
......@@ -59,7 +59,7 @@ lal-user-env.shell: Makefile $(srcdir)/generate_user_env.awk
@echo "prepend PKG_CONFIG_PATH $(libdir)/pkgconfig" >>$@
@echo "prepend PYTHONPATH $(pyexecdir) $(pythondir)" >>$@
@echo "prepend LAL_DATA_PATH $(pkgdatadir)" >>$@
@printf "$(SWIG_USER_ENV)" >>$@
@echo "prepend OCTAVE_PATH $(octexecdir)" >>$@
lal-user-env.csh lal-user-env.sh: lal-user-env.shell $(srcdir)/generate_user_env.awk
$(AM_V_GEN)$(AWK) -f $(srcdir)/generate_user_env.awk -v SED=$(SED) -v package=$(PACKAGE_NAME) -v output=$@ $< || { rm -f $@; exit 1; }
......
......@@ -66,7 +66,8 @@
%swiglal_call_dtor(gsl_vector##NAME##_free, $self);
}
}
%swiglal_array_dynamic_1D(TYPE, size_t, data, size, arg1->stride);
%swiglal_array_dynamic_size(size_t, size);
%swiglal_array_dynamic_1D(TYPE, size_t, data, arg1->size, arg1->stride);
} gsl_vector##NAME;
// GSL matrix of type NAME.
......@@ -84,7 +85,9 @@
%swiglal_call_dtor(gsl_matrix##NAME##_free, $self);
}
}
%swiglal_array_dynamic_2D(TYPE, size_t, data, size1, size2, arg1->tda, 1);
%swiglal_array_dynamic_size(size_t, size1);
%swiglal_array_dynamic_size(size_t, size2);
%swiglal_array_dynamic_2D(TYPE, size_t, data, arg1->size1, arg1->size2, arg1->tda, 1);
} gsl_matrix##NAME;
%enddef // %lalswig_gsl_vector_matrix
......
......@@ -615,29 +615,42 @@ if (swiglal_release_parent(PTR)) {
%typemap(swiglal_dynarr_isptr) SWIGTYPE* "true";
%typemap(swiglal_dynarr_tinfo) SWIGTYPE* "$descriptor";
// Create immutable members for accessing the array's dimensions.
// NI is the name of the dimension member, and SIZET is its type.
%define %swiglal_array_dynamic_size(SIZET, NI)
%feature("action") NI {
result = %static_cast(arg1->NI, SIZET);
}
%extend {
const SIZET NI;
}
%feature("action", "") NI;
%enddef // %swiglal_array_dynamic_size()
// Check that array dimensions and strides are non-zero, otherwise fail.
%define %swiglal_array_dynamic_check_dims_strides(DATA, I)
if (dims[I-1] == 0 || strides[I-1] == 0) {
SWIG_exception_fail(SWIG_IndexError, "Size/stride of dimension "#I" of '"#DATA"' is zero");
}
%enddef // %swiglal_array_dynamic_check_dims_strides()
// The %swiglal_array_dynamic_<n>D() macros create typemaps which convert
// <n>-D dynamically-allocated arrays in structs. The macros must be
// added inside the definition of the struct, before the struct members
// comprising the array are defined. The DATA and N{I,J} members give
// the array data and dimensions, TYPE and SIZET give their respective
// types. The S{I,J} give the strides of the array, in number of elements.
// If the strides are members of the struct, 'arg1->' should be used to
// access the struct itself.
// If the sizes or strides are members of the struct, 'arg1->' should be
// used to access the struct itself.
// 1-D arrays:
%define %swiglal_array_dynamic_1D(TYPE, SIZET, DATA, NI, SI)
// Create immutable members for the array's dimensions.
%feature("action") NI {result = %static_cast(arg1->NI, SIZET);}
%extend {
const SIZET NI;
}
%feature("action", "") NI;
// Typemaps which convert to/from the dynamically-allocated array.
%typemap(in, noblock=1) TYPE* DATA {
if (arg1) {
const size_t dims[] = {arg1->NI};
const size_t dims[] = {NI};
const size_t strides[] = {SI};
%swiglal_array_dynamic_check_dims_strides(DATA, 1);
$1 = %reinterpret_cast(arg1->DATA, TYPE*);
// swiglal_array_typeid input type: $1_type
int ecode = %swiglal_array_copyin($1_type)(swiglal_self(), $input, %as_voidptr($1),
......@@ -651,8 +664,9 @@ if (swiglal_release_parent(PTR)) {
}
%typemap(out, noblock=1) TYPE* DATA {
if (arg1) {
const size_t dims[] = {arg1->NI};
const size_t dims[] = {NI};
const size_t strides[] = {SI};
%swiglal_array_dynamic_check_dims_strides(DATA, 1);
$1 = %reinterpret_cast(arg1->DATA, TYPE*);
// swiglal_array_typeid input type: $1_type
%set_output(%swiglal_array_viewout($1_type)(swiglal_self(), %as_voidptr($1),
......@@ -683,21 +697,13 @@ if (swiglal_release_parent(PTR)) {
// 2-D arrays:
%define %swiglal_array_dynamic_2D(TYPE, SIZET, DATA, NI, NJ, SI, SJ)
// Create immutable members for the array's dimensions.
%feature("action") NI {result = %static_cast(arg1->NI, SIZET);}
%feature("action") NJ {result = %static_cast(arg1->NJ, SIZET);}
%extend {
const SIZET NI;
const SIZET NJ;
}
%feature("action", "") NI;
%feature("action", "") NJ;
// Typemaps which convert to/from the dynamically-allocated array.
%typemap(in, noblock=1) TYPE* DATA {
if (arg1) {
const size_t dims[] = {arg1->NI, arg1->NJ};
const size_t dims[] = {NI, NJ};
const size_t strides[] = {SI, SJ};
%swiglal_array_dynamic_check_dims_strides(DATA, 1);
%swiglal_array_dynamic_check_dims_strides(DATA, 2);
$1 = %reinterpret_cast(arg1->DATA, TYPE*);
// swiglal_array_typeid input type: $1_type
int ecode = %swiglal_array_copyin($1_type)(swiglal_self(), $input, %as_voidptr($1),
......@@ -711,8 +717,10 @@ if (swiglal_release_parent(PTR)) {
}
%typemap(out, noblock=1) TYPE* DATA {
if (arg1) {
const size_t dims[] = {arg1->NI, arg1->NJ};
const size_t dims[] = {NI, NJ};
const size_t strides[] = {SI, SJ};
%swiglal_array_dynamic_check_dims_strides(DATA, 1);
%swiglal_array_dynamic_check_dims_strides(DATA, 2);
$1 = %reinterpret_cast(arg1->DATA, TYPE*);
// swiglal_array_typeid input type: $1_type
%set_output(%swiglal_array_viewout($1_type)(swiglal_self(), %as_voidptr($1),
......@@ -743,19 +751,37 @@ if (swiglal_release_parent(PTR)) {
// These macros should be called from within the definitions of
// LAL structs containing dynamically-allocated arrays.
// 1-D arrays:
// 1-D arrays, e.g:
// SIZET NI;
// TYPE* DATA;
%define %swiglal_public_1D_ARRAY(TYPE, DATA, SIZET, NI)
%swiglal_array_dynamic_1D(TYPE, SIZET, DATA, NI, 1);
%ignore DATA;
%ignore NI;
%swiglal_array_dynamic_size(SIZET, NI);
%swiglal_array_dynamic_1D(TYPE, SIZET, DATA, arg1->NI, 1);
%ignore DATA;
%ignore NI;
%enddef
#define %swiglal_public_clear_1D_ARRAY(TYPE, DATA, SIZET, NI)
// 2-D arrays:
// 2-D arrays of fixed-length arrays, e.g:
// typedef ETYPE[NJ] ATYPE;
// SIZET NI;
// ATYPE* DATA;
%define %swiglal_public_2D_ARRAY_FIXED(ETYPE, ATYPE, DATA, SIZET, NI)
%swiglal_array_dynamic_size(SIZET, NI);
%swiglal_array_dynamic_2D(ETYPE, SIZET, DATA, arg1->NI, (sizeof(ATYPE)/sizeof(ETYPE)), (sizeof(ATYPE)/sizeof(ETYPE)), 1);
%ignore DATA;
%ignore NI;
%enddef
#define %swiglal_public_clear_2D_ARRAY_FIXED(ETYPE, ATYPE, DATA, SIZET, NI)
// 2-D arrays, e.g:
// SIZET NI, NJ;
// TYPE* DATA;
%define %swiglal_public_2D_ARRAY(TYPE, DATA, SIZET, NI, NJ)
%swiglal_array_dynamic_2D(TYPE, SIZET, DATA, NI, NJ, arg1->NJ, 1);
%ignore DATA;
%ignore NI;
%ignore NJ;
%swiglal_array_dynamic_size(SIZET, NI);
%swiglal_array_dynamic_size(SIZET, NJ);
%swiglal_array_dynamic_2D(TYPE, SIZET, DATA, arg1->NI, arg1->NJ, arg1->NJ, 1);
%ignore DATA;
%ignore NI;
%ignore NJ;
%enddef
#define %swiglal_public_clear_2D_ARRAY(TYPE, DATA, SIZET, NI, NJ)
......
......@@ -320,8 +320,10 @@ iface_file.write('%%module %s;\n' % module_name)
iface_file.write('%include <lal/swiglal_common.i>\n')
# import dependent modules
iface_file.write('#ifndef SWIGIMPORTED\n')
for module in module_depends.split():
iface_file.write('%%import <lal/%sswig.i>\n' % module)
iface_file.write('#endif\n')
# include interface headers in wrapping code
iface_file.write('%header %{\n')
......
......@@ -17,6 +17,7 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
from __future__ import division
from __future__ import print_function
"""
Match sky maps with injections in an inspinjfind-style sqlite database and print
summary values for each sky map:
......@@ -27,113 +28,54 @@ summary values for each sky map:
* searched posterior probability
* angle between true sky location and maximum a posteriori estimate
* runtime in seconds
The filenames of the sky maps may be provided as positional command line
arguments, and may also be provided as globs (such as '*.fits.gz').
"""
__author__ = "Leo Singer <leo.singer@ligo.org>"
# Command line interface.
from optparse import Option, OptionParser
from lalinference.bayestar import command
if __name__ == '__main__':
# Command line interface.
from optparse import Option, OptionParser
from lalinference.bayestar import command
parser = OptionParser(
formatter=command.NewlinePreservingHelpFormatter(),
description=__doc__,
usage="%prog [-o OUTPUT] DATABASE.sqlite FILE1.fits[.gz] FILE2.fits[.gz] ...",
option_list=[
Option("-o", "--output", default="/dev/stdout",
help="Name of output file [default=%default]"),
Option("-j", "--jobs", default=1, type=int,
help="Number of threads [default=%default]")
]
)
opts, args = parser.parse_args()
try:
dbfilename = args[0]
fitsfileglobs = args[1:]
except IndexError:
parser.error("not enough command line arguments")
if opts.jobs < 1:
parser.error("invalid value for -j, --jobs: must be >= 1")
parser = OptionParser(
formatter=command.NewlinePreservingHelpFormatter(),
description=__doc__,
usage="%prog DATABASE.sqlite FILE1.fits[.gz] FILE2.fits[.gz] ...")
opts, args = parser.parse_args()
outfile = open(opts.output, "w")
try:
dbfilename = args[0]
fitsfilenames = args[1:]
except IndexError:
parser.error("not enough command line arguments")
# Imports.
import os
import numpy as np
import healpy as hp
import sqlite3
from pylal.progress import ProgressBar
from lalinference.bayestar import fits
from lalinference.bayestar import postprocess
sql = """
SELECT DISTINCT sim.longitude AS ra, sim.latitude AS dec, ci.combined_far AS far
FROM coinc_event_map AS cem1 INNER JOIN coinc_event_map AS cem2
ON (cem1.coinc_event_id = cem2.coinc_event_id)
INNER JOIN sim_inspiral AS sim ON (cem1.event_id = sim.simulation_id)
INNER JOIN coinc_inspiral AS ci ON (cem2.event_id = ci.coinc_event_id)
WHERE cem1.table_name = 'sim_inspiral' AND cem2.table_name = 'coinc_event'
AND cem2.event_id = ?"""
def angle_distance(theta0, phi0, theta1, phi1):
cos_angle_distance = np.cos(phi1 - phi0) * np.sin(theta0) * np.sin(theta1) + np.cos(theta0) * np.cos(theta1)
if cos_angle_distance > 1:
return 0.
elif cos_angle_distance < -1:
return np.pi
else:
return np.arccos(cos_angle_distance)
def find_injection(sky_map, true_ra, true_dec):
"""
Given a sky map and the true right ascension and declination (in radians),
find the smallest area in deg^2 that would have to be searched to find the
source, the smallest posterior mass, and the angular offset in degrees from
the true location to the maximum (mode) of the posterior.
"""
# Compute the HEALPix lateral resolution parameter for this sky map.
npix = len(sky_map)
nside = hp.npix2nside(npix)
# Convert from ra, dec to conventional spherical polar coordinates.
true_theta = 0.5 * np.pi - true_dec
true_phi = true_ra
# Find the HEALPix pixel index of the mode of the posterior and of the
# true sky location.
mode_pix = np.argmax(sky_map)
true_pix = hp.ang2pix(nside, true_theta, true_phi)
# Compute spherical polar coordinates of true location.
mode_theta, mode_phi = hp.pix2ang(nside, mode_pix)
def startup(dbfilename):
global db
db = sqlite3.connect(dbfilename)
# Sort the pixels in the sky map by descending posterior probability and
# form the cumulative sum. Record the total value.
indices = np.argsort(sky_map)[::-1]
cum_sky_map = np.cumsum(sky_map[indices])
# Find the index of the true location in the cumulative distribution.
idx = (i for i, pix in enumerate(indices) if pix == true_pix).next()
# Find the smallest area that would have to be searched to find the true
# location.
searched_area = (idx + 1) * hp.nside2pixarea(nside, degrees=True)
# Find the smallest posterior mass that would have to be searched to find
# the true location.
searched_prob = cum_sky_map[idx]
# Permute the cumulative distribution so that it is indexed the same way
# as the original sky map.
cum_sky_map[indices] = cum_sky_map
# Find the angular offset between the mode and true locations.
offset = np.rad2deg(angle_distance(true_theta, true_phi, mode_theta, mode_phi))
# Done.
return searched_area, searched_prob, offset
progress = ProgressBar()
progress.update(-1, 'opening database')
db = sqlite3.connect(dbfilename)
print 'objid,far,searched_area,searched_prob,offset,runtime'
for fitsfilename in progress.iterate(fitsfilenames):
def process(fitsfilename):
sky_map, metadata = fits.read_sky_map(fitsfilename)
coinc_event_id = metadata['objid']
......@@ -142,7 +84,46 @@ for fitsfilename in progress.iterate(fitsfilenames):
except KeyError:
runtime = None
true_ra, true_dec, far = db.execute(sql, (coinc_event_id,)).fetchone()
searched_area, searched_prob, offset = find_injection(sky_map, true_ra, true_dec)
print ','.join(str(item) for item in (coinc_event_id, far, searched_area, searched_prob, offset, runtime))
true_ra, true_dec, far = db.execute("""
SELECT DISTINCT sim.longitude AS ra, sim.latitude AS dec,
ci.combined_far AS far
FROM coinc_event_map AS cem1 INNER JOIN coinc_event_map AS cem2
ON (cem1.coinc_event_id = cem2.coinc_event_id)
INNER JOIN sim_inspiral AS sim ON (cem1.event_id = sim.simulation_id)
INNER JOIN coinc_inspiral AS ci ON (cem2.event_id = ci.coinc_event_id)
WHERE cem1.table_name = 'sim_inspiral'
AND cem2.table_name = 'coinc_event' AND cem2.event_id = ?""",
(coinc_event_id,)).fetchone()
searched_area, searched_prob, offset = postprocess.find_injection(
sky_map, true_ra, true_dec)
return coinc_event_id, far, searched_area, searched_prob, offset, runtime
if __name__ == '__main__':
import glob
import itertools
import pylal.progress
progress = pylal.progress.ProgressBar()
progress.update(-1, 'spawning {0} workers'.format(opts.jobs))
if opts.jobs == 1:
from itertools import imap
startup(dbfilename)
else:
import multiprocessing
imap = multiprocessing.Pool(opts.jobs, startup, (dbfilename,)).imap_unordered
progress.update(-1, 'obtaining filenames of sky maps')
fitsfilenames = tuple(itertools.chain.from_iterable(glob.iglob(fitsfileglob)
for fitsfileglob in fitsfileglobs))
print('objid', 'far', 'searched_area', 'searched_prob', 'offset', 'runtime',
sep=',', file=outfile)
count_records = 0
progress.max = len(fitsfilenames)
for record in imap(process, fitsfilenames):
count_records += 1
progress.update(count_records, record[0])
print(*record, sep=',', file=outfile)
......@@ -72,7 +72,7 @@ for i, log10_far in enumerate(range(log10_min_far, log10_max_far + 1)):
datasets = [dataset[dataset['far'] <= far] for dataset in datasets_]
# Compute titles and labels for plots.
labels = dataset_names
labels = tuple(r'\verb/{0}/'.format(name) for name in dataset_names)
title = r'$\mathrm{{FAR}} \leq 10^{{{0}}}$ Hz'.format(log10_far)
if len(args) == 1:
title += ' ({0} events)'.format(len(datasets[0]))
......
......@@ -22,6 +22,7 @@ from optparse import *
import tempfile
import ConfigParser
import urlparse
import itertools
sys.path.append('@PYTHONLIBDIR@')
##############################################################################
......@@ -155,23 +156,61 @@ def setup_coh_inspiral(ifo_name,ifo_char,insp_job,runSplitBank,calibrated,\
##############################################################################
#function to build the timeslides vector
def setup_timeslides(ifo_analyze, num_slides):
slide = {}
slide_offset = {}
range_offset = {}
#doing timeslides here
for ifo_name in ifo_analyze:
slide[ifo_name] = cp.get('input','%s-slide' % (ifo_name))
slide_offset[ifo_name] = cp.get('input','%s-slide-offset' % (ifo_name))
range_offset[ifo_name] = [i*int(slide[ifo_name]) + int(slide_offset[ifo_name]) for i in range(0, int(num_slides))]
ifo_keys = range_offset.keys()
# Initialise output
slide_vector = []
for elements in range(len(range_offset.values()[0])):
newDict={}
for detectors in range (len(range_offset.keys())):
newDict[ifo_keys[detectors]] = range_offset[ ifo_keys[detectors] ][elements]
slide_vector.append(newDict)
# Calculate the number of segments being used
# Note that this is the number of segments that coh_PTF will use for filtering
# This is not equal to the number of segments that tmpltbank might use for PSD
# estimation
block_duration = int(cp.get('coh_PTF_inspiral','block-duration'))
segment_duration = int(cp.get('coh_PTF_inspiral','segment-duration'))
number_segments = (block_duration * 2 / segment_duration) - 1
# Create a dictionary to hold offsets between pairs
offsetPairDict = {}
for i,ifo1 in enumerate(ifo_analyse):
for j,ifo2 in enumerate(ifo_analyse):
if ifo1 != ifo2 and i < j:
offsetPairDict[ifo1+ifo2] = [0]
# Begin looping over the possible offsets
start = [0 for i in range(len(ifo_analyse) - 1)]
stop = [number_segments for i in range(len(ifo_analyse) - 1)]
# I don't really know how this works, but it gives [0,0],[0,1] .. [0,len],
# [1,0],[1,1] ... [1,len],[2,0] ... [len,0] ... [len,len] for 3 ifos,
# for 4 it would be [0,0,0],[0,0,1] ... and so on
for offsetList in itertools.product(*[xrange(i, i+j) \
for i,j in zip(start, size)]):
currOffsets = [0].extend(offsetList)
print currOffsets
acceptSlide = True
for i,ifo1 in enumerate(ifo_analyse):
for j,ifo2 in enumerate(ifo_analyse):
if ifo1 != ifo2 and i < j:
ifoOffset = offsetList[i] - offsetList[j]
if ifoOffset < 0:
ifoOffset += number_segments
if ifoOffset in offsetPairDict[ifo1+ifo2].values():
acceptSlide = False
break
if not acceptSlide:
break
if acceptSlide:
print "Accepting:",currOffsets
# Add slide to list
slideDict = {}
for i,ifo in enumerate(ifo_analyse):
slideDict[ifo] = currOffsets[i]
slide_vector.append(slideDict)
# And update ifo-ifo delay lists
for i,ifo1 in enumerate(ifo_analyse):
for j,ifo2 in enumerate(ifo_analyse):
if ifo1 != ifo2 and i < j:
ifoOffset = offsetList[i] - offsetList[j]
if ifoOffset < 0:
ifoOffset += number_segments
offsetPairDict[ifo1+ifo2].append(ifoOffset)
return slide_vector
......@@ -221,13 +260,15 @@ def analyze_coh(ifo_list,ifo_data,ifo_to_do,tmplt_job,insp_job,df_job,\
data_opts[ifo_name] = 'ligo-data'
try:
type[ifo_name] = cp.get('input','ligo-type')
if (type[ifo_name] == 'RDS_R_L4') or ('RDS_C' in type[ifo_name]) or ('DMT_C' in type[ifo_name]) or ('LDAS_C' in type[ifo_name]):
if (type[ifo_name] == 'RDS_R_L4') or ('RDS_C' in type[ifo_name]) or \
('DMT_C' in type[ifo_name]) or ('LDAS_C' in type[ifo_name]):
type[ifo_name] = ifo_name + '_' + type[ifo_name]
except: type[ifo_name] = None
channel[ifo_name] = cp.get('input','ligo-channel')