Skip to main content
Sandbox Physics
Planet atmospheres from grazing rays to molecular evidence

Tutorial

Rerun a conditional retrieval of an actual NIRISS spectrum

The public package fits the same 74 measured WASP-39 b bins under a cloud-only atmosphere and an atmosphere with unocculted cool regions. It preserves the full posterior calculation and the poor fits. A second, explicitly synthetic case checks recovery from a known atmosphere.

Identify the exact measurement before opening a model

The source is CMADF-WASP_39b_NIRISS_transmission_spectrum_R100.csv from author repository commit 0608071e1e70ec7ff12707774ea03ace4b52ea85, linked to the published Feinstein and collaborators analysis. Its unchanged original is 11,063 bytes. The accompanying provenance file gives its complete SHA256, author license and archived Zenodo version.

Select order one, quality zero, and bins whose entire supplied interval lies between 0.87 and 2.00 micrometres. This leaves 74 rows, with actual outer edges near 0.8732 and 1.9882 micrometres. The reported vertical errors span about 28.2 to 73.4 ppm. The filename says R100, while the generic header says Native; the supplied widths imply resolving powers about 82.8 to 94.7. The package preserves those original labels and uses the numeric widths explicitly.

Depth and uncertainty are already in ppm. The horizontal wave_error is treated as a halfwidth, consistent with the author plotting script. These intervals become independent top-hat response approximations. There is no silent conversion of them to Gaussian errors, and no claim that they reproduce the full detector response.

Reading: WASP-39 b NIRISS author data · Zenodo 7709712 and fixed repository commit · Feinstein et al. (2023) · Early Release Science of WASP-39 b with JWST NIRISS

Check the physical inputs and the order of operations

The molecular input is the actual ExoMolOP POKAZATEL sampled cross-section product. Its original HDF5 file contains 22 pressure rows, 27 temperatures and 76,744 wavenumber samples. Exact byte ranges retain all 22 pressures, nine temperatures from 800 to 1600 kelvin and 15,084 samples covering the working wavelength interval. The extraction manifest records the original total file size, array offset, lack of compression, every selected range and its hash.

Three original PHOENIX medium-resolution stellar members at 3500, 4500 and 5500 kelvin come from the explicitly licensed Zenodo version 1.0 derivative. The headers give nanometres and surface flux in erg per square centimetre per second per nanometre. The calculation retains their common physical normalization. Source members, CRC32, hashes and attribution accompany the package.

The forward model uses the inverse-square isothermal atmosphere, finite top and pressure-dependent cross section derived in the course. It transfers every native wavelength before computing a photon-weighted occulting area in each measured bin. Gray-cloud and unocculted-star corrections act on this same physical calculation.

The browser uses a compact logarithmic encoding of the same positive source opacity. Its maximum final-bin difference from the Python float64 route is about 0.015 ppm across 21 corner/preset and 16 withheld states. This encoding test is separate from radial quadrature and from the offline observable-grid interpolation used for the posterior.

Reading: Chubb et al. (2021) · ExoMolOP cross sections and k-tables · Polyansky et al. (2018) · The POKAZATEL water line list · Stuitje · PHOENIX medium-resolution stellar spectra, version 1.0 · Husser et al. (2013) · A PHOENIX library of stellar atmospheres and spectra

Verify the observable grid before spending time sampling

The posterior grid stores already transferred, photon-binned planetary areas after subtracting the exact reference-radius-squared baseline. It never stores a coarse mean cross section. Temperature interpolation stays inside each original 100-kelvin opacity interval, and extrapolation is rejected.

An initial high-water edge failed the 2 ppm numerical target. Four extra values on the water-abundance axis required 476 additional complete native gas-column calculations, increasing the total from 2499 to 2975. After uniform refinement to 384 pressure layers, 77 independently checked states include new withheld interiors, edges and every preset. The maximum difference is about 0.425 ppm from the native 384-layer route and 1.636 ppm from a separately cloud-bounded 1280-layer reference.

The supplied validate_grid.py reruns those actual transfer comparisons from the original extracted opacity and stellar inputs. The 2 ppm threshold concerns numerical agreement inside this defined source-product model. It is not an added observational error, a calibrated distribution of model discrepancy, or a line-by-line physical accuracy guarantee.

