Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
6916603
Propogate tags to minifollowup jobs (#3667)
dethodav Mar 10, 2021
5a80df7
Fix missing bits from #3057 (#3663)
titodalcanton Mar 10, 2021
152637c
speed up field array access when using eval (#3655)
ahnitz Mar 10, 2021
03fd404
make it easier to load data and models (#3668)
Mar 10, 2021
1ccf96e
add intended python requirement (#3666)
ahnitz Mar 10, 2021
5354d34
Fix bug in final_spin_from_initial (#3650)
Mar 10, 2021
1be2a9d
Remove unnecessary execution bits from .py files (#3664)
titodalcanton Mar 11, 2021
87ecd4d
add option to make saving data optional (#3669)
ahnitz Mar 11, 2021
95d1876
updates to relative model (#3649)
ahnitz Mar 11, 2021
836e93d
fix polarization marginalization normalization in single template mod…
ahnitz Mar 11, 2021
138ee11
fix loop on failed attribute (#3670)
ahnitz Mar 12, 2021
9ba3ad1
simple convenience plot method (#3672)
ahnitz Mar 12, 2021
6cd8c3f
Fix a couple more LISA problems (#3674)
spxiwh Mar 14, 2021
bf5fef1
add function to call phenomhm modes directly
Apr 6, 2018
a52216c
add inverse_psd function
Apr 8, 2018
f093f8a
add ability to generate individual modes to FilterBank
Apr 8, 2018
55cd266
add dict giving approximants that allow individual modes to be generated
Apr 8, 2018
1452296
bug fix
Apr 8, 2018
48e1f41
add HM chisq
Apr 8, 2018
ee04b87
add support for HM chisq to pycbc_inspiral
Apr 8, 2018
5eef757
fix bugs
Apr 8, 2018
2c1e2a5
more bug fixes
Apr 8, 2018
0c6864f
more bugs
Apr 9, 2018
40278c9
various bug fixes
Apr 12, 2018
f65bcda
write the hm chisq out to file
Apr 12, 2018
1e9b7d0
prune modes that are 0; expect list of snrs rather than time series
Apr 14, 2018
437fe37
pass normalized SNR
Apr 14, 2018
fa3ee52
add combined chisq
Apr 14, 2018
17a6108
add plotting support
Apr 14, 2018
07dc180
fix default in errorbar
Apr 16, 2018
b5de53e
fix time shifting
May 18, 2018
a9367e2
raise error if kmin and kmax are the same
May 22, 2018
6eab6cf
deal with negative durations
May 22, 2018
2a01fb6
whiten template when computing coefficients
May 25, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bin/inference/pycbc_inference_plot_posterior
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ if opts.plot_prior is not None:
for func, param in fp.attrs['remapped_params']:
try:
remapped_params[param] = prior_samples[func]
except (NameError, TypeError):
except (NameError, TypeError, AttributeError):
continue
prior_samples = FieldArray.from_kwargs(**remapped_params)
for param in fp.attrs['static_params']:
Expand Down Expand Up @@ -184,7 +184,7 @@ if opts.plot_injection_parameters:
for p in parameters:
try:
vals = injections[p]
except (NameError, TypeError):
except (NameError, TypeError, AttributeError):
# injection doesn't have this parameter, skip
logging.warn("Could not find injection parameter {}".format(p))
continue
Expand Down
1 change: 0 additions & 1 deletion bin/plotting/pycbc_plot_range
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ for psd_file in args.psd_files:
pylab.errorbar((start+end)/2, ranges[wf_key], xerr=(end-start)/2,
ecolor=pycbc.results.ifo_color(ifo), label=label,
fmt='none')

pylab.legend(loc="best", fontsize='small')

if len(args.approximant) == 1:
Expand Down
48 changes: 48 additions & 0 deletions bin/pycbc_inspiral
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import pycbc
import pycbc.version
from pycbc import vetoes, psd, waveform, strain, scheme, fft, DYN_RANGE_FAC, events
from pycbc.vetoes.sgchisq import SingleDetSGChisq
from pycbc.vetoes.basischisq import SingleDetHMChisq, SingleDetCombinedChisq
from pycbc.filter import MatchedFilterControl, make_frequency_series, qtransform
from pycbc.types import TimeSeries, FrequencySeries, zeros, float32, complex64
import pycbc.version
Expand Down Expand Up @@ -207,6 +208,8 @@ fft.insert_fft_option_group(parser)
pycbc.opt.insert_optimization_option_group(parser)
pycbc.inject.insert_injfilterrejector_option_group(parser)
SingleDetSGChisq.insert_option_group(parser)
SingleDetHMChisq.insert_option_group(parser)
SingleDetCombinedChisq.insert_option_group(parser)
opt = parser.parse_args()

# Check that the values returned for the options make sense
Expand Down Expand Up @@ -267,6 +270,8 @@ with ctx:
'psd_var_val' : float32,
}
out_types.update(SingleDetSGChisq.returns)
out_types.update(SingleDetHMChisq.returns)
out_types.update(SingleDetCombinedChisq.returns)
out_vals = {key: None for key in out_types}
names = sorted(out_vals.keys())

Expand Down Expand Up @@ -371,6 +376,29 @@ with ctx:

sg_chisq = SingleDetSGChisq.from_cli(opt, bank, opt.chisq_bins)

hm_chisq = SingleDetHMChisq.from_cli(opt)

combined_chisq = SingleDetCombinedChisq.from_cli(opt)

# create scratch space for modes
if hm_chisq.do or combined_chisq.do:
approxs = numpy.unique(bank.table.approximant)
modesmem_cache = {}
for apprx in approxs:
# check that we can
try:
modes = waveform.hm_approximants[apprx]
except KeyError:
raise ValueError("cannot generate individual modes for "
"approximant {}".format(apprx))
modemem = {mode: template_mem.copy() for mode in modes}
modesmem_cache[apprx] = modemem
# whiten data
wh_segments = [seg * seg.psd**0.5 for seg in segments]
else:
wh_segments = [None]*len(segments)
modesmem_cache = {}

ntemplates = len(bank)
nfilters = 0

Expand All @@ -390,6 +418,14 @@ with ctx:
t_num += tnum_start
tmplt_generated = False

# Turn on individual modes generation if calculating HM Chisq
if hm_chisq.do:
apprx = bank.table.approximant[t_num]
bank.modes_out = modesmem_cache[apprx]
bank.generate_modes = bank.modes_out.keys()
else:
bank.generate_modes = None

for s_num, stilde in enumerate(segments):
# Filter check checks the 'inj_filter_rejector' options to
# determine whether
Expand Down Expand Up @@ -439,6 +475,18 @@ with ctx:
out_vals['chisq_dof'],
idx+stilde.analyze.start)

out_vals['hm_chisq'], out_vals['hm_chisq_dof'] = \
hm_chisq.values(template, wh_segments[s_num], stilde.psd,
norm*snrv,
idx+stilde.analyze.start,
data_whitening='whitened')

out_vals['combined_chisq'], out_vals['combined_chisq_dof'] = \
combined_chisq.values(template, wh_segments[s_num], stilde.psd,
norm*snrv,
idx+stilde.analyze.start,
data_whitening='whitened')

out_vals['cont_chisq'] = \
autochisq.values(snr, idx+stilde.analyze.start, template,
stilde.psd, norm, stilde=stilde,
Expand Down
8 changes: 4 additions & 4 deletions pycbc/conversions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1215,10 +1215,10 @@ def get_final_from_initial(mass1, mass2, spin1x=0., spin1y=0., spin1z=0.,
final_mass = numpy.zeros(mass1.shape)
final_spin = numpy.zeros(mass1.shape)
for ii in range(final_mass.size):
m1 = mass1[ii]
m2 = mass2[ii]
spin1 = [spin1x[ii], spin1y[ii], spin1z[ii]]
spin2 = [spin2x[ii], spin2y[ii], spin2z[ii]]
m1 = numpy.float(mass1[ii])
m2 = numpy.float(mass2[ii])
spin1 = list(map(float, [spin1x[ii], spin1y[ii], spin1z[ii]]))
spin2 = list(map(float, [spin2x[ii], spin2y[ii], spin2z[ii]]))
_, fm, fs = lalsim.SimIMREOBFinalMassSpin(m1, m2, spin1, spin2,
getattr(lalsim, approximant))
final_mass[ii] = fm * (m1 + m2)
Expand Down
Loading