specsrbench.figures.fig6_redshift_mae

Figure 6 – reconstruction error against redshift, and why it has that shape.

Six equal-count redshift bins (~95 galaxies each), plotted at each bin’s median redshift with bootstrap error bars. Equal-count rather than equal-width: the sample runs from z = 0.31 to 13.86 and is very far from uniform, so equal-width bins put almost everything in the first two and leave the rest reporting the error of a handful of galaxies. Median rather than midpoint, because the top bin spans z = 5.0-13.9 while three quarters of its galaxies lie below z = 7.1: drawn at its midpoint (z = 9.4) it stretched the curves flat.

Three panels, because raw MAE by itself answers the wrong question:

  1. MAE, with the reference noise floor – the MAE a perfect reconstruction would score against the noisy grating spectrum, sqrt(2/pi) * sigma averaged over valid pixels. The fluxes are z-scored per spectrum, so as galaxies get fainter at high z the reference’s own noise takes a growing share of its unit variance, and every method’s error rises with it.

  2. Scale-free MAE, the Table 1 metric, which shrinkage cannot improve.

  3. The amplitude ratio, sigma_method / sigma_HR over the bin’s valid pixels.

Together they show that the gap between SR2 and the classical cluster in (a) is the amplitude gap in (c), not a reconstruction advantage: in (b) it closes.

Every quantity uses the valid mask and the per-spectrum averaging of Table 1. An earlier version pooled all pixels including the 3% where the reference is padding, and so disagreed with the numbers the text quotes.

Module Attributes

EDGE_MARGIN_UM

Lines closer than this to either end of the grid are not counted as inside it -- the same margin Cache.line_positions uses.

Functions

bin_index(z[, n_bins])

(edges, index) for equal-count bins; the top edge is inclusive.

build([cache, outdir])

compute(cache[, n_bins])

Per-bin statistics for every method, and the reference noise floor.

line_count_changes(wl_lo, wl_hi[, merge_dz])

Redshifts at which one of the four diagnostic lines enters or leaves.

specsrbench.figures.fig6_redshift_mae.EDGE_MARGIN_UM = 0.05

Lines closer than this to either end of the grid are not counted as inside it – the same margin Cache.line_positions uses.

specsrbench.figures.fig6_redshift_mae.bin_index(z, n_bins=6)[source]

(edges, index) for equal-count bins; the top edge is inclusive.

Parameters:
Return type:

tuple[ndarray, ndarray]

specsrbench.figures.fig6_redshift_mae.line_count_changes(wl_lo, wl_hi, merge_dz=0.15)[source]

Redshifts at which one of the four diagnostic lines enters or leaves.

Changes closer than merge_dz share a marker ([O III] and H-beta enter within 0.06 of each other).

Parameters:
Return type:

list[tuple[float, str]]

specsrbench.figures.fig6_redshift_mae.compute(cache, n_bins=6)[source]

Per-bin statistics for every method, and the reference noise floor.

Parameters:

n_bins (int)

Return type:

dict

specsrbench.figures.fig6_redshift_mae.build(cache=None, outdir=None)[source]
Parameters:

outdir (Path | None)

Return type:

Path