Separate source sensitivities are larger: halving the native wavelength samples changes five preset spectra by about 40–145 ppm, and removing a known temperature row changes them by about 3.4–31.8 ppm. These are comparable to measured uncertainties. The sub-two-ppm internal check conditions on the complete retained source product and specified interpolation; it does not turn these representation changes into a total accuracy bound or Gaussian noise.

An optional rebuild_grid.py recreates all 2975 complete columns and checks the final float32 grid hash. It is the slowest step. The posterior rerun can use the delivered grid after its input hashes and independent validation have been checked.

python3 validate_grid.py --materials . --output rerun-validation
python3 rebuild_grid.py --materials . --output rebuilt-grid

Reading: Chubb et al. (2021) · ExoMolOP cross sections and k-tables · Heng and Kitzmann (2017) · Transmission spectra and the radius–pressure degeneracy

Check whether the reference itself is fine enough

The earlier 320-layer calculation looked acceptable against a 640/960-layer reference. A further check against 1280 layers exposed two grid discrepancies of about 2.13 and 2.09 ppm. Those actual failures are preserved, with the old grid hash and enough input information to reproduce them.

Production therefore uses 384 layers consistently for the scene, spectra, grid and synthetic recovery. The difficult points are also compared with 2048 layers: their current grid differences are below 1.73 ppm. The public finer_reference.py replays the retired native result and the current calculation. The old grid is kept for failure reproduction; the posterior uses the 384-layer version.

Agreement with a stated finite quadrature is a numerical comparison, not a strict error bound against an unknown continuous atmosphere. It also leaves the much larger source-sampling and temperature-interpolation sensitivities intact. The posterior remains conditional on that complete frozen product and its physical assumptions.

python3 finer_reference.py --materials . --output rerun-finer

Reading: Heng and Kitzmann (2017) · Transmission spectra and the radius–pressure degeneracy · Chubb et al. (2021) · ExoMolOP cross sections and k-tables

Run the same proper posterior under four stated conditions

Install the pinned NumPy version and run analyze.py in the unpacked directory. The default command runs cloud only, cool regions at 4500 kelvin with an upper fraction of 0.05, cool regions at 3500 kelvin with the same fraction prior, and a narrower 4500-kelvin prior capped at 0.01. All use the same actual 74 bins, normalized Gaussian likelihood and atmospheric priors given in L3.

Each run uses four chains, 6000 warmup iterations and initially 16,000 retained iterations per chain. The retained positions are correlated samples. The summary therefore reports bulk and tail effective sample size separately from the total retained count. Warmup adaptation stops before retention, and out-of-prior proposals are rejected.

The script saves full physical and computational chains, parameter quantiles, diagnostics and per-bin prediction intervals. It separately generates noisy replicated measurements. The comparison script checks fixed priors and the convergence targets, and uses stated numerical tolerances for posterior quantiles. Seeds and software versions are fixed in the instructions.

python3 -m pip install -r requirements.txt
python3 analyze.py --materials . --output rerun
python3 verify_outputs.py --expected expected --actual rerun

Reading: Vehtari et al. (2021) · Rank-normalized split R-hat and effective sample size · WASP-39 b NIRISS author data · Zenodo 7709712 and fixed repository commit · Heng and Kitzmann (2017) · Transmission spectra and the radius–pressure degeneracy

Keep the failed results in the answer

Open cloud-summary.json and spots4500-summary.json, then their prediction CSV files. The retained minimum chi-squares are about 332 and 257. Their median-curve standardized residual RMS values are about 2.13 and 1.88. Respectively 28 and 23 observations lie outside their central 95 percent replicated-measurement intervals. These failures remain visible even though every varying parameter passes the chain diagnostics.

Read the full parameter intervals. Temperature crowds the low prior boundary, water abundance crowds the high boundary, and cloud pressure trades against the reference radius. The 4500-kelvin cool fraction has a median near 0.0224; changing the cool spectrum to 3500 kelvin moves it to about 0.0373. Narrowing its allowed fraction changes both the posterior and the remaining discrepancy.

