sigpyproc.simulation.furby#
Furby class for generating mock FRB signals.
This module contains the Furby class for generating mock FRB signals.
Classes
Container object to handle the simulated FRB signal. |
|
Class to generate mock FRB signals with noise-free templates. |
|
Container object to handle pulse simulation parameters. |
|
Container object to store the statistics of the simulated pulse. |
|
Class to simulate various spectral structures for the radio bursts. |
- class sigpyproc.simulation.furby.Furby(block, params_hdr, stats_hdr)[source]#
Bases:
objectContainer object to handle the simulated FRB signal.
- Parameters:
- block
FilterbankBlock FilterbankBlock object containing the simulated FRB signal.
- params_hdr
PulseParams PulseParams object containing the simulation parameters.
- stats_hdr
PulseStats PulseStats object containing the computed statistics.
- block
- 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#
- class sigpyproc.simulation.furby.FurbyGenerator(hdr, params, nsamps_out=None)[source]#
Bases:
objectClass 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:
- hdr
Header Header object containing the observation metadata.
- params
PulseParams PulseParams object containing the simulation parameters.
- nsamps_out
int, optional Total number of samples desired in the output mock signal, by default None.
- hdr
- Attributes:
hdrInput header object.
hdr_osHeader with the oversampled time resolution.
nsamps_outDesired number of samples in the output data.
paramsPulse parameters object.
tsamp_osOversampled 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 params#
Pulse parameters object.
- Returns:
PulseParamsPulseParams object.
- property nsamps_out#
Desired number of samples in the output data.
- Returns:
intNumber of samples in the output data.
- 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:
objectContainer object to handle pulse simulation parameters.
- Parameters:
- dm
float Dispersion measure of the FRB.
- snr
float Signal-to-noise ratio of the FRB.
- width
float Expected width of the pulse in seconds (FWHM in case of Gaussian).
- shape
str, optional The shape of the intrinsic pulse profile, by default ‘gaussian’.
- disp_ind
float, optional Dispersion index of the ISM, by default -2.0.
- scatt_idx
float, optional Power-law index to scale the tau0 in each channel, by default -4.4 (Kolmogorov-like spectrum).
- tau0
float, optional Decay timescale of the scattering kernel at central frequency, by default 1e-3 seconds.
- spec_kind
Literal[“flat”, “power_law”, “smooth_envelope”, “gaussian”, “polynomial_peaks”, “scintillation”, “gaussian_blobs”, “random”], optional Kind of the desired spectral structure, by default ‘flat’.
- spec_idx
float, optional Spectral index for the power-law spectrum, by default -2.0.
- os_fact
int, optional Oversampling factor in time, by default 10.
- noise
float, 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.
- dm
- 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:
objectContainer 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:
objectClass to simulate various spectral structures for the radio bursts.
Generates spectral patterns with customisable characteristics, including frequency-dependent effects and various structural types.
- Parameters:
- freqs
numpy.ndarray 1-D numpy array containing the frequency values of each channel (in MHz).
- kind
Literal[“flat”, “power_law”, “smooth_envelope”, “gaussian”, “polynomial_peaks”, “scintillation”, “gaussian_blobs”, “random”], optional The kind of the desired frequency structure, by default “scintillation”.
- spec_index
float, optional Spectral index for the power-law component, by default -2.0.
- seed
int, optional Seed for the random number generator, by default None.
- freqs
- Attributes:
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:
ndarray1-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:
- spec
np.ndarray, optional 1-D numpy array containing the spectral structure to plot, by default None.
- figsize
tuple[int,int], optional Figure size in inches, by default (8, 6).
- spec
- Returns:
FigureMatplotlib axes object containing the plot.