Skip to main content
Sandbox Physics
Hot stars, ionized nebulae and hydrogen light

Ionized nebulae · L4

Recomputing photon counts and native Cloudy shells

How much does the ionized volume change when Cloudy follows the edge of the nebula shell by shell? First compute the ideal sphere from photon counting. Then use the same volume calculation on Cloudy’s saved shells and see how changes in atomic and spatial resolution affect the line luminosities.

Open the photon-counting exercises

Download the photon-counting exercises, compare the listed SHA-256 and extract the archive. Start with the ideal-sphere script and use the figures to check its output.

The generic shell exercise takes two files from an existing Cloudy model, first.rad and first.emis. If you have no saved model, start with the ideal-sphere exercise below.

Reading: Independent photon-counting and saved-shell scientific materials · Cloudy C25.00 fixed source commit fb07fa7142af77846af521753622453fb551bef7

Recalculate the ideal sphere in a fresh directory

Run the commands below from the extracted material directory. It creates a results folder, recomputes physical scales and the full ideal on/off history, checks independent time stepping and projection, and writes summary.json and ideal-history.csv.

Inputs are Q=1049 s−1Q=10^{49}\,\mathrm{s^{-1}}, nH=100 cm−3n_{\rm H}=100\,\mathrm{cm^{-3}} and prescribed αB=2.60×10−13 cm3 s−1\alpha_{\rm B}=2.60\times10^{-13}\,\mathrm{cm^3\,s^{-1}}. Expect RS≃3.14989 pcR_{\rm S}\simeq3.14989\,\mathrm{pc} and trec≃1218.77 yrt_{\rm rec}\simeq1218.77\,\mathrm{yr}. These are calculations with a teaching coefficient, not a new atomic-code evaluation.

Inspect coarse_failure_retained. Step 0.010.01 produces relative ion-count error about 0.0038330.003833 at half a recombination time, exceeding the registered example gate 0.0020.002. Meanwhile, the maximum photon-count residual over its history remains below 10−1210^{-12}. Step 0.0050.005 reduces the error to about 0.0019220.001922, with further improvement after another halving. The coarse failure remains in the output.

python science/recompute.py --output results/ideal
python science/validate_reader.py --output results/self-check

Reading: Independent photon-counting and saved-shell scientific materials

Check that power and projection count the same gas

One recombination time after switch-off, an initially ionized parcel has x=0.5x=0.5 and fixed-coefficient line emission 0.250.25 of its switch-off value. An independent fourth-order Runge–Kutta integration agrees with the reciprocal solution to an absolute difference of about 4.86×10−104.86\times10^{-10} in this test.

The projection_refinement output integrates a uniform sphere’s sightline intensity with annular area weights and recovers its volume luminosity. At 256 radial bins the relative difference is approximately 0.00649%. This checks geometry and integration, not complete atomic physics.

If the optional plotting dependencies are present, the next command regenerates three synthetic figures. They read the newly calculated ideal history or the same analytic geometry. No webpage screenshot or independent decorative emission map is used.

Own ideal ion-count radius and fixed-yield line-power history through source-off
Independent fixed-gas ideal reference. Shading marks source-off; radius and line light are calculated from the same particle history. This is not a native Cloudy time series. Open the full figure
python science/plot_references.py --results results/ideal --output results/figures

Reading: Independent photon-counting and saved-shell scientific materials

Inspect the native model’s physical identity

The reference source is Cloudy C25.00 commit fb07fa7142af77846af521753622453fb551bef7. The parameter-grid middle node has Q=1049 s−1Q=10^{49}\,\mathrm{s^{-1}} and nH=100 cm−3n_{\rm H}=100\,\mathrm{cm^{-3}}; the second worked example has Q=1048 s−1Q=10^{48}\,\mathrm{s^{-1}} and nH=30 cm−3n_{\rm H}=30\,\mathrm{cm^{-3}}. They use prescribed-temperature hydrogen, a 40000 K blackbody, a small inner radius, and explicit OTS, atomic-basis and stopping choices.

