Skip to content

burstfit.utils.functions

[view_source]

gauss

def gauss(x, S, mu, sigma)

[view_source]

Gaussian function with area S

Arguments:

  • x - input array to evaluate the function
  • S - Area of the gaussian
  • mu - mean of the gaussian
  • sigma - sigma of the gaussian

Returns:

gauss_norm

def gauss_norm(x, mu, sig)

[view_source]

Gaussian function of unit area

Arguments:

  • x - input array
  • mu - center of the gaussian
  • sig - sigma of gaussian

Returns:

gauss_norm2

def gauss_norm2(x, mu1, sig1, mu2, sig2, amp1)

[view_source]

Two gaussian functions of unit total area

Arguments:

  • x - input array
  • mu1 - mean of gaussian1
  • sig1 - sigma of gaussian1
  • mu2 - mean of gaussian2
  • sig2 - sigma of gaussian2
  • amp1 - amplitude of gaussian1

Returns:

gauss_norm3

def gauss_norm3(x, mu1, sig1, mu2, sig2, mu3, sig3, amp1, amp2)

[view_source]

Three gaussian functions of unit total area

Arguments:

  • x - input array
  • mu1 - mean of gaussian1
  • sig1 - sigma of gaussian1
  • mu2 - mean of gaussian2
  • sig2 - sigma of gaussian2
  • mu3 - mean of gaussian3
  • sig3 - sigma of gaussian3
  • amp1 - amplitude of gaussian1
  • amp2 - amplitude of gaussian2

Returns:

pulse_fn

def pulse_fn(t, S, mu, sigma, tau)

[view_source]

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 array
  • S - Area of the pulse (fluence)
  • mu - mean of gaussian
  • sigma - sigma of gaussian
  • tau - scattering timescale

Returns:

pulse_fn_vec

def pulse_fn_vec(t, S, mu, sigma, tau)

[view_source]

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 array
  • S - Area of the pulse (fluence)
  • mu - means of gaussians for each channel
  • sigma - sigma of gaussian
  • tau - 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)

[view_source]

Spectrogram function

Arguments:

  • metadata - Some useful metadata (nt, nf, dispersed_at_dm, tsamp, fstart, foff)
  • pulse_function - Function to model pulse
  • spectra_function - Function to model spectra
  • spectra_params - Dictionary with spectra parameters
  • pulse_params - Dictionary with pulse parameters
  • other_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)

[view_source]

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 pulse
  • spectra_function - Function to model spectra
  • spectra_params - Dictionary with spectra parameters
  • pulse_params - Dictionary with pulse parameters
  • other_params - list of other params needed for this function (eg: [dm])

Returns: