Core¶
blipss.core.compare_cands
¶
Cross-file comparison and clustering of FFA candidate periods.
Pipeline¶
- Filter: For each input candidate file, retain only fundamental-flagged candidates whose S/N exceeds a pointing-specific threshold.
- Merge: Concatenate filtered candidates across all files, tagged with a source file index.
- Group: For each spectral channel, cluster candidate periods via Friends-of-Friends and keep the highest-S/N representative per cluster.
- Encode: Build an N-file binary detection code for each surviving cluster, where the i-th digit is '1' if file i contributed a candidate to that cluster and '0' otherwise.
Results from all channels are merged and returned by group_candidates_by_channel.
filter_fundamental_candidates(channels, radiofreqs, phase_bins, boxcar_widths, periods, snrs, flags, snr_threshold)
¶
Retain fundamental-flagged candidates whose S/N exceeds a detection threshold.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
channels
|
NDArray[intp]
|
Spectral channel index of each candidate. |
required |
radiofreqs
|
NDArray[floating]
|
Radio frequency (MHz) of each candidate. |
required |
phase_bins
|
NDArray[uint]
|
Number of phase bins in the folded profile for each candidate. |
required |
boxcar_widths
|
NDArray[uint]
|
Best-fit boxcar widths in phase bins for each candidate. |
required |
periods
|
NDArray[floating]
|
Best-fit periods in seconds for each candidate. |
required |
snrs
|
NDArray[floating]
|
Peak signal-to-noise ratios for each candidate. |
required |
flags
|
NDArray[str_]
|
Harmonic classification label for each candidate. |
required |
snr_threshold
|
float
|
Minimum S/N for a candidate to be retained. |
required |
Returns:
| Type | Description |
|---|---|
NDArray[intp]
|
Tuple of (channels, radiofreqs, phase_bins, boxcar_widths, periods, snrs) for |
NDArray[floating]
|
candidates flagged as fundamental with S/N at or above |
Source code in blipss/core/compare_cands.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | |
group_candidates_by_channel(file_index, channels, radiofreqs, phase_bins, boxcar_widths, periods, snrs, n_files, cluster_radius, n_jobs=1)
¶
Cluster candidate periods within each spectral channel and assign a detection code to each.
Candidates are sorted by channel once up front, so each channel's rows are a contiguous slice
rather than being re-selected with a fresh channels == ch scan of the full array per channel.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_index
|
NDArray[intp]
|
Source file index of each merged candidate. |
required |
channels
|
NDArray[intp]
|
Spectral channel index of each merged candidate. |
required |
radiofreqs
|
NDArray[floating]
|
Radio frequency (MHz) of each merged candidate. |
required |
phase_bins
|
NDArray[uint]
|
Number of phase bins in the folded profile for each merged candidate. |
required |
boxcar_widths
|
NDArray[uint]
|
Best-fit boxcar widths in phase bins for each merged candidate. |
required |
periods
|
NDArray[floating]
|
Best-fit periods in seconds for each merged candidate. |
required |
snrs
|
NDArray[floating]
|
Peak signal-to-noise ratios for each merged candidate. |
required |
n_files
|
int
|
Total number of input files being compared. |
required |
cluster_radius
|
float
|
Friends-of-Friends clustering radius (s) applied to periods. |
required |
n_jobs
|
int
|
Number of worker processes for channel clustering. 1 (default) runs sequentially in-process; -1 uses all available CPU cores; any other positive value is used as-is. |
1
|
Returns:
| Type | Description |
|---|---|
NDArray[intp]
|
Tuple of (channels, radiofreqs, phase_bins, boxcar_widths, periods, snrs, codes) |
NDArray[floating]
|
merged across all channels, one entry per surviving period cluster. |
Source code in blipss/core/compare_cands.py
219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 | |
blipss.core.compute_phase_resolved_ds
¶
Atomic data-manipulation routines for the phase-resolved dynamic spectrum pipeline.
These functions implement the internal (n_channels, n_samples) array representation:
extract_waterfall_metadata: Pull start MJD, tsamp, and frequency axis from a Waterfall header.align_band_orientation: Flip data and frequency axis so frequencies increase monotonically.clip_channels: Select a contiguous channel sub-band by index.fold_all_channels: Fold each channel time series in parallel with riptide and return the 2-D phase-resolved DS.
align_band_orientation(data, freqs_MHz, foff)
¶
Flip data and frequency arrays so that channel index 0 corresponds to the lowest frequency.
When foff is negative the Waterfall stores channels in descending frequency order. This function normalises to ascending order so that downstream code can treat index 0 as the lowest frequency unconditionally.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
NDArray[floating]
|
2-D data array of shape (n_channels, n_samples). |
required |
freqs_MHz
|
NDArray[floating]
|
1-D frequency array of shape (n_channels,). |
required |
foff
|
float
|
Channel bandwidth in MHz; negative indicates descending frequency order. |
required |
Returns:
| Type | Description |
|---|---|
tuple[NDArray[floating], NDArray[floating]]
|
Tuple of (data, freqs_MHz) flipped along the channel axis when foff < 0, otherwise unchanged. |
Source code in blipss/core/compute_phase_resolved_ds.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | |
clip_channels(data, freqs_MHz, start_ch, stop_ch)
¶
Restrict data and frequency arrays to a contiguous range of channel indices.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
NDArray[floating]
|
2-D data array of shape (n_channels, n_samples). |
required |
freqs_MHz
|
NDArray[floating]
|
1-D frequency array of shape (n_channels,). |
required |
start_ch
|
int
|
First channel index to include (inclusive). |
required |
stop_ch
|
int | None
|
Last channel index to exclude (exclusive); None retains all remaining channels. |
required |
Returns:
| Type | Description |
|---|---|
tuple[NDArray[floating], NDArray[floating]]
|
Tuple of (data[start_ch:stop_ch], freqs_MHz[start_ch:stop_ch]). |
Raises:
| Type | Description |
|---|---|
ValueError
|
If start_ch is outside [0, n_channels) or stop_ch does not satisfy start_ch < stop_ch <= n_channels. |
Source code in blipss/core/compute_phase_resolved_ds.py
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | |
extract_waterfall_metadata(wat)
¶
Extract the radio frequency axis, observation start MJD, and sampling interval from a Waterfall header.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
wat
|
Waterfall
|
Blimpy Waterfall object containing the loaded filterbank data. |
required |
Returns:
| Type | Description |
|---|---|
NDArray[floating]
|
Tuple of |
float
|
|
float
|
|
tuple[NDArray[floating], float, float]
|
|
Source code in blipss/core/compute_phase_resolved_ds.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | |
fold_all_channels(data, tsamp, period, bins, do_deredden, rmed_width, n_workers=None)
¶
Fold each spectral channel's time series in parallel to produce a phase-resolved dynamic spectrum.
Ensures a C-contiguous memory layout before dispatching channel rows to worker processes. Each channel is optionally detrended with a running-median filter, normalised to zero median and unit standard deviation, then folded using riptide.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
NDArray[floating]
|
2-D data array of shape (n_channels, n_samples). |
required |
tsamp
|
float
|
Sampling interval in seconds. |
required |
period
|
float
|
Folding period in seconds. |
required |
bins
|
int
|
Number of phase bins in the folded profile. |
required |
do_deredden
|
bool
|
Apply running-median detrending before folding when True. |
required |
rmed_width
|
float
|
Running median window width in seconds; used only when do_deredden is True. |
required |
n_workers
|
int | None
|
Number of parallel worker processes; None uses all available CPUs. |
None
|
Returns:
| Type | Description |
|---|---|
NDArray[floating]
|
2-D phase-resolved dynamic spectrum of shape (n_channels, bins). |
Source code in blipss/core/compute_phase_resolved_ds.py
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 | |
blipss.core.harmonic_detection
¶
Utilities for identifying and labeling harmonic and sub-harmonic relationships among a set of candidate periods.
Terminology¶
Given a fundamental period p0:
- The (N-1)th harmonic of p0 is a period P such that
P ≈ p0 / N(N >= 2). - The (N-1)th sub-harmonic of p0 is a period P such that
P ≈ N * p0(N >= 2).
Algorithm¶
label_harmonics uses a greedy approach: the unlabeled period with the
highest S/N is selected as a fundamental ('F'), all of its harmonics ('H') and
sub-harmonics ('S') present in the input are labeled and removed from
consideration, then the process repeats on the remaining periods until every
period has been assigned a label.
label_harmonics(periods, snrs, epsilon_harmonic=DEFAULT_EPSILON_HARMONIC, presorted=False)
¶
label_harmonics(
periods: npt.NDArray[np.floating],
snrs: npt.NDArray[np.floating],
epsilon_harmonic: float = ...,
presorted: Literal[False] = ...,
) -> tuple[
npt.NDArray[np.str_],
npt.NDArray[np.floating],
npt.NDArray[np.floating],
]
label_harmonics(
periods: npt.NDArray[np.floating],
snrs: npt.NDArray[np.floating],
epsilon_harmonic: float = ...,
*,
presorted: Literal[True],
) -> npt.NDArray[np.str_]
Assign harmonic labels to an array of candidate periods.
Uses a greedy, highest-S/N-first algorithm (see module docstring). Each iteration selects the unlabeled period with the highest S/N as a fundamental, labels its harmonics and sub-harmonics, removes all of them from the active set, then repeats until no unlabeled periods remain.
A period P is the (N-1)th harmonic of p0 if |P - p0/N| <= epsilon_harmonic.
A period P is the (N-1)th sub-harmonic of p0 if |P - N*p0| <= epsilon_harmonic.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
periods
|
NDArray[floating]
|
Periods (s) |
required |
snrs
|
NDArray[floating]
|
S/N values associated with the above periods |
required |
epsilon_harmonic
|
float
|
Floating-point tolerance for harmonic period matching |
DEFAULT_EPSILON_HARMONIC
|
presorted
|
bool
|
Set to True if periods are already sorted in descending S/N order. Skips the sort and returns only the flags array, which is useful when calling in a tight loop where the sort has already been done. |
False
|
Returns:
| Type | Description |
|---|---|
tuple[NDArray[str_], NDArray[floating], NDArray[floating]] | NDArray[str_]
|
If presorted is False: tuple of (flags, sorted_periods, sorted_snrs) |
tuple[NDArray[str_], NDArray[floating], NDArray[floating]] | NDArray[str_]
|
where periods and S/N arrays are in descending S/N order. |
tuple[NDArray[str_], NDArray[floating], NDArray[floating]] | NDArray[str_]
|
If presorted is True: the flags array only (no copy of the sorted |
tuple[NDArray[str_], NDArray[floating], NDArray[floating]] | NDArray[str_]
|
input arrays is returned). |
tuple[NDArray[str_], NDArray[floating], NDArray[floating]] | NDArray[str_]
|
Flags are single characters: 'F' (fundamental), 'H' (harmonic), or |
tuple[NDArray[str_], NDArray[floating], NDArray[floating]] | NDArray[str_]
|
'S' (sub-harmonic). |
Source code in blipss/core/harmonic_detection.py
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 | |
blipss.core.inject_signal
¶
Atomic data-manipulation routines for the real-data signal-injection pipeline.
These functions operate on the internal (n_channels, n_samples) array
representation used throughout the inject_signal pipeline:
extract_data_array`: Load aWaterfall`` object into the internal layout.compute_median_bandpass/compute_per_channel_std: Characterise the per-channel noise statistics of the real data; used to calibrate injected pulse amplitudes relative to the local bandpass.pack_data_into_waterfall: Convert the modified array back to the sigproc(n_samples, n_ifs, n_channels)layout and store it in theWaterfallobject prior to writing.
compute_median_bandpass(data)
¶
Compute the per-channel median value across all time samples.
Used to estimate the baseline level of each spectral channel so that injected pulse amplitudes can be set relative to the local bandpass rather than an absolute scale.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
NDArray[floating]
|
Array of shape |
required |
Returns:
| Type | Description |
|---|---|
NDArray[floating]
|
1-D array of per-channel median values, shape |
Source code in blipss/core/inject_signal.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | |
compute_per_channel_std(data)
¶
Compute the per-channel standard deviation across all time samples.
Used alongside compute_median_bandpass to express the injected pulse
amplitude in units of the local noise standard deviation (i.e., as an SNR).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
NDArray[floating]
|
Array of shape |
required |
Returns:
| Type | Description |
|---|---|
NDArray[floating]
|
1-D array of per-channel standard deviations, shape |
Source code in blipss/core/inject_signal.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | |
extract_data_array(wat, if_channel=0)
¶
Extract the 2-D data array, sample count, and sampling interval from a Waterfall object.
Converts from blimpy's on-disk (n_samples, n_ifs, n_channels) layout to the
internal (n_channels, n_samples) representation used by the rest of the
inject_signal pipeline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
wat
|
Waterfall
|
Blimpy |
required |
if_channel
|
int
|
Index of the polarisation (IF) channel to extract. Defaults to 0. |
0
|
Returns:
| Type | Description |
|---|---|
NDArray[floating]
|
Tuple of: |
int
|
|
float
|
|
tuple[NDArray[floating], int, float]
|
|
Source code in blipss/core/inject_signal.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | |
pack_data_into_waterfall(data, wat, n_samples)
¶
Reshape the modified data array back into sigproc layout and store it in the Waterfall object.
This is the inverse of extract_data_array: it converts from the internal
(n_channels, n_samples) representation back to the (n_samples, n_ifs, n_channels)
layout expected by blimpy's serialisers. n_ifs is read from the original
Waterfall header so that multi-polarisation files are handled correctly.
Call this immediately before blipss.io.write_filterbank.write_waterfall.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
NDArray[floating]
|
Array of shape |
required |
wat
|
Waterfall
|
Blimpy |
required |
n_samples
|
int
|
Number of time samples (as returned by |
required |
Returns:
| Type | Description |
|---|---|
Waterfall
|
The same |
Source code in blipss/core/inject_signal.py
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | |
blipss.core.period_finding
¶
Period search across spectral channels using the Fast Folding Algorithm (FFA).
Pipeline¶
For each spectral channel the following steps are applied in sequence:
- FFA search: Dold the time series at trial periods and compute matched-filter S/N.
- Threshold: Retain only periods whose peak S/N exceeds a detection threshold.
- Cluster: Group nearby periods via Friends-of-Friends and keep the highest-S/N representative per cluster.
- Label harmonics: Classify each surviving candidate as a fundamental, harmonic, or sub-harmonic.
Results from all channels are merged and returned by search_all_channels.
search_all_channels(data, start_channel, sampling_time_in_seconds, minimum_period_in_seconds, maximum_period_in_seconds, minimum_fold_periods, minimum_bins, maximum_bins, max_duty_cycle, do_deredden, running_median_width_in_seconds, snr_threshold, epsilon_fof, epsilon_harmonic, n_workers=None)
¶
Search every spectral channel for periodic signals using the Fast Folding Algorithm.
Runs an FFA search on each channel of data, clusters and deduplicates period candidates, labels harmonics, and returns merged results across all channels.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
NDArray[floating]
|
2D array of shape (n_channels, n_samples); each row is one spectral channel |
required |
start_channel
|
int
|
Global channel index of data[0]; offsets channel numbers in the output |
required |
sampling_time_in_seconds
|
float
|
Sampling time (s) |
required |
minimum_period_in_seconds
|
float
|
Minimum trial period (s) for the FFA search |
required |
maximum_period_in_seconds
|
float
|
Maximum trial period (s) for the FFA search |
required |
minimum_fold_periods
|
int
|
Minimum number of signal periods that must fit in the data |
required |
minimum_bins
|
int
|
Minimum number of phase bins across the full [0, 1] phase range; a folded profile may cover only a fraction of this range |
required |
maximum_bins
|
int
|
Maximum number of phase bins across the full [0, 1] phase range; a folded profile may cover only a fraction of this range |
required |
max_duty_cycle
|
float
|
Maximum duty cycle searched |
required |
do_deredden
|
bool
|
Whether to detrend each time series with a running median filter |
required |
running_median_width_in_seconds
|
float
|
Running median window width (s) |
required |
snr_threshold
|
float
|
Minimum matched-filtering S/N for a detection |
required |
epsilon_fof
|
float
|
Period tolerance for Friends-of-Friends clustering |
required |
epsilon_harmonic
|
float
|
Period tolerance for harmonic matching |
required |
n_workers
|
int | None
|
Number of parallel worker processes; 1 runs the serial tqdm loop, None or values >1 dispatch via process_map using all available CPUs (None) or the specified count |
None
|
Returns:
| Type | Description |
|---|---|
NDArray[intp]
|
Tuple of (cand_channels, cand_periods, cand_snrs, cand_phase_bins, |
NDArray[floating]
|
cand_boxcar_widths, cand_flags) across all channels. |
NDArray[floating]
|
|
NDArray[uint]
|
|
NDArray[uint]
|
|
NDArray[str_]
|
|
tuple[NDArray[intp], NDArray[floating], NDArray[floating], NDArray[uint], NDArray[uint], NDArray[str_]]
|
|
tuple[NDArray[intp], NDArray[floating], NDArray[floating], NDArray[uint], NDArray[uint], NDArray[str_]]
|
|
Source code in blipss/core/period_finding.py
298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 | |
blipss.core.plot_cands
¶
Core logic for selecting and folding periodicity candidates for verification plots.
run_ffa_and_fold_channel(channel_data, tsamp, min_period, max_period, fpmin, bins_min, bins_max, ducy_max, do_deredden, rmed_width)
¶
Run an FFA search on a single-channel time series, keeping both the detrended series and periodogram.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
channel_data
|
NDArray[floating]
|
1D array of flux density samples for one spectral channel |
required |
tsamp
|
float
|
Sampling time (s) |
required |
min_period
|
float
|
Minimum trial period (s) |
required |
max_period
|
float
|
Maximum trial period (s) |
required |
fpmin
|
int
|
Minimum number of signal periods that must fit in the data duration |
required |
bins_min
|
int
|
Minimum number of phase bins across the full [0, 1] phase range |
required |
bins_max
|
int
|
Maximum number of phase bins across the full [0, 1] phase range |
required |
ducy_max
|
float
|
Maximum duty cycle searched |
required |
do_deredden
|
bool
|
Whether to detrend the time series with a running median filter |
required |
rmed_width
|
float
|
Running median window width (s) |
required |
Returns:
| Type | Description |
|---|---|
tuple[TimeSeries, Periodogram]
|
Tuple of (detrended_ts, periodogram) from the FFA search |
Source code in blipss/core/plot_cands.py
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | |
select_candidates_by_code(cand_channels, cand_periods, cand_bins, cand_codes, codes_plot)
¶
Retain candidates whose binary detection code is one of the codes selected for plotting.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cand_channels
|
NDArray[intp]
|
Spectral channel index of each candidate |
required |
cand_periods
|
NDArray[floating]
|
Best-fit period (s) of each candidate |
required |
cand_bins
|
NDArray[uint]
|
Number of phase bins in the folded profile for each candidate |
required |
cand_codes
|
NDArray[str_]
|
Per-file binary detection code string for each candidate |
required |
codes_plot
|
Sequence[str]
|
Binary codes selected for plotting |
required |
Returns:
| Type | Description |
|---|---|
tuple[NDArray[intp], NDArray[floating], NDArray[uint], NDArray[str_]]
|
Tuple of (channels, periods, bins, codes) for candidates matching codes_plot |
Source code in blipss/core/plot_cands.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | |
blipss.core.simulate_data
¶
Atomic data-generation and signal-injection routines for synthetic filterbank simulation
generate_white_noise_background(n_channels, n_samples, rng=None)
¶
Generate a 2-D array of Gaussian white noise with shape (n_channels, n_samples).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n_channels
|
int
|
Number of spectral channels. |
required |
n_samples
|
int
|
Number of time samples. |
required |
rng
|
Generator | None
|
Random number generator. Defaults to a fresh unseeded Generator. |
None
|
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
Array of shape (n_channels, n_samples) drawn from N(0, 1). |
Source code in blipss/core/simulate_data.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | |
inject_periodic_signal(data, sample_times, channel, period, duty_cycle, pulse_snr, initial_phase)
¶
Add a boxcar pulse train in-place to a single channel of the data array.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
NDArray[floating]
|
Array of shape (n_channels, n_samples) to modify in place. |
required |
sample_times
|
NDArray[floating]
|
1-D array of sample timestamps (s). |
required |
channel
|
int
|
Index of the spectral channel to inject the signal into. |
required |
period
|
float
|
Pulse repetition period (s). |
required |
duty_cycle
|
float
|
Fraction of the period during which the pulse is on; in (0, 1]. |
required |
pulse_snr
|
float
|
Peak signal-to-noise ratio added to on-pulse samples. |
required |
initial_phase
|
float
|
Phase offset of the pulse centre (fraction of a period); in [0, 1). |
required |
Source code in blipss/core/simulate_data.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | |
reshape_for_sigproc(data)
¶
Transpose and add an IF axis to match the sigproc (n_samples, n_ifs, n_channels) layout.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
NDArray[floating]
|
Array of shape (n_channels, n_samples). |
required |
Returns:
| Type | Description |
|---|---|
NDArray[floating]
|
Array of shape (n_samples, 1, n_channels). |
Source code in blipss/core/simulate_data.py
54 55 56 57 58 59 60 61 62 63 64 | |