sigpyproc.simulation.furby#

Furby class for generating mock FRB signals.

This module contains the Furby class for generating mock FRB signals.

Classes

Furby

Container object to handle the simulated FRB signal.

FurbyGenerator

Class to generate mock FRB signals with noise-free templates.

PulseParams

Container object to handle pulse simulation parameters.

PulseStats

Container object to store the statistics of the simulated pulse.

SpectralStructure

Class to simulate various spectral structures for the radio bursts.

class sigpyproc.simulation.furby.Furby(block, params_hdr, stats_hdr)[source]#

Bases: object

Container object to handle the simulated FRB signal.

Parameters:
blockFilterbankBlock

FilterbankBlock object containing the simulated FRB signal.

params_hdrPulseParams

PulseParams object containing the simulation parameters.

stats_hdrPulseStats

PulseStats object containing the computed statistics.

Attributes:
block
params_hdr
stats_hdr

Methods

from_file(filename)

Load a simulated FRB signal from a HDF5 file.

plot([figsize])

Plot the Furby simulated FRB signal.

save(filename)

Save the simulated FRB signal to a HDF5 file.

Notes

The simulated FRB signal is stored as a 2D array representing the time-frequency profile of the FRB. The object can be saved to a HDF5 file for later use.

block#
params_hdr#
stats_hdr#
save(filename)[source]#

Save the simulated FRB signal to a HDF5 file.

Parameters:
filenamestr | Path

Path to the output HDF5 file.

Returns:
str

Saved HDF5 file name.

plot(figsize=(12, 6))[source]#

Plot the Furby simulated FRB signal.

Parameters:
figsizetuple[int, int], optional

Figure size in inches, by default (12, 6).

Returns:
Figure

Matplotlib figure object containing the plot.

classmethod from_file(filename)[source]#

Load a simulated FRB signal from a HDF5 file.

Parameters:
filenamestr | Path

Path to the input HDF5 file.

Returns:
Furby

Furby object containing the loaded FRB signal.

class sigpyproc.simulation.furby.FurbyGenerator(hdr, params, nsamps_out=None)[source]#

Bases: object

Class to generate mock FRB signals with noise-free templates.

Simulates noise-free templates of mock FRB according to the requested pulse parameters. The class generates a 2D array representing the time-frequency profile of the FRB.

Parameters:
hdrHeader

Header object containing the observation metadata.

paramsPulseParams

PulseParams object containing the simulation parameters.

nsamps_outint, optional

Total number of samples desired in the output mock signal, by default None.

Attributes:
hdr

Input header object.

hdr_os

Header with the oversampled time resolution.

nsamps_out

Desired number of samples in the output data.

params

Pulse parameters object.

tsamp_os

Oversampled time resolution of the data.

Methods

generate()

Generate a realistic 2D FRB signal with noise.

References

[1]

Gupta, V., et al. (2020), “Real-time injection of mock FRBs”, https://arxiv.org/abs/2011.10191

property hdr#

Input header object.

Returns:
Header

Header object.

property params#

Pulse parameters object.

Returns:
PulseParams

PulseParams object.

property nsamps_out#

Desired number of samples in the output data.

Returns:
int

Number of samples in the output data.

property hdr_os#

Header with the oversampled time resolution.

Returns:
Header

Header object.

property tsamp_os#

Oversampled time resolution of the data.

Returns:
float

Time resolution of the data after oversampling.

generate()[source]#

Generate a realistic 2D FRB signal with noise.

Returns:
Furby

Furby object containing the simulated FRB signal.

class sigpyproc.simulation.furby.PulseParams(*, dm, snr, width, shape=attr_dict['shape'].default, dmsmear=attr_dict['dmsmear'].default, disp_ind=attr_dict['disp_ind'].default, scatt_idx=attr_dict['scatt_idx'].default, tau0=attr_dict['tau0'].default, spec_kind=attr_dict['spec_kind'].default, spec_idx=attr_dict['spec_idx'].default, os_fact=attr_dict['os_fact'].default, noise=attr_dict['noise'].default)[source]#

Bases: object

Container object to handle pulse simulation parameters.

Parameters:
dmfloat

Dispersion measure of the FRB.

snrfloat

Signal-to-noise ratio of the FRB.

widthfloat

Expected width of the pulse in seconds (FWHM in case of Gaussian).

shapestr, optional

The shape of the intrinsic pulse profile, by default ‘gaussian’.

disp_indfloat, optional

Dispersion index of the ISM, by default -2.0.

scatt_idxfloat, optional

