specsrbench.methods¶
The nine reconstructions, their display names, and the keys they are cached under.
Three different naming schemes meet in this project and none of them can be retired without invalidating a shipped cache:
snr.npzis keyed by a short name –LR,RL,MF,SR2.fit_params_cache.npzis keyed by the display name –Cubic (LR),R-L,Wiener + MF,ML (SR2).The arrays themselves are separate
.npyfiles named after the method.
Each notebook carried its own copy of all three maps, and they had drifted: three
of the six mapped ML (SR2) to the S/N key "ML (SR2)", which does not
exist in snr.npz. It never raised, because those three defined the map and
then did not use it. One table here, with the cache’s own key names checked by
tests/test_cache_integrity.py, is what replaces that.
Display labels still vary by figure – figure 2 writes LR (cubic) and
Wiener + TV where figure 3 writes Cubic (LR) and TV – and figure 3
recolours two methods to keep them legible against its diverging colour map.
Those variations are real and are preserved by registry() overrides rather
than by nine more copies of the table.
Module Attributes
Fixed display order, and the order every bar chart and panel grid uses: baseline -> linear -> non-linear/regularised -> line-list-aware -> learned, with the reference last. |
|
|
Functions
|
|
|
|
|
The method table, keyed by canonical name, with per-figure overrides. |
Classes
|
One reconstruction: how to find it, what to call it, how to draw it. |
- class specsrbench.methods.Method(key, label, array, color)[source]¶
Bases:
objectOne reconstruction: how to find it, what to call it, how to draw it.
- specsrbench.methods.METHODS: tuple[Method, ...] = (Method(key='LR', label='Cubic (LR)', array='x_low.npy', color='deeppink'), Method(key='Wiener', label='Wiener', array='wiener_cache.npy', color='tomato'), Method(key='Tikhonov', label='Tikhonov', array='tikhonov_cache.npy', color='forestgreen'), Method(key='TV', label='TV', array='tv_cache.npy', color='teal'), Method(key='RL', label='R-L', array='rl_cache.npy', color='steelblue'), Method(key='Sparse', label='Sparse', array='sparse_cache.npy', color='goldenrod'), Method(key='MF', label='Wiener + MF', array='mf_cache.npy', color='darkorchid'), Method(key='SR2', label='ML (SR2)', array=None, color='darkorange'), Method(key='HR', label='HR target', array='x_high.npy', color='black'))¶
Fixed display order, and the order every bar chart and panel grid uses: baseline -> linear -> non-linear/regularised -> line-list-aware -> learned, with the reference last.
- specsrbench.methods.registry(label_overrides=None, color_overrides=None, include_hr=True)[source]¶
The method table, keyed by canonical name, with per-figure overrides.
Overrides are given by canonical key, so a figure that renames
LRtoLR (cubic)cannot accidentally rename it to something the cache has never heard of – the key it looks arrays up by does not change.
- specsrbench.methods.LINES: tuple[tuple[str, str, float], ...] = (('Halpha', 'H$\\alpha$', 0.6563), ('OIII5007', '[O III] $\\lambda$5007', 0.5007), ('Hbeta', 'H$\\beta$', 0.4861), ('OII3727', '[O II] $\\lambda$3727', 0.3727))¶
(cache key, display label, rest wavelength in um)for the four lines the paper measures. The order is the one every per-line panel row uses.