Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
5f46885
hyperbolic analysis implementation
chadhenshaw May 6, 2024
cc163fa
single_inject with hyperbolic options
chadhenshaw May 6, 2024
849af53
further changes for hyperbolic analysis
chadhenshaw May 7, 2024
c2d455a
prevent duplicate coords in puffball
chadhenshaw May 8, 2024
0e6e5c7
fixed memory for ILE_extr
chadhenshaw May 10, 2024
3215dd2
xmlutils + pseudo_pipe event_dict fix
chadhenshaw May 14, 2024
79e9521
xmlutils fix 2
chadhenshaw May 14, 2024
d99c61d
Merge remote-tracking branch 'upstream/rift_O4b_JL' into rift_O4b_JL
chadhenshaw May 14, 2024
56600c1
extrinsic and submit fixes
chadhenshaw May 22, 2024
7e28d3f
peak finding for scatter/capture/plunge tapering
chadhenshaw May 28, 2024
bfe7531
hyperbolic params in coinc
chadhenshaw Jun 4, 2024
30406fa
removed sys exit when EOBRun_module not found
chadhenshaw Jun 5, 2024
cdd6803
removed problematic print statement
chadhenshaw Jun 5, 2024
0d287d2
Merge remote-tracking branch 'upstream/rift_O4b_JL' into rift_O4b_JL
chadhenshaw Jun 26, 2024
b45c476
hyperbolic epoch fix
chadhenshaw Jul 16, 2024
e4ac410
mtot coords
chadhenshaw Jul 26, 2024
0f81d7f
alt start and mtot edits
chadhenshaw Jul 26, 2024
1bd3e01
mtot implementation 2
chadhenshaw Jul 26, 2024
21ea3d6
mtot implementation 3
chadhenshaw Jul 26, 2024
90849b9
mtot coord minor fix
chadhenshaw Aug 12, 2024
1f7c871
puff + mtot fix
chadhenshaw Aug 27, 2024
c752f68
tapering change in hoft, NOT hlmoft
chadhenshaw Sep 4, 2024
a4eb550
hoft epoch peak fix, no hlmoft
chadhenshaw Sep 11, 2024
df163bd
reverting hoft change in lalsimutils, adding hlmoft to WriteFrame
chadhenshaw Sep 25, 2024
06cce41
one more hyp_wav instance
chadhenshaw Sep 25, 2024
6b2bc52
adjusted peak finder to deal with non-interacting cases
chadhenshaw Nov 6, 2024
a18b8b8
add prominence to hlmoft epoch find
chadhenshaw Nov 22, 2024
09e03b9
tapering order change and Lmax to kwaargs
chadhenshaw Jan 10, 2025
1c48bbe
hypclass initial commit
chadhenshaw Jan 10, 2025
9df5344
force-scatter option in overlapgrid
chadhenshaw Jan 10, 2025
8ad3d68
removing print statements
chadhenshaw Jan 20, 2025
5efd90e
add --force-scatter-grids option
chadhenshaw Jan 20, 2025
cf7bc1a
add --force-scatter to puffball
chadhenshaw Jan 20, 2025
54d8255
fix conditional in --force-scatter
chadhenshaw Jan 20, 2025
3835376
add --force-scatter to CIP
chadhenshaw Jan 20, 2025
3bfc660
add --force-scatter-grids
chadhenshaw Jan 20, 2025
d1c21ca
added --hyperbolic option to skip tapering
chadhenshaw Jan 20, 2025
151d47c
update to end tapering in hlmoft
chadhenshaw Jan 31, 2025
fa6df13
fixed conditional for opts.save_hyperbolic
chadhenshaw Feb 4, 2025
6d466f2
plunge/scatter class fix 1
chadhenshaw Feb 7, 2025
9dab1fb
classifier updates
chadhenshaw Feb 21, 2025
b7f70f9
add verbose option
chadhenshaw Feb 21, 2025
4a8697f
zero window and split seglen
chadhenshaw Feb 21, 2025
3281ce6
hypclass unit fix
chadhenshaw Feb 21, 2025
b27bfe8
add option to force 22 mode only
chadhenshaw Feb 21, 2025
87434b4
remove unnecessary print statement
chadhenshaw Feb 21, 2025
92340e6
added --force-plunge grids and --force-zoomwhirl grids
chadhenshaw Feb 21, 2025
6f61267
removed mc_range_str_cip from use_mtot_coords logic
chadhenshaw Apr 8, 2025
dff4f65
added E0 and p_phi0
chadhenshaw Apr 21, 2025
7dbd967
impact parameter and scattering angle
chadhenshaw Jul 4, 2025
802a86d
fixed latex translation for b_hyp, phi_scatter
chadhenshaw Jul 4, 2025
b4682cf
added b_hyp
chadhenshaw Jul 4, 2025
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
462 changes: 437 additions & 25 deletions MonteCarloMarginalizeCode/Code/RIFT/lalsimutils.py

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def PrecomputeLikelihoodTerms(event_time_geo, t_window, P, data_dict,
extra_waveform_kwargs={},
use_gwsignal=False,
use_gwsignal_approx=None,
use_external_EOB=False,nr_lookup=False,nr_lookup_valid_groups=None,no_memory=True,perturbative_extraction=False,perturbative_extraction_full=False,hybrid_use=False,hybrid_method='taper_add',use_provided_strain=False,ROM_group=None,ROM_param=None,ROM_use_basis=False,ROM_limit_basis_size=None,skip_interpolation=False):
use_external_EOB=False,nr_lookup=False,nr_lookup_valid_groups=None,no_memory=True,perturbative_extraction=False,perturbative_extraction_full=False,hybrid_use=False,hybrid_method='taper_add',use_provided_strain=False,ROM_group=None,ROM_param=None,ROM_use_basis=False,ROM_limit_basis_size=None,skip_interpolation=False,**kwargs):
"""
Compute < h_lm(t) | d > and < h_lm | h_l'm' >

Expand All @@ -142,6 +142,10 @@ def PrecomputeLikelihoodTerms(event_time_geo, t_window, P, data_dict,
rholms_intp = {}
crossTerms = {}
crossTermsV = {}

if kwargs.get('force_22_mode', False):
# forcing 22 mode only for hyperbolic case
force_22_mode = True

# Compute hlms at a reference distance, distance scaling is applied later
P.dist = distMpcRef*1e6*lsu.lsu_PC
Expand Down Expand Up @@ -198,7 +202,7 @@ def PrecomputeLikelihoodTerms(event_time_geo, t_window, P, data_dict,
elif use_gwsignal and (has_GWS): # this MUST be called first, so the P.approx is never tested
if not quiet:
print( " FACTORED LIKELIHOOD WITH hlmoff (GWsignal) " )
hlms, hlms_conj = rgws.std_and_conj_hlmoff(P,Lmax,approx_string=use_gwsignal_approx,**extra_waveform_kwargs)
hlms, hlms_conj = rgws.std_and_conj_hlmoff(P,Lmax,approx_string=use_gwsignal_approx,force_22_mode=force_22_mode,**extra_waveform_kwargs)

elif (not nr_lookup) and (not NR_group) and ( P.approx ==lalsim.SEOBNRv2 or P.approx == lalsim.SEOBNRv1 or P.approx==lalsim.SEOBNRv3 or P.approx == lsu.lalSEOBv4 or P.approx ==lsu.lalSEOBNRv4HM or P.approx == lalsim.EOBNRv2 or P.approx == lsu.lalTEOBv2 or P.approx==lsu.lalTEOBv4 ):
# note: alternative to this branch is to call hlmoff, which will actually *work* if ChooseTDModes is propertly implemented for that model
Expand Down Expand Up @@ -250,7 +254,7 @@ def PrecomputeLikelihoodTerms(event_time_geo, t_window, P, data_dict,
# hlms_conj = lsu.SphHarmFrequencySeries_to_dict(hlms_conj_list, Lmax) # a dictionary
# else:
# hlms_conj = hlms_conj_list
hlms, hlms_conj = lsu.std_and_conj_hlmoff(P,Lmax,**extra_waveform_kwargs)
hlms, hlms_conj = lsu.std_and_conj_hlmoff(P,Lmax,force_22_mode=force_22_mode,**extra_waveform_kwargs)
elif (nr_lookup or NR_group) and useNR:
# look up simulation
# use nrwf to get hlmf
Expand Down
42 changes: 42 additions & 0 deletions MonteCarloMarginalizeCode/Code/RIFT/misc/samples_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,18 @@ def extract_combination_from_LI(samples_LI, p):
a = a[8:]
if a =='q' and 'm1' in samples_LI.dtype.names:
return samples_LI["m1"]/samples_LI["m2"]

if p == 'b_hyp':
samples = np.array([samples_LI["m1"], samples_LI["m2"], samples_LI["a1x"], samples_LI["a1y"], samples_LI["a1z"], samples_LI["a2x"], samples_LI["a2y"], samples_LI["a2z"], samples_LI["E0"], samples_LI["p_phi0"]]).T
with Pool(12) as pool:
b_hyp = np.array(pool.map(f_b_hyp, samples))
return b_hyp

if p == 'phi_scatter':
samples = np.array([samples_LI["m1"], samples_LI["m2"], samples_LI["a1x"], samples_LI["a1y"], samples_LI["a1z"], samples_LI["a2x"], samples_LI["a2y"], samples_LI["a2z"], samples_LI["E0"], samples_LI["p_phi0"]]).T
with Pool(12) as pool:
phi_scatter = np.array(pool.map(f_phi_scatter, samples))
return phi_scatter

print(" No access for parameter ", p)
return np.zeros(len(samples_LI['m1'])) # to avoid causing a hard failure
Expand Down Expand Up @@ -272,3 +284,33 @@ def fchip(sample):
P.s2z = sample[7]
chip = P.extract_param('chi_p')
return chip

def f_b_hyp(sample):
P=lalsimutils.ChooseWaveformParams()
P.m1 = sample[0]
P.m2 = sample[1]
P.s1x = sample[2]
P.s1y = sample[3]
P.s1z = sample[4]
P.s2x = sample[5]
P.s2y = sample[6]
P.s2z = sample[7]
P.E0 = sample[8]
P.p_phi0 = sample[9]
b_hyp = P.extract_param('b_hyp')
return b_hyp

def f_phi_scatter(sample):
P=lalsimutils.ChooseWaveformParams()
P.m1 = sample[0]
P.m2 = sample[1]
P.s1x = sample[2]
P.s1y = sample[3]
P.s1z = sample[4]
P.s2x = sample[5]
P.s2y = sample[6]
P.s2z = sample[7]
P.E0 = sample[8]
P.p_phi0 = sample[9]
phi_scatter = P.extract_param('phi_scatter')
return phi_scatter
2 changes: 2 additions & 0 deletions MonteCarloMarginalizeCode/Code/RIFT/misc/xmlutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ def assign_time(row, t):
"joint_prior": "alpha2",
"joint_s_prior": "alpha3",
"eccentricity":"alpha4",
"E0":"psi3",
"p_phi0":"beta",
"lambda1":"alpha5",
"lambda2":"alpha6",
"spin1x":"spin1x",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ optp.add_option("--export-eos",action='store_true',help="Include EOS index param
optp.add_option("--export-cosmology",action='store_true',help="Include source frame masses and redshift")
optp.add_option("--export-weights",action='store_true',help="Include a field 'weights' equal to L p/ps")
optp.add_option("--export-eccentricity", action="store_true", help="Include eccentricity")
optp.add_option("--export-hyperbolic", action="store_true", help="Include eccentricity")
optp.add_option("--export-hyperbolic", action="store_true", help="Include E0 and p_phi0")
optp.add_option("--with-cosmology",default="Planck15",help="Specific cosmology to use")
optp.add_option("--use-interpolated-cosmology",action='store_true',help="Specific cosmology to use")
optp.add_option("--convention",default="RIFT",help="RIFT|LI")
Expand Down Expand Up @@ -99,10 +99,11 @@ if opts.convention == 'LI':

if opts.export_eccentricity:
ecc = [row.alpha4 for row in points]

if opts.export_hyperbolic:
p_phi0 = [row.beta for row in points]
E0 = [row.psi3 for row in points]


wt = np.exp(like)*p/ps
neff_here = np.sum(wt)/np.max(wt) # neff for this file. Assumes NOT mixed samples: dangerous
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ for indx in np.arange(opts.target_size):
P = lalsimutils.ChooseWaveformParams(m1=m1,m2=m2,dist=d)
if "eccentricity" in samples_in.dtype.names:
P.eccentricity = samples_in["eccentricity"][fac_reduce*indx]
if "E0" in samples_in.dtype.names:
P.E0 = samples_in["E0"][fac_reduce*indx]
if "p_phi0" in samples_in.dtype.names:
P.p_phi0 = samples_in["p_phi0"][fac_reduce*indx]
if "time_maxl" in samples_in.dtype.names:
P.tref = samples_in["time_maxl"][fac_reduce*indx]
elif 'time' in samples_in.dtype.names:
Expand Down
Loading