A positive interval inside a continuously positive prior is not a test of the point hypothesis f=0f=0. No evidence integral or Bayes factor is reported. Nor should a chi-square difference between these restricted models be promoted to a model-independent molecular or stellar detection significance.

The exercise omits other absorbers and non-gray cloud physics and assumes unknown inter-bin covariance is zero. The original published analysis used richer atmospheric models. These simple models explain some band structure and leave wavelength-dependent residuals larger than expected under the assumed errors.

Reading: Feinstein et al. (2023) · Early Release Science of WASP-39 b with JWST NIRISS · Rackham, Apai and Giampapa (2019) · The Transit Light Source Effect II · Brogi and Line (2019) · Retrieval with high-resolution cross-correlation spectroscopy · Vehtari et al. (2021) · Rank-normalized split R-hat and effective sample size

Use a known atmosphere to test a narrower question

The verification command independently solves a non-grid atmosphere at 1123 kelvin, water logarithmic fraction minus 3.47, cloud logarithmic pressure minus 1.37, ten-bar radius ratio 0.1337 and cool fraction 0.018. It then adds a fixed Gaussian noise realization using the reported bin uncertainties. The synthetic CSV is clearly labelled and kept separate from the observed NIRISS input.

Its four-chain posterior passes the same diagnostics, and every injected parameter lies inside its marginal 95 percent interval in the saved run. A single success checks implementation and one recovery case. It is not an empirical 95 percent coverage study across atmospheres and noise realizations.

Other independent checks turn water absorption off exactly, integrate a homogeneous absorbing spherical shell, approach the thin-atmosphere tangent-column limit, verify an identical stellar spectrum produces no contamination, test the finite prior normalization, and compare effective sample size with an autoregressive reference. A deliberately separated set of chains must fail the diagnostic.

Finally compare actual and synthetic residuals. Successful recovery when the model generates the data, alongside failed prediction for actual data, is a useful result: it separates a working conditional calculation from an adequate physical explanation of a planet.

python3 verify_science.py --materials . --output rerun-checks --synthetic

Reading: Vehtari et al. (2021) · Rank-normalized split R-hat and effective sample size · Heng and Kitzmann (2017) · Transmission spectra and the radius–pressure degeneracy · Feinstein et al. (2023) · Early Release Science of WASP-39 b with JWST NIRISS

Actual-data posteriors retain their failures

All rows use the same measured 74 bins and atmospheric priors. Each has four chains with at least 16,000 retained, correlated positions per chain after warmup. Effective sample size is reported separately; the minima below range over the varying physical parameters. A chain diagnostic pass does not repair the poor predictive fit.

ConditionMinimum retained chi-squareMaximum split R-hatMinimum bulk/tail ESSBins outside 95 percent replicated interval
Gray cloud, no cool regions331.95331.951.002621.00262186628
4500 kelvin, fraction at most 0.05257.11257.111.003411.0034191623
3500 kelvin, fraction at most 0.05248.17248.171.005361.0053682120
4500 kelvin, fraction at most 0.01279.27279.271.006531.00653106328

Temperature and water abundance accumulate near prior boundaries. The fixed stellar spectrum and fraction prior change the result. The public prediction CSVs keep wavelength-by-wavelength residuals; no evidence or Bayes factor is computed.

Use the scene to explain a posterior tradeoff

  1. Recreate a high-cloud state and describe which atmospheric paths the cloud removes.
  2. Apply unocculted cool regions and watch the apparent spectrum change while the gas rays stay fixed. Then return to the posterior CSV and identify which wavelength pattern this can partly compensate.

Exercises with explanations

  1. Which output would you inspect first if the median water abundance were reported to many decimal places?

    Read the explanation

    Inspect the full abundance interval, the parameter boundaries and standardized predictive residuals before its displayed precision. Here the posterior presses against its upper abundance boundary while the model misses many measured bins. The remaining discrepancies determine which physical explanation needs revision.

  2. Change the upper cool-fraction prior from 0.05 to 0.01. What comparison remains meaningful without an evidence calculation?

    Read the explanation

    Compare posterior intervals, boundary accumulation and per-bin predictive failures under the two stated conditions. The delivered narrower-prior run still converges and fits worse. An evidence comparison would additionally integrate each likelihood over its proper prior.

