-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgenwave.py
89 lines (73 loc) · 3.92 KB
/
genwave.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
import numpy as np
from pycbc.types import TimeSeries, FrequencySeries
#from pycbc.waveform.utils import taper_timeseries
from pyseobnr.generate_waveform import GenerateWaveform
def gen_seobnrv5e_td(**p):
p.update({
"approximant": "SEOBNRv5EHM", # I call it "SEOBNRv5E" in PyCBC
"ModeArray": [(2,2)], # only consider (2,2) mode
"rel_anomaly": p["rel_anomaly"], # relativity anomaly, needed for eccentric waveform
"phi_ref": p["coa_phase"], # reference phase needed by SEOBNRv5
"f22_start": p["f_lower"], # starting frequency
"f_ref": p["f_lower"], # reference frequency
"deltaT": p["delta_t"],
#"postadiabatic": False , # turn off postadiabatic correction,
# default is False in SEOBNRv5EHM
#"h_0": 1.0, # initial time step in the integration of the ODEs.
# Default Value is 1.0
"lmax_nyquist": 1 # maximum L to be checked against Nyquist frequency
})
waveform = GenerateWaveform(p)
hp, hc = waveform.generate_td_polarizations_conditioned_1()
# Build the PyCBC TimeSeries format
hp = TimeSeries(hp.data.data[:], delta_t=hp.deltaT, epoch=hp.epoch)
hc = TimeSeries(hc.data.data[:], delta_t=hc.deltaT, epoch=hc.epoch)
return hp,hc
def gen_seobnrv5e_fd(**p):
p.update({
"approximant": "SEOBNRv5EHM",
"ModeArray": [(2,2)], # only consider (2,2) mode
"rel_anomaly": p["rel_anomaly"] if "rel_anomaly" in p else 0, # relativity anomaly, needed for eccentric waveform
"phi_ref": p["coa_phase"], # reference phase needed by SEOBNRv5
"f22_start": p["f_lower"], # starting frequency
"f_ref": p["f_lower"], # reference frequency
"deltaF": p["delta_f"],
#"postadiabatic": False , # turn off postadiabatic correction,
# default is False in SEOBNRv5EHM
#"h_0": 1.0, # initial time step in the integration of the ODEs.
# Default Value is 1.0
"lmax_nyquist": 1 # maximum L to be checked against Nyquist frequency
})
waveform = GenerateWaveform(p)
hp, hc, template_duration = waveform.generate_fd_polarizations()
# Build the PyCBC TimeSeries format
hp_pycbc = FrequencySeries(hp.data.data[:], delta_f=hp.deltaF, epoch=hp.epoch)
hc_pycbc = FrequencySeries(hc.data.data[:], delta_f=hc.deltaF, epoch=hp.epoch)
hp_pycbc.eob_template_duration = template_duration
hc_pycbc.eob_template_duration = template_duration
return hp_pycbc,hc_pycbc
def gen_seobnrv5ehm_fd(**p):
p.update({
"approximant": "SEOBNRv5EHM",
"rel_anomaly": p["rel_anomaly"] if "rel_anomaly" in p else 0, # relativity anomaly, needed for eccentric waveform
"phi_ref": p["coa_phase"], # reference phase needed by SEOBNRv5
"f22_start": p["f_lower"], # starting frequency
"f_ref": p["f_lower"], # reference frequency
"deltaF": p["delta_f"],
})
waveform = GenerateWaveform(p)
hp, hc, template_duration = waveform.generate_fd_polarizations()
# Build the PyCBC TimeSeries format
hp_pycbc = FrequencySeries(hp.data.data[:], delta_f=hp.deltaF, epoch=hp.epoch)
hc_pycbc = FrequencySeries(hc.data.data[:], delta_f=hc.deltaF, epoch=hp.epoch)
hp_pycbc.eob_template_duration = template_duration
hc_pycbc.eob_template_duration = template_duration
return hp_pycbc,hc_pycbc
def seobnrv5phm_length_in_time(**kwds):
from pycbc.waveform.waveform import get_hm_length_in_time
return get_hm_length_in_time('SEOBNRv5', 5, **kwds)
#def seobnrv5e_length_in_time(**kwds):
# from pycbc.waveform.waveform import get_waveform_filter_length_in_time
# if "approximant" in kwds:
# kwds.pop("approximant")
# return get_waveform_filter_length_in_time(approximant='SEOBNRv5_ROM', **kwds)