예제 #1
0
def test_BBHStrain(LISA_prop1, aLIGO, SKA_WN, ET):
    source_1 = binary.BBHFrequencyDomain(M[0],
                                         q[0],
                                         z[0],
                                         x1[0],
                                         x2[0],
                                         instrument=LISA_prop1)
    source_2 = binary.BBHFrequencyDomain(M[1],
                                         q[1],
                                         z[1],
                                         x1[1],
                                         x2[1],
                                         instrument=aLIGO)
    source_3 = binary.BBHFrequencyDomain(M[2],
                                         q[2],
                                         z[2],
                                         x1[2],
                                         x2[2],
                                         instrument=SKA_WN)
    source_4 = binary.BBHFrequencyDomain(M[1],
                                         q[0],
                                         z[1],
                                         x1[1],
                                         x2[1],
                                         instrument=ET)
예제 #2
0
def test_BBHStrain(LISA_prop1, aLIGO, SKA_WN, ET):
    source_1 = binary.BBHFrequencyDomain(
        M[0],
        q[0],
        z[0],
        x1[0],
        x2[0],
        instrument=LISA_prop1,
        f_min=1e-6,
        f_max=10,
        nfreqs=int(1e3),
    )
    source_2 = binary.BBHFrequencyDomain(M[1],
                                         q[1],
                                         z[1],
                                         chi2=x2[1],
                                         instrument=aLIGO)
    source_3 = binary.BBHFrequencyDomain(M[2],
                                         q[2],
                                         z[2],
                                         x1[2],
                                         x2[2],
                                         instrument=SKA_WN)
    source_4 = binary.BBHFrequencyDomain(M[1],
                                         q[0],
                                         z[1],
                                         chi1=x1[1],
                                         instrument=ET)
    binary.Get_Char_Strain(source_1)
    binary.Get_Time_From_Merger(source_4,
                                freq=1 / u.yr,
                                in_frame="source",
                                out_frame="observer").to("yr")
    binary.Get_Time_From_Merger(source_2,
                                freq=1 / u.yr,
                                in_frame="source",
                                out_frame="source").to("yr")
    binary.Get_Time_From_Merger(source_2,
                                freq=1 / u.yr,
                                in_frame="observer",
                                out_frame="observer").to("yr")
    binary.Get_Mono_Char_Strain(
        source_2,
        np.max(source_2.instrument.T_obs).to("s"),
        inc=np.pi / 2,
        f_gw_frame="observer",
    )
    binary.Check_Freq_Evol(
        source_3,
        T_evol=np.max(source_3.instrument.T_obs).to("s"),
        T_evol_frame="source",
    )
    binary.Get_Mono_Strain(source_2)
    binary.Get_Mono_Strain(source_2, out_frame="observer")
예제 #3
0
def source_space_based():
    # M = m1+m2 Total Mass
    M = 1e6
    M_min = 1e1
    M_max = 1e10

    source_space_based = binary.BBHFrequencyDomain(M, q, z, chi1, chi2)
    source_space_based.M = [M, M_min, M_max]
    source_space_based.q = [q, q_min, q_max]
    source_space_based.chi1 = [chi1, chi_min, chi_max]
    source_space_based.chi2 = [chi2, chi_min, chi_max]
    source_space_based.z = [z, z_min, z_max]

    return source_space_based
예제 #4
0
def source_pta():
    # M = m1+m2 Total Mass
    M = 1e8
    M_min = 1e7
    M_max = 1e11

    source_pta = binary.BBHFrequencyDomain(M, q, z, chi1, chi2)
    source_pta.M = [M, M_min, M_max]
    source_pta.q = [q, q_min, q_max]
    source_pta.chi1 = [chi1, chi_min, chi_max]
    source_pta.chi2 = [chi2, chi_min, chi_max]
    source_pta.z = [z, z_min, z_max]

    return source_pta
예제 #5
0
def Get_Source(model):
    if model == 0 or model == 1:
        #M = m1+m2 Total Mass
        M = 1e2
        M_min = 1e0
        M_max = 1e5
    elif model == 2 or model == 3:
        #M = m1+m2 Total Mass
        M = 1e8
        M_min = 1e7
        M_max = 1e11
    else:
        #M = m1+m2 Total Mass
        M = 1e6
        M_min = 1e1
        M_max = 1e10

    #q = m2/m1 reduced mass
    q = 1.0
    q_min = 1.0
    q_max = 18.0

    #Chi = S_i*L/m_i**2, spins of each mass i
    chi1 = 0.0  #spin of m1
    chi2 = 0.0  #spin of m2
    chi_min = -0.85  #Limits of PhenomD for unaligned spins
    chi_max = 0.85

    z = 3.0  #Redshift
    z_min = 1e-2
    z_max = 1e3

    source = binary.BBHFrequencyDomain(M, q, chi1, chi2, z)
    source.M = [M, M_min, M_max]
    source.q = [q, q_min, q_max]
    source.chi1 = [chi1, chi_min, chi_max]
    source.chi2 = [chi2, chi_min, chi_max]
    source.z = [z, z_min, z_max]

    return source
