Skip to content

Commit 65c958a

Browse files
committed
example: fixed likelihood call
1 parent d97dafb commit 65c958a

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

example/GW150914_IMRPhenomPV2.py

+11-4
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,26 @@
4949
psd_end = gps + 2048
5050

5151
# define frequency integration bounds for the likelihood
52+
# we set fmax to 87.5% of the Nyquist frequency to avoid
53+
# data corrupted by the GWOSC antialiasing filter
54+
# (Note that Data.from_gwosc will pull data sampled at
55+
# 4096 Hz by default)
5256
fmin = 20.0
53-
fmax = 1000.0
57+
fmax = 896.0
5458

5559
ifos = [H1, L1]
5660

5761
for ifo in ifos:
62+
# set analysis data
5863
data = jd.Data.from_gwosc(ifo.name, start, end)
5964
ifo.set_data(data)
6065

66+
# set PSD (Welch estimate)
6167
psd_data = jd.Data.from_gwosc(ifo.name, psd_start, psd_end)
6268
psd_fftlength = data.duration * data.sampling_frequency
6369
ifo.set_psd(psd_data.to_psd(nperseg=psd_fftlength))
6470

71+
# define the approximant to use
6572
waveform = RippleIMRPhenomPv2(f_ref=20)
6673

6774
###########################################
@@ -154,7 +161,7 @@
154161

155162

156163
likelihood = TransientLikelihoodFD(
157-
[H1, L1], waveform=waveform, trigger_time=gps, duration=4, post_trigger_duration=2
164+
[H1, L1], waveform=waveform, f_min=fmin, f_max=fmax, trigger_time=gps
158165
)
159166

160167

@@ -163,8 +170,8 @@
163170
# mass_matrix = mass_matrix.at[9, 9].set(1e-3)
164171
local_sampler_arg = {"step_size": mass_matrix * 1e-3}
165172

166-
Adam_optimizer = optimization_Adam(
167-
n_steps=3000, learning_rate=0.01, noise_level=1)
173+
# Adam_optimizer = optimization_Adam(
174+
# n_steps=3000, learning_rate=0.01, noise_level=1)
168175

169176

170177
n_epochs = 20

src/jimgw/single_event/likelihood.py

+3
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ def __init__(
4747
post_trigger_duration: Float = 2,
4848
**kwargs,
4949
) -> None:
50+
# NOTE: having 'kwargs' here makes it very difficult to diagnose
51+
# errors and keep track of what's going on, would be better to list
52+
# explicitly what the arguments are accepted
5053
self.detectors = detectors
5154

5255
# make sure data has a Fourier representation

0 commit comments

Comments
 (0)