burstfit.utils.functions
gauss
def gauss(x, S, mu, sigma)
Gaussian function with area S
Arguments:
x
- input array to evaluate the functionS
- Area of the gaussianmu
- mean of the gaussiansigma
- sigma of the gaussian
Returns:
gauss_norm
def gauss_norm(x, mu, sig)
Gaussian function of unit area
Arguments:
x
- input arraymu
- center of the gaussiansig
- sigma of gaussian
Returns:
gauss_norm2
def gauss_norm2(x, mu1, sig1, mu2, sig2, amp1)
Two gaussian functions of unit total area
Arguments:
x
- input arraymu1
- mean of gaussian1sig1
- sigma of gaussian1mu2
- mean of gaussian2sig2
- sigma of gaussian2amp1
- amplitude of gaussian1
Returns:
gauss_norm3
def gauss_norm3(x, mu1, sig1, mu2, sig2, mu3, sig3, amp1, amp2)
Three gaussian functions of unit total area
Arguments:
x
- input arraymu1
- mean of gaussian1sig1
- sigma of gaussian1mu2
- mean of gaussian2sig2
- sigma of gaussian2mu3
- mean of gaussian3sig3
- sigma of gaussian3amp1
- amplitude of gaussian1amp2
- amplitude of gaussian2
Returns:
pulse_fn
def pulse_fn(t, S, mu, sigma, tau)
Function of the pulse profile: Gaussian convolved with an exponential tail (see https://arxiv.org/pdf/1404.6593.pdf, equation 4, for more details)
Arguments:
t
- input arrayS
- Area of the pulse (fluence)mu
- mean of gaussiansigma
- sigma of gaussiantau
- scattering timescale
Returns:
pulse_fn_vec
def pulse_fn_vec(t, S, mu, sigma, tau)
Vectorized implementation of pulse profile function: Gaussian convolved with an exponential tail (see https://arxiv.org/pdf/1404.6593.pdf, equation 4, for more details)
Arguments:
t
- input arrayS
- Area of the pulse (fluence)mu
- means of gaussians for each channelsigma
- sigma of gaussiantau
- scattering timescale for each channel
Returns:
2D spectrogram with pulse profiles
sgram_fn
def sgram_fn(metadata, pulse_function, spectra_function, spectra_params, pulse_params, other_params)
Spectrogram function
Arguments:
metadata
- Some useful metadata (nt, nf, dispersed_at_dm, tsamp, fstart, foff)pulse_function
- Function to model pulsespectra_function
- Function to model spectraspectra_params
- Dictionary with spectra parameterspulse_params
- Dictionary with pulse parametersother_params
- list of other params needed for this function (eg: [dm])
Returns:
sgram_fn_vec
def sgram_fn_vec(metadata, pulse_function, spectra_function, spectra_params, pulse_params, other_params)
Vectorized implementation of spectrogram function. Assumes the following input names for pulse_function: S, mu, sigma, tau
Arguments:
metadata
- Some useful metadata (nt, nf, dispersed_at_dm, tsamp, fstart, foff)pulse_function
- Function to model pulsespectra_function
- Function to model spectraspectra_params
- Dictionary with spectra parameterspulse_params
- Dictionary with pulse parametersother_params
- list of other params needed for this function (eg: [dm])
Returns: