Plotting¶
blipss.plotting.plots
¶
Plotting utilities for BLIPSS candidate visualization and diagnostic plots.
candverf_plot(period, bins, detrended_ts, periodograms, annotations, start_mjds, max_snr, periodaxis_log, plot_name, output_formats, use_latex=False)
¶
Multi-row candidate verification plot combining periodogram, pulse profile, and phase-time diagram.
Each row corresponds to one data file. Left panel: periodogram with a dashed vertical line at the candidate period. Top-right panel: normalized average pulse profile. Bottom-right panel: phase-time diagram with flux density on a grayscale.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
period
|
float
|
Candidate folding period (s) |
required |
bins
|
int
|
Number of phase bins in the folded profile |
required |
detrended_ts
|
Sequence[Any]
|
Riptide TimeSeries objects, one per data file |
required |
periodograms
|
Sequence[Any]
|
Riptide Periodogram objects, one per data file |
required |
annotations
|
Sequence[str]
|
Custom text annotations for each row (e.g., beam or ON/OFF labels) |
required |
start_mjds
|
Sequence[float]
|
Start MJDs (UTC) for each data file |
required |
max_snr
|
float
|
Maximum S/N value shown on the periodogram y-axis |
required |
periodaxis_log
|
bool
|
Whether to use a logarithmic period axis |
required |
plot_name
|
str
|
Output file path without extension |
required |
output_formats
|
Sequence[str]
|
File extensions (with leading dot) for each output format |
required |
use_latex
|
bool
|
Render text with LaTeX (requires a system LaTeX installation); defaults to False |
False
|
Source code in blipss/plotting/plots.py
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 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 | |
plot_phase_resolved_dynamic_spectrum(phaseresolved_ds, freqs_MHz, period, start_mjd, plot_name, plot_formats, use_latex=False)
¶
Produce a grayscale imshow plot of a phase-resolved dynamic spectrum.
The figure has four panels: frequency-averaged profile (top-left), blank annotation panel (top-right), phase-resolved spectrum (bottom-left), and time-averaged band spectrum (bottom-right).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
phaseresolved_ds
|
NDArray[floating]
|
2D data array of shape (n_chans, n_bins) |
required |
freqs_MHz
|
NDArray[floating]
|
Radio frequencies (MHz) corresponding to each channel |
required |
period
|
float
|
Folding period (s) |
required |
start_mjd
|
float
|
Start MJD (UTC) of the observation |
required |
plot_name
|
str
|
Output file path without extension |
required |
plot_formats
|
Sequence[str]
|
File extensions (with leading dot) for each output format |
required |
use_latex
|
bool
|
Render text with LaTeX (requires a system LaTeX installation); defaults to False |
False
|
Source code in blipss/plotting/plots.py
580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 | |
scatterplot_period_radiofreq(cand_periods, cand_freqs, cand_snrs, cand_flags, basename, min_period, max_period, min_freq, max_freq, plot_formats=None, use_latex=False)
¶
Produce a scatter plot of periodicity detections in the radio-frequency vs. trial-period plane.
Candidate S/N values are shown on a color scale. Fundamental frequencies use a circular marker, sub-harmonics a plus symbol, and harmonics a cross symbol.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cand_periods
|
NDArray[floating]
|
Trial periods (s) of detected signals |
required |
cand_freqs
|
NDArray[floating]
|
Radio frequencies (MHz) corresponding to candidate detections |
required |
cand_snrs
|
NDArray[floating]
|
Matched-filtering S/N values of detected candidates |
required |
cand_flags
|
NDArray[str_]
|
Harmonic flags ('F', 'S', or 'H') assigned to each candidate |
required |
basename
|
str
|
Output plot basename including output path (no extension) |
required |
min_period
|
float
|
Minimum trial period (s) shown on the x-axis |
required |
max_period
|
float
|
Maximum trial period (s) shown on the x-axis |
required |
min_freq
|
float
|
Minimum radio frequency (MHz) on the y-axis |
required |
max_freq
|
float
|
Maximum radio frequency (MHz) on the y-axis |
required |
plot_formats
|
Sequence[str] | None
|
File extensions (with leading dot) for saving the plot; defaults to ['.png'] |
None
|
use_latex
|
bool
|
Render text with LaTeX (requires a system LaTeX installation); defaults to False |
False
|
Source code in blipss/plotting/plots.py
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 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 | |