These native models and the ideal teaching sphere differ physically. Native results retain radial ionization structure and a more complete atomic system. The teaching reference assumes a fully ionized thin-front interior and prescribed coefficients. Match composition, temperature, geometry, spectrum, atomic configuration and equilibrium versus time dependence before interpreting a difference.

The first.rad columns are zone number, radius, depth and thickness in centimetres. The first.emis columns are matching depth and four energy emissivities: ordinary H1 blue/red lines and separately saved native CaB blue/red diagnostics. The two CaB columns use Cloudy’s Case B diagnostic for the same pair of wavelengths.

Reading: Cloudy C25.00 fixed source commit fb07fa7142af77846af521753622453fb551bef7 · Independent photon-counting and saved-shell scientific materials

Integrate the saved emission shell by shell

Point the three commands at directories already containing the base, atomic-control and spatial-control native files respectively. Missing input fails explicitly. The code checks names, zone order, overlapping printed depth intervals and positive geometry, computes each actual shell volume, multiplies by energy emissivity and adds the results. It writes a new output file only.

For midpoint radius rr and thickness Δr\Delta r, use 4π(r2Δr+Δr3/12)4\pi(r^2\Delta r+\Delta r^3/12). This is the difference of outer and inner sphere volumes expressed as a positive polynomial. Each shell retains its finite thickness.

Radius and thickness have different saved precision. The program derives intervals from each actual numeric token, uses positive directed Decimal arithmetic and records file bytes and SHA values. The output checks the volume integral. The native receipt records the charge balance check and incident-source diagnostics separately.

python science/inspect_native.py --model-dir /your/local/base --output results/native-base.json
python science/inspect_native.py --model-dir /your/local/atomic --output results/native-atomic.json
python science/inspect_native.py --model-dir /your/local/space --output results/native-space.json

Reading: Independent photon-counting and saved-shell scientific materials

Compare atomic and spatial controls separately

Each completed node has three native results. The base resolves atomic principal shells through 40 and adds 25 collapsed shells, with highest principal quantum number 65 and maximum relative gas-shell thickness 0.005. The atomic control resolves through 50 plus 15 collapsed shells, retaining highest 65. The spatial control retains the atomic basis and halves maximum gas-shell thickness to 0.0025.

After integrating the three files, compare the base with each refined result separately. Subtract the refined power from the base power and divide by the refined power. The script carries the whole rounding interval through this calculation for each line. An interval entirely inside the limit passes. An interval entirely outside fails, and one crossing the limit is UNDETERMINED.

The noncentral node’s base ordinary red-line power is approximately 1.36525×1036 erg s−11.36525\times10^{36}\,\mathrm{erg\,s^{-1}}. The middle node gives about 1.36102×1037 erg s−11.36102\times10^{37}\,\mathrm{erg\,s^{-1}}, while its CaB red-line diagnostic is 1.36574×1037 erg s−11.36574\times10^{37}\,\mathrm{erg\,s^{-1}}. Preserve these distinct atomic outputs; no normalization was adjusted to force the analytic value.

These two worked examples pass the original ±0.002\pm0.002 relative four-line gate on each of the two axes. Each pair measures what happens when one setting changes. Testing both at once would require another native run with both settings refined.

python science/compare_axes.py results/native-base.json results/native-atomic.json --output results/atomic-axis.json
python science/compare_axes.py results/native-base.json results/native-space.json --output results/space-axis.json

Reading: Independent photon-counting and saved-shell scientific materials · Cloudy C25.00 fixed source commit fb07fa7142af77846af521753622453fb551bef7

Compare the whole Cloudy grid with photon counting

Use the fixed Cloudy grid ZIP in the download panel. Check its SHA-256, extract it to a fresh directory and run the command below from that directory. It checks the file identities, then reads the radius, emissivity and hydrogen-state files from the 27 runs.

