setigen.funcs package
setigen.funcs.f_profiles module
Sample spectral profiles for signal injection.
For any given time sample, these functions map out the intensity in the frequency direction (centered at a particular frequency).
- setigen.funcs.f_profiles.box_f_profile(width)[source]
Square intensity profile in the frequency direction.
- Parameters:
width (float or astropy.Quantity) – Width of signal
- Returns:
f_profile
- Return type:
func
- setigen.funcs.f_profiles.gaussian_f_profile(width)[source]
Gaussian profile.
- Parameters:
width (float or astropy.Quantity) – FWHM of Gaussian profile
- Returns:
f_profile
- Return type:
func
- setigen.funcs.f_profiles.multiple_gaussian_f_profile(width)[source]
Example adding multiple Gaussians in the frequency direction.
- Parameters:
width (float or astropy.Quantity) – FWHM of Gaussian profile
- Returns:
f_profile
- Return type:
func
- setigen.funcs.f_profiles.lorentzian_f_profile(width)[source]
Lorentzian profile.
- Parameters:
width (float or astropy.Quantity) – FWHM of Lorentzian profile
- Returns:
f_profile
- Return type:
func
- setigen.funcs.f_profiles.voigt_f_profile(g_width, l_width)[source]
Voigt profile.
Further information here: https://en.wikipedia.org/wiki/Voigt_profile.
- Parameters:
g_width (float or astropy.Quantity) – FWHM of Gaussian profile
l_width (float or astropy.Quantity) – FWHM of Lorentzian profile
- Returns:
f_profile
- Return type:
func
- setigen.funcs.f_profiles.sinc2_f_profile(width, width_mode='crossing', trunc=True)[source]
Sinc squared profile; width is the FWHM of the squared normalized sinc function.
The trunc parameter controls whether or not the sinc squared profile is truncated at the first root (e.g. zeroed out for more distant frequencies).
Note that you can model an ideal cosine signal by using
width=2*frame.df
,width_mode="crossing"
, andtrunc=False
.- Parameters:
width (float or astropy.Quantity) – Signal width, in Hz
width_mode ({"crossing", "fwhm"}, default: "crossing") – How to interpret
width
. Can be “crossing” or “fwhm”, for zero crossing.trunc (bool, default: True) – Whether to truncate signal after first zero crossing
- Returns:
f_profile
- Return type:
func
setigen.funcs.paths module
Sample signal paths for signal injection.
For any given starting frequency, these functions map out the path of a signal as a function of time in time-frequency space.
- setigen.funcs.paths.constant_path(f_start, drift_rate)[source]
Constant drift rate.
- Parameters:
f_start (float or astropy.Quantity) – Starting center frequency
drift_rate (float or astropy.Quantity) – Doppler drift rate
- Returns:
path
- Return type:
func
- setigen.funcs.paths.squared_path(f_start, drift_rate)[source]
Quadratic signal path; drift_rate here only refers to the starting slope.
- Parameters:
f_start (float or astropy.Quantity) – Starting center frequency
drift_rate (float or astropy.Quantity) – Doppler drift rate
- Returns:
path
- Return type:
func
- setigen.funcs.paths.sine_path(f_start, drift_rate, period, amplitude)[source]
Sine path in time-frequency space.
- Parameters:
f_start (float or astropy.Quantity) – Starting center frequency
drift_rate (float or astropy.Quantity) – Doppler drift rate
period (float or astropy.Quantity) – Modulation period
amplitude (float or astropy.Quantity) – Modulation amplitude
- Returns:
path
- Return type:
func
- setigen.funcs.paths.simple_rfi_path(f_start, drift_rate, spread, spread_type='uniform', rfi_type='stationary', seed=None)[source]
A crude simulation of one style of RFI that shows up, in which the signal jumps around in frequency. This method samples the center frequency for each time sample from either a uniform or normal distribution.
- Parameters:
f_start (float or astropy.Quantity) – Starting center frequency
drift_rate (float or astropy.Quantity) – Doppler drift rate
spread (float or astropy.Quantity) – Range of center frequency variations
spread_type ({"uniform", "normal"}, default: "uniform") – Type of frequency variation
rfi_type ({"stationary", "random_walk"}, default: "stationary") – The “stationary” option only offsets with respect to a straight-line path, but “random_walk” accumulates frequency offsets over time.
seed (None, int, Generator, optional) – Random seed or seed generator
- Returns:
path
- Return type:
func
setigen.funcs.t_profiles module
Sample intensity profiles for signal injection.
These functions calculate the signal intensity and variation in the time direction.
- setigen.funcs.t_profiles.constant_t_profile(level=1)[source]
Constant intensity profile.
- Parameters:
level (float, default: 1) – Intensity level
- Returns:
t_profile
- Return type:
func
- setigen.funcs.t_profiles.sine_t_profile(period, phase=0, amplitude=1, level=1)[source]
Intensity varying as a sine curve.
- Parameters:
period (float or astropy.Quantity) – Modulation period
phase (float, default: 0) – Modulation phase
amplitude (float, default: 1) – Modulation amplitude
level (float, default: 1) – Mean intensity level
- Returns:
t_profile
- Return type:
func
- setigen.funcs.t_profiles.periodic_gaussian_t_profile(pulse_width, period, phase=0, pulse_offset_width=0, pulse_direction='rand', pnum=3, amplitude=1, level=1, min_level=0, seed=None)[source]
Intensity varying as Gaussian pulses, allowing for variation in the arrival time of each pulse.
- Parameters:
pulse_width (float or astropy.Quantity) – FWHM width of individual pulses
period (float or astropy.Quantity) – Baseline modulation period
phase (float or astropy.Quantity, default: 0) – Baseline modulation phase
pulse_offset_width (float or astropy.Quantity, default: 0) – FWHM of timing variation from the modulation period
pulse_direction ({"rand", "up", "down"}, default: "rand") – Whether the intensity increases or decreases from the baseline level
pnum (float or astropy.Quantity, default: 3) – Number of Gaussians pulses to consider when calculating the intensity at each timestep. The higher this number, the more accurate the intensities.
amplitude (float, default: 1) – Pulse magnitude
level (float, default: 1) – Baseline intensity level
min_level (float, default: 0) – Minimum intensity level
seed (None, int, Generator, optional) – Random seed or seed generator
- Returns:
t_profile
- Return type:
func
setigen.funcs.bp_profiles module
setigen.funcs.func_utils module
- setigen.funcs.func_utils.lorentzian(x, x0, gamma)[source]
Basic Lorentzian function centered at
x0
.