r_analysis¶
The r_analysis CLI tool provides a complete workflow for analyzing component separation results: computing statistics, plotting metrics, validating optimization, and estimating the tensor-to-scalar ratio \(r\).
Subcommand Structure¶
r_analysis <subcommand> [arguments]
Subcommand |
Purpose |
|---|---|
Compute statistics from result folders and save to |
|
Bin spectral parameters and produce |
|
Generate plots from |
|
Run NLL perturbation analysis on results |
|
Standalone \(r\) estimation from a spectrum or map file |
Typical Workflow¶
# 1. Run component separation (produces result folders)
kmeans-model -n 64 -pc 10000 500 500 -m GAL020 -tag c1d1s1
# 2. Compute statistics and save snapshots
r_analysis snap -n 64 -r "kmeans_BD10000" -ird results/ -o snapshots/kmeans_BD10000.parquet
# 2b. (Optional) Bin parameters and re-run with binned patches
r_analysis bin -n 64 -r "kmeans_BD10000" -ird results/ -o binned/ --bin-bd 50 --bin-td 20 --bin-bs 30
kmeans-model -n 64 -c binned/patches_beta_dust.npy binned/patches_temp_dust.npy binned/patches_beta_pl.npy -m GAL020 -tag c1d1s1
# 3. Plot from the snapshots
r_analysis plot --parquet-dir snapshots/ -arc -as -ar
# 4. (Optional) Validate optimization quality
r_analysis validate -n 64 -r "kmeans_BD10000" -ird results/ --steps 5
Common Arguments¶
The snap, bin, and validate subcommands share these arguments:
Flag |
Type |
Default |
Description |
|---|---|---|---|
|
|
|
HEALPix resolution |
|
|
|
Instrument config ( |
|
|
required |
Run name patterns to filter result folders (see snap for matching modes) |
|
|
required |
Directory(ies) containing result folders |
|
flag |
|
Disable LaTeX rendering in plots |
|
|
|
Sky model tag for true parameter lookup |
|
|
|
Max iterations for systematic residual computation |
|
|
|
Solver for re-optimization |