fit_sn_cosmology
Fits flat LCDM, wCDM, or w0waCDM models to a Type Ia supernova sample with full covariance and marginalised M/H0, then writes best-fit summaries and contour data.
Instructions
Fit flat LCDM / wCDM / w0waCDM to one SN sample on a grid (+ Nelder-Mead refinement).
Use for SN-only cosmology: full stat+sys covariance, offset M/H0 marginalised
analytically, flat priors over the grid. Writes `<tag>_summary.json` (best fit, chi2,
1D marginal mean/sd/68/95%), `<tag>_1d_<p>.csv` and `<tag>_2d_<a>_<b>.csv` (posterior,
profile chi2 and in_68/in_95 HPD flags) for plot_sn_contours. Heavy: w0wacdm with
the default 41^3 grid on Pantheon+ takes a few minutes locally. When set_dispatch
points at an HPC site it runs as one facility job (kernel sn.kernels.fit_sn_cosmology).
SN alone barely constrain w0wa; expect posteriors hitting prior edges (flagged).
Sanity: Pantheon+ lcdm Om = 0.334 +- 0.018 (Brout+22); DES-SN5YR 0.352 +- 0.017.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"output_dir": "<output_dir>"
},
"name": "fit_sn_cosmology"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| zmax | No | Upper z cut. | |
| zmin | No | z cut (None = release standard: Pantheon+ 0.01). | |
| model | No | lcdm (flat, Om) | wcdm (flat, Om+w) | w0wacdm (flat CPL, Om+w0+wa). | lcdm |
| n_grid | No | Grid points per parameter (0 = 401/121/41 by model). | |
| dataset | No | SN sample. | pantheonplus |
| w_range | No | [lo, hi] prior on w (wcdm; default [-2, -0.3]). | |
| Om_range | No | [lo, hi] flat prior on Om (default [0.05, 0.65]). | |
| w0_range | No | [lo, hi] prior on w0 (default [-2, 0]). | |
| wa_range | No | [lo, hi] prior on wa (default [-6, 3]). | |
| output_dir | Yes | Directory for summary JSON + marginal/contour CSVs. | |
| calibrators | No | Pantheon+ calibrators include | exclude | only. | include |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| files | Yes | ||
| status | Yes | ||
| message | Yes | ||
| metadata | Yes |