Sources and calculation scope

  1. Vehtari et al. (2021) · Rank-normalized split R-hat and effective sample size

    Bayesian Analysis 16, 667–718; corrected rank-normalization denominator and author appendix https://avehtari.github.io/rhat_ess/rhat_ess.html. The independent NumPy implementation also follows the Stan 2.33 reference definition of autocorrelation and initial positive, monotone pair truncation. IID, AR(1) and deliberately separated-chain checks are included. These diagnostics concern sampling, not physical model adequacy.

  2. Feinstein et al. (2023) · Early Release Science of WASP-39 b with JWST NIRISS

    Published Nature 614, 670–675. Read Figures 1–3 and the extraction, light-curve and atmospheric-model Methods. The tutorial uses a fixed author-released nirHiss spectrum, with 74 selected order-one bins; it does not repeat the paper’s full chemical and cloud retrieval.

  3. WASP-39 b NIRISS author data · Zenodo 7709712 and fixed repository commit

    Archived data are CC BY 4.0. The exact CSV comes from author repository commit 0608071e1e70ec7ff12707774ea03ace4b52ea85, which also carries an MIT license. Original bytes, row selection, units and SHA256 are saved in the public provenance file. The complete archive was not downloaded.

  4. Heng and Kitzmann (2017) · Transmission spectra and the radius–pressure degeneracy

    Fixed accepted version, arXiv 1702.02051v2; published MNRAS 470, 2972–2981, DOI 10.1093/mnras/stx1453. Section 2.2 derives the thin, constant-gravity limit; Sections 3.2–3.3 discuss the reference radius and pressure. The course derives its inverse-square-gravity extension separately.

  5. Chubb et al. (2021) · ExoMolOP cross sections and k-tables

    A&A 646, A21, full text Sections 3.1–3.3 and Tables 1–3. The actual sampled cross-section product supplies pressure, temperature, wavenumber and square centimetres per molecule. Its approximate hydrogen–helium broadening and source resolution remain model assumptions.

  6. Polyansky et al. (2018) · The POKAZATEL water line list

    Primary line-list description for the dominant water isotopologue. The delivered opacity is the derived ExoMolOP product, not a new computation of the full line list. ExoMol data and the extracted opacity derivatives retain CC BY-SA 4.0.

  7. Husser et al. (2013) · A PHOENIX library of stellar atmospheres and spectra

    Primary model-library description. The frozen stellar input is the separately versioned medium-resolution derivative at Zenodo 17674612, version 1.0, CC BY 4.0. Actual ASCII units are nanometres and erg per square centimetre per second per nanometre; the spectra are unscaled surface fluxes.

  8. Stuitje · PHOENIX medium-resolution stellar spectra, version 1.0

    Three exact 3500, 4500 and 5500 kelvin members at log gravity 4.5 in cgs units, solar metallicity and zero alpha enhancement. The public bundle preserves original members, ZIP offsets, CRC32, SHA256 and CC BY 4.0 attribution. Effective spectral resolution is 5000; oversampling does not increase that resolution.

  9. Rackham, Apai and Giampapa (2019) · The Transit Light Source Effect II

    Fixed arXiv 1812.06184v1; published AJ 157, 96, DOI 10.3847/1538-3881/aaf892. Section III.1, Equations 3–6 define the unocculted-region correction and its uniform-intensity approximation. Section IV.3 explains why molecular contamination is generally weak at typical FGK activity levels.

  10. Brogi and Line (2019) · Retrieval with high-resolution cross-correlation spectroscopy

    Fixed accepted arXiv 1811.01681v2; published AJ 157, 114, DOI 10.3847/1538-3881/aaffd3. Section II.2.2 derives the likelihood mapping; Figures 2, 5, 7 and 10 test processing, calibration, line-list choice and missing absorbers. The low-resolution teaching opacity cannot reproduce the paper’s resolved-line analysis.

FeedbackSomething broken, confusing, or missing on this page?Tell us
What kind of feedback?

Sent with this page’s address, its Lab ID, the site language and your device type. Please leave out personal details. Feedback is kept for up to 12 months.Privacy policy