Spectral Line Explorer BETA (DEVELOPMENT MODE)

Spectral Line Explorer - Astrophyzix

Spectral Line Explorer ASTROPHYZIX RESEARCH MODULE

LIVE

A real time spectral line explorer for absorption and emission spectra. Detect atomic lines, match them to a reference transition list, fit redshift and Doppler velocity, and compare against a synthetic model spectrum, directly in the browser.

Spectrum (wavelength vs normalized intensity) worker: idle

Your browser does not support canvas rendering. This panel would show an interactive plot of wavelength (nm) versus normalized intensity, with detected absorption lines marked in orange and emission lines marked in green.

Data source

Detected lines
Physical conditions
Synthetic overlay
Methodology
User guide

0 lines detected

obs nmmatchrest nmdv km/sfwhm
Click a detected line, or a point on the plot, for transition details.

Toggle molecular / telluric bands

Inferred conditions (from detected lines)

Redshift z (least squares fit)-
Radial velocity-
Excitation temperature proxy-
Mean line FWHM-
Species identified-
Temperature is a simplified proxy derived from Balmer line depth ratios, not a full Saha-Boltzmann / NLTE solve. Treat as illustrative, not a publication-grade diagnostic. Per-line velocity residuals are typically well under 15 km/s for isolated, resolved lines; closely spaced multiplets (e.g. the Mg b triplet, Na D doublet) can still show larger residuals because a single-extremum parabolic fit does not deblend overlapping profiles. See Methodology tab.

Synthetic spectrum controls

Temperature5778 K
Metallicity [Fe/H]0.0
Pressure / density (broadening)1.0
Turbulence / v sin i (km/s)3 km/s
Radial velocity (km/s)0 km/s
Continuum uses a real Planck blackbody function. Line profiles are pseudo-Voigt (Gaussian thermal+turbulent core, Lorentzian pressure wing) built from a small curated line list, interpolated by species strength and the sliders above. This is a teaching-grade approximation, not a full LTE radiative-transfer grid (no real opacity tables were available to load in this environment).

Scientific methodology

Smoothing: Savitzky-Golay quadratic filter, configurable odd window (default 7), used to suppress noise before derivative-based feature finding.

Line detection: first-derivative zero crossings on the smoothed spectrum locate candidate extrema; second-derivative sign confirms absorption (concave up) vs emission (concave down). Each candidate's line center and depth are then refined with an exact parabola fit through the three smoothed samples bracketing the extremum, recovering a sub-pixel wavelength rather than snapping to the nearest grid point. A candidate is kept only if its refined prominence exceeds 4x the spectrum's local noise RMS (estimated from the raw-minus-smoothed residual) and its FWHM is at least 0.5 nm; single-sample noise spikes typically fail one or both tests and are discarded. FWHM itself is measured by linear interpolation to the half-max crossing on each side of the refined extremum.

Auto-detection: line detection re-runs automatically whenever a new primary spectrum is loaded (preset, file, or paste), so the Detected Lines and Physical Conditions tabs never show stale results from a previous spectrum.

Limitation of the refinement: parabolic refinement fits a single extremum and does not deblend overlapping profiles, so closely spaced multiplets (Mg b triplet, Na D doublet) can still show larger per-line velocity residuals than isolated lines even after refinement.

Line reference: a curated subset of well established atomic transitions (Balmer series, Ca II H and K, Na D, Mg b, He I, selected Fe I and forbidden nebular lines, common lab plasma Ar I lines) with literature rest wavelengths in air, nm. This is a hand-entered reference set, not a live NIST / HITRAN / ExoMol query - no network access is available in this runtime, so the full external databases could not be fetched or bundled.

Matching and redshift: each detected line is compared to nearby rest wavelengths within a tolerance window, ranked by wavelength proximity and tabulated line strength. A first-pass redshift is estimated as the median fractional offset across candidate matches, then lines are re-matched at the shifted reference wavelengths and z is refit by unweighted least squares.

Doppler shift: relativistic formula lambda_obs = lambda_rest * sqrt((1+beta)/(1-beta)), beta = v/c.

Thermal broadening: Gaussian FWHM = lambda0 * sqrt(8 ln2 * k T / (m c^2)) for the transition's species mass.

Rotational / turbulent broadening: convolved as an additional Gaussian width term parameterized by the turbulence / v sin i control.

Pressure broadening: an added Lorentzian component (Stark/collisional proxy) mixed with the Gaussian core using the Thompson-Cox-Hastings pseudo-Voigt approximation, scaled by the density slider.

Continuum: real Planck blackbody radiance B(lambda,T), normalized.

Threading: line detection and matching run on a background Web Worker via structured-clone message passing, so the UI thread stays responsive on large arrays. Transferable ArrayBuffers are used to avoid copying the sample arrays back to the main thread. True shared-memory (SharedArrayBuffer) threading is not available: it requires cross-origin-isolation response headers on the hosting page, which are outside this module's control on a typical embedded blog page.

Compute precision: all numeric state (wavelength and intensity arrays) is stored in Float64Array for full double-precision, matching the module's stated numerical standard even though no WebAssembly or WebGPU compute path was available to compile/run in this environment.

Provenance: every fit result records which algorithm, tolerance and parameter values produced it, shown in this tab and included in CSV export.

Documentation

Quick start

1. Pick a preset under Data source, or upload/paste your own wavelength,intensity data.
2. Click detect lines in the spectrum panel.
3. Open Detected lines to see the matched line table; click a row or a tick mark on the plot for detail.
4. Open Physical conditions for the redshift/velocity fit and other derived quantities.
5. Open Synthetic overlay, switch it on, and move the sliders to compare a model spectrum against the observed one.
6. Use export lines (csv) to download the line table with provenance columns.

Loading your own data

File upload: .csv, .tsv, or .txt, two columns per line: wavelength_nm, intensity. A non-numeric header row is skipped automatically.

Paste data: click "paste data", paste the same two-column format, click "load pasted data".

Intensity is rescaled so the file maximum is 1.0. Wavelength is sorted ascending automatically.

Compare and difference modes

compare mode: on loads the next spectrum you choose as a second overlaid trace instead of replacing the first.

difference mode: on plots the residual between the primary and comparison spectra. Requires a comparison spectrum to be loaded first.

Interface reference

Spectrum plot: drag to pan, wheel to zoom, click near a line to select it. The color rail beneath the axis approximates visible-light color by wavelength.

Toggle bands: shades approximate windows for TiO and the O2 telluric A/B bands. Illustrative positions, not fitted profiles.

Physical conditions: redshift, velocity, a Balmer-ratio temperature proxy, mean FWHM, identified species.

Synthetic overlay: temperature, metallicity, pressure/density, turbulence/v sin i, and radial velocity sliders driving a Planck-continuum + pseudo-Voigt model.