jwspecmcmc.io
Save and load MCMC fitting results.
Serialises MCMCResult and MCMCBroadFitResult to
compressed NumPy .npz files, preserving posterior chains, per-line
flux posteriors, convergence diagnostics, and BIC metadata.
Example
>>> import jwspecmcmc
>>> result = jwspecmcmc.fit_lines(spec, z=6.0, fit_balmer_broad=False, fit_oiii_broad=False)
>>> jwspecmcmc.save_mcmc_result(result, "mcmc.npz")
>>> loaded = jwspecmcmc.load_mcmc_result("mcmc.npz")
Functions
|
Load an MCMC result from a |
|
Save an MCMC result to a compressed |
- jwspecmcmc.io.load_mcmc_result(path)[source]
Load an MCMC result from a
.npzfile.- Parameters:
path (str or Path) – Path to the
.npzfile saved bysave_mcmc_result().- Returns:
Reconstructed result with full posterior chains.
- Return type:
- jwspecmcmc.io.save_mcmc_result(result, path)[source]
Save an MCMC result to a compressed
.npzfile.- Parameters:
result (MCMCResult or MCMCBroadFitResult) – MCMC fitting result to save.
path (str or Path) – Output file path (should end in
.npz).
- Return type: