Commit 685434f6 authored by Leo Pound Singer's avatar Leo Pound Singer

Move pycbc DYN_RANGE_FAC from script to module

Original: 564d85137512e2662bb91e6125ac7c99c5df2e3d
parent d9150de8
......@@ -123,9 +123,6 @@ if opts.psd_files: # read pycbc psds here
from glue.segments import segment, segmentlist
import h5py
# FIXME: This should be imported from pycbc.
DYN_RANGE_FAC = 5.9029581035870565e+20
class psd_segment(segment):
def __new__(cls, psd, *args):
return segment.__new__(cls, *args)
......@@ -156,7 +153,7 @@ if opts.psd_files: # read pycbc psds here
fseries = lal.CreateREAL8FrequencySeries(
'psd', psd.attrs['epoch'], kmin * df, df,
lal.StrainUnit**2 / lal.HertzUnit, len(psd.value) - kmin)
fseries.data.data = psd.value[kmin:] / np.square(DYN_RANGE_FAC)
fseries.data.data = psd.value[kmin:] / np.square(ligolw_bayestar.PYCBC_DYN_RANGE_FAC)
return timing.InterpolatedPSD(
filter.abscissa(fseries), fseries.data.data,
......
......@@ -45,6 +45,11 @@ InspiralCoincDef = lsctables.CoincDef(search = u"inspiral", search_coinc_type =
InspiralSCExactCoincDef = lsctables.CoincDef(search = u"inspiral", search_coinc_type = 3, description = u"sim_inspiral<-->coinc_event coincidences (exact)")
# FIXME: This should be imported from pycbc, or even better, embedded in the
# pycbc PSD files.
PYCBC_DYN_RANGE_FAC = 5.9029581035870565e+20
def get_template_bank_f_low(xmldoc):
"""Determine the low frequency cutoff from a template bank file,
whether the template bank was produced by lalapps_tmpltbank or
......
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