# Stellar-wind spectra: standalone scientific reproduction

Follow a prescribed wind field into a P Cygni singlet, saved integer photons and a conditional two-parameter inference. Separately decode three complete native-order IUE products and compare two complete published-fit tables. This small package runs without the website or a stellar-atmosphere installation.

## Run from an empty directory

Unzip `stellar-wind-science.zip`, enter `stellar-wind-science`, and install ordinary dependencies once if necessary. After that the replay is entirely offline:

```sh
python3 -m venv .venv
.venv/bin/python -m pip install -r requirements.txt
PYTHONDONTWRITEBYTECODE=1 .venv/bin/python replay.py --inputs input --out-dir rerun
```

The verified environment is Python 3.9.6, NumPy 2.0.2, SciPy 1.13.1 and Matplotlib 3.9.4. Dependency installation is distinct from scientific-data retrieval: all six complete small original data members are included. The replay hashes every packaged file before executing 11required subprocesses. `rerun/replay-receipt.json` appears only after all succeed. There is no network call in the replay. Existing .venv/installed dependencies may be used instead.

## What is actually recomputed

- `verify-science.py`: direct impact-ray versus isovelocity radial integrals; finite-star illumination, optically thin and independent analytic thick-source limits; removed/reemitted/escaping/returning/missed photon budgets.
- `wind-force-check.py`: the illustrative one-line radiative acceleration against an independent weighted stellar-ray packet momentum/work integral. The prescribed flow is not accelerated by this force.
- `finite-width-check.py`: formal finite-width ray ODE with the Sobolev source held fixed. The strong-width disagreement is deliberately retained. This is not an independent non-LTE source calculation.
- `probe-observation.py`: full native 17-field,768-vector IUE extraction with one-based STARTPIX, separate orders/epochs, original quality gaps and declared continuum alternatives.
- `probe-published-fits.py`: match 24published optical+UV/optical-only fit pairs by target identifier and replot their point estimates.
- `verify-production.py` and `verify-angular-field.py`: independent Python direct-ray/exact Gaussian-CDF-bin detector spectra and adaptive angular source/force integrals against197actual frozen JS producer records. These JS fixtures are provided with their configurations and output fields. The private website producer is **not** rerun by this Python package.
- `verify_photon_distribution.py`: independent SciPy Poisson CDF/moment tests for 540,000actual production-sampler draws across nine means, supplied as frozen integer histograms. The JS random stream is not regenerated here.
- `conditional_count_inference.py`: independently compute photon means over the full product support 0.25–4, refine 1201 to 2401 grid points, fit **saved integer counts only**, perform direct2D/analytic marginal checks, generate 240 prior-predictive and 3×100 fixed-truth count records and calibrate intervals. The plot then reads these newly computed fields. Truth is used only for validation or a separately declared marker.
- `compare_real_line_shapes.py`: recalculate the declared isolated-singlet reference and eight IUE epoch/order/component residuals and continuum sensitivities. The large residuals are results, not an optimized real-star fit.

## Fixed physical and statistical conditions

The monotonic beta law is prescribed on 1–8 stellar radii with a nonzero base speed. Continuity density, projected velocity gradient, opacity, local escape source, occultation and aperture drive the same spectrum. It is a line-formation calculation with local multiple escape, not a self-consistent radiation-driven wind. Intrinsic line width is mathematically zero; instrumental Gaussian sigma 8 km/s is a different operation. The finite-width negative example and severe one-line force mismatch remain visible.

Photon equivalent widths use a flat photon continuum in Doppler velocity coordinates. Stellar return and a missing halo aperture both enter. They are not claimed to be exact energy-flux integrals at arbitrary wavelength. Full apertures still lose photons to the star.

The synthetic conditional exercise fixes velocity 200 km/s, beta 1, aperture 8 stellar radii, instrument sigma 8 km/s and continuum 1600 photons/(km/s). Independent priors are LogUniform[0.5,2] for mass-flow multiplier m and relative ion-opacity multiplier q. q is not an absolute ion fraction. In x=ln(m),y=ln(q),a=ln2 the joint prior is uniform on[-a,a]^2; in linear coordinates it is1/(4a^2 m q). For theta=m q, the induced density per log(theta) is triangular, and the density per theta includes1/theta. This is not an independent flat product prior. The mass marginal integrates the likelihood along the allowed ridge and includes the coordinate Jacobian.

The default product central95%interval is approximately[0.973899,1.008991], while the mass multiplier interval remains[0.517926,1.914101]. Prior-averaged coverage is 232/240 for product and 227/240 for mass. Separate fixed truths give product 94/95/95 of 100 and mass **100/100/0 of 100**. Exact product nonidentifiability and prior boundaries cause the last mass interval to exclude a near-boundary truth repeatedly. These central posterior intervals are not guaranteed pointwise frequentist intervals; the failure is retained in results and tutorials. No precise physical mass-loss rate follows from this ridge. `failures/conditional-count-inference-601-grid.json` retains the earlier coarser numerical trial with the same seeds.

## Real data, rights and failures

IUE ABS_CAL is energy flux; NOISE has uncalibrated FN units and is never used as a physical-flux sigma or as Poisson counts. NEWSIPS wavelengths are vacuum heliocentric; laboratory reference and stellar systemic velocity remain distinct. QUALITY==0 is a declared selection, not a cosmic-ray-cleaning certificate. Two overlapping orders and the 1984/1989 epochs remain separate. The isolated-line reference has illustrative width and fixed parameters, with large residuals; it supplies neither chi-square nor a real-star posterior.

Source-specific notices and fixed complete bytes/SHA are in SOURCE-NOTICES.txt and source-members.json. IUE original NASA/ESA/UK mission products retain mission and STScI/MAST attribution. The Brands2025 Zenodo15044512 v1.1.1 tables and Readme are CC-BY4, for 24 LMC O-star parameter sets rather than P Cygni. No FASTWIND software/model archive, copyrighted paper originals, task tool binaries or website Engine are supplied. Newly authored Python and synthetic fixtures have the separate code license.

`failures/` preserves coordinate-sign, source interpolation, first continuum and finite-width failures. Frozen reference outputs are in `reference/`; the replay writes fresh computations to `rerun/`. Hash verification establishes file integrity; only executing the producer programs establishes numerical replay.
