valska.plotting
Plotting helpers for ValSKA analysis outputs.
Functions
|
Example function that reproduces the GLEAM analysis plot. |
|
Example function comparing different GSM perturbation levels. |
Classes
|
Plot beam-analysis results for HERA-focused workflows within ValSKA. |
- class valska.plotting.BeamAnalysisPlotter(base_chains_dir: str | Path | None = None, paths_file: str | Path | None = None, paths: dict[str, str] | None = None, eor_ps: float = 214777.66068216303, noise_ratio: float = 0.5, default_expected_ps: float | None = None)
Plot beam-analysis results for HERA-focused workflows within ValSKA.
Initialize the plotter with a base directory for chains.
Parameters
- base_chains_dirstr or Path, optional
Base directory for chains. If None, uses the default BayesEoR path
- paths_filestr or Path, optional
YAML file containing analysis paths. If None, uses the default paths file.
- pathsDict[str, str], optional
Dictionary of analysis paths relative to base_chains_dir. If None, uses default paths.
- eor_psfloat, optional
EoR power spectrum value in mK^2 Mpc^3. Default is 214777.66068216303.
- noise_ratiofloat, optional
Ratio of noise PS to EoR PS. Default is 0.5 (noise_ps = eor_ps / 2).
- default_expected_psfloat, optional
Default expected power spectrum to use in plots. If None, uses noise_ps.
- add_analysis_path(key: str, path: str) None
Add a new analysis path to the plotter.
Parameters
- keystr
Key for the analysis path
- pathstr
Path to the analysis directory, relative to base_chains_dir
- create_comparison_plot(groups: dict[str, list[str]], group_labels: dict[str, str] | None = None, suptitle: str = 'HERA FWHM Sensitivity Analysis', **kwargs) matplotlib.figure.Figure
Create a comparison plot for different analysis groups.
Parameters
- groupsdict of str: list of str
Dictionary mapping group names to lists of analysis keys
- group_labelsdict of str: str, optional
Dictionary mapping group names to display labels
- suptitlestr, optional
Super title for the plot
**kwargsdictAdditional arguments to pass to plot_analysis_results
Returns
- figmatplotlib.figure.Figure
The resulting figure
- get_data_container(analysis_keys: list[str], labels: list[str] | None = None, expected_ps: float | None = None, **kwargs) bayeseor.analyze.analyze.DataContainer
Create a DataContainer for the specified analyses.
Parameters
- analysis_keyslist of str
Keys for analyses to plot from self.paths
- labelslist of str, optional
Labels for each analysis. If None, uses analysis_keys
- expected_psfloat, optional
Expected power spectrum value. If None, uses self.default_expected_ps
**kwargsdictAdditional arguments to pass to DataContainer
Returns
- dataDataContainer
DataContainer for the specified analyses
- plot_analysis_results(analysis_keys: list[str], labels: list[str] | None = None, suptitle: str = 'UKSRC validation: Burba et al. 2023', expected_ps: float | None = None, expected_label: str = 'Noise level', upper_limit_indices: list[int] | None = None, detection_indices: dict[str, list[int]] | None = None, ignore_uplims: bool = False, plot_fracdiff: bool = True, plot_priors: bool = True, ls_expected: str = ':', figsize: tuple[float, float] | None = None, data_container_kwargs: dict[str, Any] | None = None, plot_kwargs: dict[str, Any] | None = None) matplotlib.figure.Figure
Plot power spectra and posteriors for selected analyses.
Parameters
- analysis_keyslist of str
Keys for analyses to plot from self.paths
- labelslist of str, optional
Labels for each analysis. If None, uses analysis_keys
- suptitlestr, optional
Super title for the plot
- expected_psfloat, optional
Expected power spectrum value. If None, uses self.default_expected_ps
- labelsstr, optional
Label for the expected PS line
- upper_limit_indiceslist of int, optional
Indices of k-modes to treat as upper limits for ALL analyses. If None, assume no upper limits.
- detection_indicesdict, optional
Dictionary mapping analysis keys to lists of k-mode indices that should be treated as detections rather than upper limits. This overrides upper_limit_indices for specific analyses.
- ignore_uplimsbool, optional
Whether to ignore upper limits entirely
- plot_fracdiffbool, optional
Whether to plot fractional differences
- plot_priorsbool, optional
Whether to plot priors
- ls_expectedstr, optional
Line style for expected PS
- figsizetuple of float, optional
Figure size in inches (width, height)
- data_container_kwargsdict, optional
Additional arguments to pass to DataContainer
- plot_kwargsdict, optional
Additional arguments to pass to plot_power_spectra_and_posteriors
Returns
- figmatplotlib.figure.Figure
The resulting figure
- valska.plotting.plot_gleam_analysis(base_chains_dir: str | Path | None = None) matplotlib.figure.Figure
Example function that reproduces the GLEAM analysis plot.
Parameters
- base_chains_dirstr or Path, optional
Base directory for chains. If None, uses the default BayesEoR path.
Returns
- figmatplotlib.figure.Figure
The resulting figure
- valska.plotting.plot_gsm_comparison(base_chains_dir: str | Path | None = None) matplotlib.figure.Figure
Example function comparing different GSM perturbation levels.
Parameters
- base_chains_dirstr or Path, optional
Base directory for chains. If None, uses the default BayesEoR path.
Returns
- figmatplotlib.figure.Figure
The resulting figure