}
    phasing *= pfaN / v5;
    phasing -=  LAL_PI_4;
    phasing -= int(phasing / (LAL_TWOPI)) * LAL_TWOPI;

    float pcos;
    float psin;
    __sincosf(phasing, &psin, &pcos);

    htilde[i]._M_re = pcos * amp2;
    htilde[i]._M_im = - psin * amp2;
"""

taylorf2_kernel = ElementwiseKernel(
    """pycuda::complex<float> *htilde, int kmin, int phase_order,
                                       float delta_f, float piM, float pfaN,
                                       float pfa2, float pfa3, float pfa4, float pfa5, float pfl5,
                                       float pfa6, float pfl6, float pfa7, float amp""",
    taylorf2_text,
    "SPAtmplt",
    preamble=preamble,
    options=pkg_config_header_strings(['lal']))


def spa_tmplt_engine(htilde, kmin, phase_order, delta_f, piM, pfaN, pfa2, pfa3,
                     pfa4, pfa5, pfl5, pfa6, pfl6, pfa7, amp_factor):
    """ Calculate the spa tmplt phase
    """
    taylorf2_kernel(htilde.data, kmin, phase_order, delta_f, piM, pfaN, pfa2,
                    pfa3, pfa4, pfa5, pfl5, pfa6, pfl6, pfa7, amp_factor)
Beispiel #2
0
    amp = amp0 * sqrt(-dEnergy/flux) * v;

    htilde[i]._M_re = amp * cos(phasing - LAL_PI_4) ;
    htilde[i]._M_im = - amp * sin(phasing - LAL_PI_4);

"""

taylorf2_kernel = ElementwiseKernel("""pycuda::complex<double> *htilde, int kmin, int phase_order,
                                       int amplitude_order, double delta_f, double piM, double pfaN, 
                                       double pfa2, double pfa3, double pfa4, double pfa5, double pfl5,
                                       double pfa6, double pfl6, double pfa7, double FTaN, double FTa2, 
                                       double FTa3, double FTa4, double FTa5, double FTa6,
                                       double FTl6, double FTa7, double dETaN, double dETa1, double dETa2, double dETa3,
                                       double amp0, double tC, double phi0""",
                    taylorf2_text, "taylorf2_kernel",
                    preamble=preamble, options=pkg_config_header_strings(['lal']))

def taylorf2(**kwds):
    """ Return a TaylorF2 waveform using CUDA to generate the phase and amplitude
    """
    # Pull out the input arguments
    delta_f = kwds['delta_f']
    distance = kwds['distance']
    mass1 = kwds['mass1']
    mass2 = kwds['mass2']
    phase_order = int(kwds['phase_order'])
    amplitude_order = int(kwds['amplitude_order'])
    phi0 = kwds['phi0']

    tC= -1.0 / delta_f 
Beispiel #3
0
    amp = amp0 * sqrt(-dEnergy/flux) * v;

    htilde[i]._M_re = amp * cos(phasing - LAL_PI_4) ;
    htilde[i]._M_im = - amp * sin(phasing - LAL_PI_4);

"""

taylorf2_kernel = ElementwiseKernel("""pycuda::complex<double> *htilde, int kmin, int phase_order,
                                       int amplitude_order, double delta_f, double piM, double pfaN, 
                                       double pfa2, double pfa3, double pfa4, double pfa5, double pfl5,
                                       double pfa6, double pfl6, double pfa7, double FTaN, double FTa2, 
                                       double FTa3, double FTa4, double FTa5, double FTa6,
                                       double FTl6, double FTa7, double dETaN, double dETa1, double dETa2, double dETa3,
                                       double amp0, double tC, double phi0""",
                    taylorf2_text, "taylorf2_kernel",
                    preamble=preamble, options=pkg_config_header_strings(['lal']))

def taylorf2(**kwds):
    """ Return a TaylorF2 waveform using CUDA to generate the phase and amplitude
    """
    # Pull out the input arguments
    f_lower = kwds['f_lower']
    delta_f = kwds['delta_f']
    distance = kwds['distance']
    mass1 = kwds['mass1']
    mass2 = kwds['mass2']
    phase_order = int(kwds['phase_order'])
    amplitude_order = int(kwds['amplitude_order'])
    phi0 = kwds['phi0']

    tC= -1.0 / delta_f