Power-law index to scale the tau0 in each channel, by default -4.4 (Kolmogorov-like spectrum).

tau0float, optional

Decay timescale of the scattering kernel at central frequency, by default 1e-3 seconds.

spec_kindLiteral[“flat”, “power_law”, “smooth_envelope”, “gaussian”,

“polynomial_peaks”, “scintillation”, “gaussian_blobs”, “random”], optional Kind of the desired spectral structure, by default ‘flat’.

spec_idxfloat, optional

Spectral index for the power-law spectrum, by default -2.0.

os_factint, optional

Oversampling factor in time, by default 10.

noisefloat, optional

rms of the noise onto which this burst would be added. Used to normalise the height of the simulated furby, by default 0.0.

Attributes:
disp_ind
dm
dmsmear
noise
os_fact
scatt_idx
shape
snr
spec_idx
spec_kind
tau0
width

Notes

Over-sampling factor is used to generate a more accurate representation of the pulse, especially in those cases where the requested width is of the order of ~1 sample.

dm#
snr#
width#
shape#
dmsmear#
disp_ind#
scatt_idx#
tau0#
spec_kind#
spec_idx#
os_fact#
noise#
class sigpyproc.simulation.furby.PulseStats(*, top_hat_width, box_width, box_snr, gaus_width, gaus_snr, template_snr, norm, width_eff)[source]#

Bases: object

Container object to store the statistics of the simulated pulse.

Parameters:
top_hat_width: float

Width of the top-hat window in seconds.

box_width: float

Width of the best boxcar template in seconds.

box_snr: float

Signal-to-noise ratio for the best boxcar template.

gaus_width: float

Width of the best Gaussian template in seconds.

gaus_snr: float

Signal-to-noise ratio for the best Gaussian template.

template_snr: float

Signal-to-noise ratio for the input template.

norm: float

Normalisation factor for the simulated pulse.

width_eff: float

Effective width of the pulse after accounting for dispersion and smearing.

Attributes:
box_snr
box_width
gaus_snr
gaus_width
norm
template_snr
top_hat_width
width_eff
top_hat_width#
box_width#
box_snr#
gaus_width#
gaus_snr#
template_snr#
norm#
width_eff#
class sigpyproc.simulation.furby.SpectralStructure(freqs, kind='scintillation', spec_index=-2.0, seed=None)[source]#

Bases: object

Class to simulate various spectral structures for the radio bursts.

Generates spectral patterns with customisable characteristics, including frequency-dependent effects and various structural types.

Parameters:
freqsnumpy.ndarray

1-D numpy array containing the frequency values of each channel (in MHz).

kindLiteral[“flat”, “power_law”, “smooth_envelope”, “gaussian”,

“polynomial_peaks”, “scintillation”, “gaussian_blobs”, “random”], optional The kind of the desired frequency structure, by default “scintillation”.

spec_indexfloat, optional

Spectral index for the power-law component, by default -2.0.

seedint, optional

Seed for the random number generator, by default None.

Attributes:
foff

Frequency offset between two adjacent channels.

nchans

Number of frequency channels.

Methods

generate()

Generate the desired spectral structure.

plot([spec, figsize])

Plot the generated spectral structure.

Notes

Supported spectral structures are: - flat: Equal gain, no evolution with frequency (unless spec_index != 0). - power_law: Gains follow a power-law with the given spectral index. - smooth_envelope: Smooth Gaussian-like envelope. - gaussian: Single Gaussian profile. - polynomial_peaks: Polynomial with random peaks, degree 2-5. - scintillation: Sinusoidal (scintillating) profile. - gaussian_blobs: Patchy profile with Gaussian blobs. - random: Randomly selects one of the above.

The power-law weight (freqs / freqs[0]) ** spec_index is applied to all spectra. Set spec_index=0 for no power-law weighting.

property nchans#

Number of frequency channels.

property foff#

Frequency offset between two adjacent channels.

generate()[source]#

Generate the desired spectral structure.

Returns:
ndarray

1-D numpy array containing the simulated spectral structure.

Notes

The simulated spectrum is normalised to have a minimum of 0 and a maximum of 1. Then the spectrum is shifted to have a mean of 1 to conserve the total signal after averaging along the frequency axis.

plot(spec=None, figsize=(8, 6))[source]#

Plot the generated spectral structure.

Parameters:
specnp.ndarray, optional

1-D numpy array containing the spectral structure to plot, by default None.

figsizetuple[int, int], optional

Figure size in inches, by default (8, 6).

Returns:
Figure

Matplotlib axes object containing the plot.