예제 #6
0
def test_BBH_lalsuite_approx(LISA_prop1):
    approximant = "IMRPhenomD"
    lalsuite_kwargs = {"eccentricity": 0.5}
    delT_obs = 1 / 4 / u.yr
    delT_obs = delT_obs.to("1/s")

    source_6 = binary.BBHFrequencyDomain(M,
                                         q,
                                         z,
                                         approximant=approximant,
                                         lalsuite_kwargs=lalsuite_kwargs)
    source_6.f_min = 1e-7
    source_6.chi1 = 0.5
    source_6.chi2 = -0.2
    source_6.f_gw = 1e-3 * u.Hz
    [_, _] = waveform.Get_Waveform(
        source_6,
        approximant=approximant,
        pct_of_peak=0.01,
        lalsuite_kwargs=lalsuite_kwargs,
        out_frame="observer",
    )
    binary.Get_Char_Strain(source_6)

    lalsuite_kwargs.update({
        "approximant": "IMRPhenomPv3",
        "chi1": 0.0,
        "chi2": 0.2,
        "deltaF": delT_obs.value,
        "f_min": delT_obs.value,
        "f_max": delT_obs.value * 1e3,
        "f_ref": 0.1 * u.Hz,
    })
    source_7 = binary.BBHFrequencyDomain(M[0],
                                         q[0],
                                         z[0],
                                         lalsuite_kwargs=lalsuite_kwargs)
    source_7.f_gw = 1e-3 * u.Hz
    binary.Get_Char_Strain(source_7, in_frame="source", out_frame="observer")
    binary.Get_Char_Strain(source_7, in_frame="observer", out_frame="source")
    binary.Get_Char_Strain(source_7, in_frame="source", out_frame="source")

    lalsuite_kwargs_2 = {
        "m1": M[0] / (1 + q[0]) * u.M_sun.to("kg"),
        "m2": (M[0] * q[0] / (1 + q[0])) * u.M_sun.to("kg"),
        "S1x": 0,
        "S1y": 0,
        "S1z": x1[2],
        "S2x": 0,
        "S2y": 0,
        "S2z": x2[2],
        "distance": 7.146757481804179e27,
        "inclination": 0,
        "phiRef": 0,
        "longAscNodes": 0,
        "eccentricity": 0,
        "meanPerAno": 0,
        "deltaF": delT_obs,
        "f_min": delT_obs * 0.01,
        "f_max": delT_obs * 1e3,
        "f_ref": 0,
        "LALpars": {},
    }
    source_8 = binary.BBHFrequencyDomain(
        M[0],
        q[0],
        z[0],
        approximant=98,
        instrument=LISA_prop1,
        lalsuite_kwargs=lalsuite_kwargs_2,
    )
    [_, _] = waveform.Get_Waveform(
        source_8,
        approximant=98,
        pct_of_peak=0.01,
        lalsuite_kwargs=lalsuite_kwargs_2,
        out_frame="source",
    )

    waveform.Strain_Conv(
        source_8,
        source_8.f,
        source_8.h_f,
        inverse=True,
        in_frame="source",
        out_frame="observer",
    )
    waveform.Strain_Conv(
        source_8,
        source_8.f,
        source_8.h_f,
        inverse=True,
        in_frame="observer",
        out_frame="observer",
    )
    waveform.Strain_Conv(
        source_8,
        source_8.f,
        source_8.h_f,
        inverse=True,
        in_frame="source",
        out_frame="source",
    )
    waveform.Strain_Conv(
        source_8,
        source_8.f,
        source_8.h_f,
        inverse=True,
        in_frame="observer",
        out_frame="source",
    )
예제 #7
0
def test_BBH_Mono_Funcs():
    source_5 = binary.BBHFrequencyDomain(M[0], q[1], z[1], f_gw=1e-5 * u.Hz)
    source_5.chi1 = 0.0
    source_5.chi2 = 0.0
    source_5.f
    source_5.chi2 = 0.5
    source_5.h_f
    binary.Get_Mono_Char_Strain(source_5)
    binary.Get_Mono_Char_Strain(
        source_5,
        method="SPA",
        freq=source_5.f_gw,
        f_gw_frame="source",
        pn_frame="source",
        out_frame="observer",
        inc=np.pi / 2,
    )
    binary.Get_Mono_Char_Strain(
        source_5,
        method="SPA",
        freq=source_5.f_gw,
        f_gw_frame="source",
        pn_frame="source",
        out_frame="source",
        inc=np.pi / 2,
    )
    binary.Get_Mono_Char_Strain(
        source_5,
        method="SPA",
        freq=source_5.f_gw,
        f_gw_frame="source",
        pn_frame="source",
        out_frame="source",
        inc=np.pi / 2,
    )
    binary.Get_Mono_Char_Strain(
        source_5,
        method="SPA",
        f_gw_frame="observer",
        pn_frame="source",
        out_frame="source",
    )
    binary.Get_Mono_Char_Strain(
        source_5,
        method="PN",
        freq=source_5.f_gw,
        f_gw_frame="observer",
        pn_frame="source",
        out_frame="source",
    )
    binary.Get_Mono_Char_Strain(
        source_5,
        method="PN",
        freq=source_5.f_gw,
        f_gw_frame="source",
        pn_frame="observer",
        out_frame="source",
    )
    binary.Get_Mono_Strain(
        source_5,
        method="PN",
        freq=source_5.f_gw,
        f_gw_frame="source",
        pn_frame="observer",
        out_frame="source",
    )
    binary.Get_F_Dot(source_5,
                     freq=None,
                     in_frame="observer",
                     out_frame="observer")
    binary.Get_F_Dot(source_5,
                     freq=None,
                     in_frame="source",
                     out_frame="observer")
    binary.Get_F_Dot(source_5,
                     freq=None,
                     in_frame="observer",
                     out_frame="source")
    binary.Get_F_Dot(source_5,
                     freq=source_5.f_gw,
                     in_frame="source",
                     out_frame="source")
    binary.Check_Freq_Evol(
        source_5,
        T_evol=4 * u.yr.to("s"),
        T_evol_frame="observer",
        f_gw_frame="source",
    )
예제 #8
0
def test_BBH_arg_error():
    with pytest.raises(ValueError):
        binary.BBHFrequencyDomain(M[0], q[0], z[0], x1[0], x2[0], M[1])