Open models → Q49-nH100 → base in the new JSON. The sum of hydrogen ion fraction times shell volume gives a sphere of equal ionized volume, with a radius of 3.178 parsecs. Photon counting with the fixed teaching coefficient gives 3.150 parsecs. The radius changes by less than one percent and the volume is 2.68 percent larger, because volume grows with the cube of radius. Try changing the node to Q48-nH30 and compare relativeVolumeDifference.

Then open lineRefinements. Each of the 18 entries changes only the atomic basis or only the shell thickness. Its four energy-line intervals pass only when each entire interval is within 0.2 percent. These checks bound the observed changes for the two separate refinements. The replay starts from the saved shells. The native solver records hold the separate charge balance checks.

The first Q49-nH100 base run stopped while opening a hydrogen atomic-data file and saved no shells. Restoring the pinned data let the same input deck complete. A missing or damaged shell file in your copy also stops the replay, so keep both the original archive and the new JSON.

python -B science/compare_native_grid.py --bundle . --out results/cloudy-shell-comparison.json

Reading: Fixed Cloudy C25 grid and saved-shell replay · Cloudy C25.00 fixed source commit fb07fa7142af77846af521753622453fb551bef7

Exercises and explained answers

  1. The coarse step conserves photons near machine precision but misses the example’s ion-count accuracy gate. Should the failed item be deleted or the conservation test altered?

    Read the explanation

    Neither. Conservation and accuracy test different properties. Retain the coarse result, its independent analytic comparison and the prospectively refined calculations. A passing count does not guarantee sufficient accuracy in the requested observable.

  2. A point relative difference is inside the gate but its full print interval crosses it. Separately, two individual refinement axes pass. Do these establish a passing interval and a joint error at the same level?

    Read the explanation

    The first case is undetermined: a point does not remove print uncertainty. Two passing individual axes do not determine the error under simultaneous refinement. Report their separate scopes and perform a joint comparison if that claim is needed.

Try the prediction

Follow one cloud from ions to hydrogen light

  1. Choose a fixed preset and record source supply, density and displayed time before distinguishing the transient from a native equilibrium reference.
  2. Export one shell record and use the previous chapter’s formulas to check volume power and projection.
  3. The public Python supplies independent ideal references and saved-native integration. Read the Lab effective model and the more complete native atom as separate calculations.

Standalone scientific materials

Download the photon-counting exercises · Original setup and two-node snapshot

The exercises use the Python standard library to compute ideal references. The generic shell integrator accepts saved Cloudy runs that you supply.

Download the fixed Cloudy grid · Run the shell comparison

The archive includes our input decks and saved radius, emissivity and hydrogen-state files.

Files, sizes and SHA-256

Sources and calculation scope

  1. Cloudy C25.00 fixed source commit fb07fa7142af77846af521753622453fb551bef7

    The native equilibrium runs pin this Cloudy release. They use uniform hydrogen at fixed temperature, a prescribed stellar spectrum and an on-the-spot treatment of recombination radiation. The teaching calculation prescribes its own constant recombination coefficient.

  2. Independent photon-counting and saved-shell scientific materials

    MIT-licensed Python recomputes ideal scales, growth, local recombination, projection and synthetic filtering. The generic shell integrator reads radius and emissivity files from locally saved runs.

  3. Fixed Cloudy C25 grid and saved-shell replay

    Includes our input decks and first.rad, first.emis and first.ovr saves. Its Python script replays the shell integrals and independent line comparisons. The archive records the original native receipt identities. Cloudy itself, its atomic data and full charge arrays are separate inputs for a native solve.

Keep reading

What this page links to directly

See this series on the content map →

Hot stars and ionized nebulae · Reading path

From photon counts to hydrogen light and evidence

  1. ArticleHow far can a hot star ionize a cloud?
  2. ArticleCounting photons to find an ionized sphere
  3. ArticleHow a hydrogen cloud fades after its star switches off
  4. ArticleAdding hydrogen-line light along a sightline
  5. You are hereRecomputing photon counts and native Cloudy shells
  6. ArticleReading a galaxy's line ratios through escaping photons
Something 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