Repository navigation
SED: CCM89/O'Donnell joined to a fitted near-IR power law, sed.nir_alpha (dust stack PR 5, 8.9.2) - #610
Merged
Conversation
…pha (8.9.2) Under fit_rv_dust the SED's extinction law is now CCM89 + O'Donnell (1994) blueward of 0.909 micron (x = 1.1/micron, CCM's own segment boundary), unchanged, and A_lam ~ lambda**-alpha redward, continuous at the join. alpha is one sampled sight-line parameter, sed.nir_alpha ~ N(1.85, 0.25) on [1.2, 3.0] (JDE ruling 2026-11-09), shared by every star, the red clump and both layers of the dust profile's near/far R_V split. - extinction.py: ccm89_nir_basis gives per-wavelength (a, b, L) so that k = (a + b/R_V) exp(alpha L); no mask, no branch, no pt.where. Still linear in 1/R_V at fixed alpha, so the near/far mix stays exact. The power law starts from the optical polynomial's value at x = 1.1 (continuity); CCM89 itself jumps there by 0.05% (R_V 3.1) to 0.34% (R_V 1.5), so alpha = 1.61 is CCM exactly blueward and times that constant redward. A marked seam for Nataf's announced Roman-band bulge curve. - spectral_bc.py: law "ccm89" -> "ccm89_nir", bc_node/bc_np take alpha. - sed.py: declares nir_alpha with rv_dust; bc_node/bc_np/appmag_np take alpha; nir_alpha_node / nir_alpha_start; the errscale count adds it once unless pinned; the figure reddens with it; a WARNING names filters past 3 micron, where the power law is extrapolated; prose updated. - red clump and the dust anchor (dust_anchor_band) read the same alpha. - rv_dust_near prior remapped through the new law at alpha 1.85: N(2.88, 0.19) -> N(2.84, 0.18). - Nataf:2016 bib entry. Docs: sed.md "The near-infrared slope", redclump.md, CLAUDE.md map line. Measured on the real R = 3000 grid (clump spectrum, A_V = 3): at R_V 1.946 (Nataf+2016's A_I/E(V-I)) and alpha 1.85, av/A_Ks = 13.9 (2MASS), 13.8 (VISTA), A_I/av = 0.532; the four Nataf+2016 bulge ratios to 2.5%. Table mode is untouched; no shipped example sets fit_rv_dust. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AWjnwpYHm56hSpKBzbPhrG
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Dust stack PR 5 (review 8.9.2, ruled by JDE 2026-11-09). Under
sed: {fit_rv_dust: true}the SED's extinction law becomes:Here x = 1/lambda, the join is at 0.909 micron (CCM's own segment boundary), and alpha is a new sampled sight-line parameter,
sed.nir_alpha~ N(1.85, 0.25) on [1.2, 3.0]. Every star, the red clump and both layers of #604's near/far R_V split share that one alpha. Each layer keeps its own R_V. The law is still linear in 1/R_V at fixed alpha, so the near/far mix stays exact.Why: toward the bulge one CCM R_V cannot match the red clump's optical and near-IR ratios at once. Nataf et al. (2016) show that the bulge curve needs at least two degrees of freedom. Every bulge near-IR slope that has been measured is also steeper than CCM's 1.61 (Nishiyama et al. 2009, about 2.0). With this change, R_V carries A_I/E(V-I) and alpha carries E(I-J)/E(V-I) and A_V/A_Ks.
The table mode (the default) is untouched. Its BCs are tabulated at the shipped law, which has no alpha.
Details
tests/test_nir_power_law.pypins both statements.k = (a + b/R_V) * exp(alpha * L). Blueward of the join, L = 0 and (a, b) are CCM's values. Redward, L = ln(x/1.1) and (a, b) are the values at the join. There is no mask, no branch and nopt.where. Values and gradients (in R_V, alpha and A_V) are finite and agree between the C and JAX backends at alpha 1.2/1.61/1.85/3.0 and R_V 1.5/6.0, with the I passband straddling the join.SpectralBCconsumes only the per-bin (a, b, L) thatextinction.ccm89_nir_basisreturns, so a published table can enter as another basis builder with its own law name. The swap point is marked inextinction.pyand described insed.md. This PR adds no stub code.SED.bc_node/bc_np/appmag_nptakealphaand raise without it underfit_rv_dust.nir_alpha_node(system)builds the parameter lazily, the way the R_V nodes are built. The red clump's context nodes, its start seed and checks, thedust_anchor_bandinversion, the dilution start solver and the SED figure all read the same alpha.nir_alphacounts once toward the errscale pin, assed.rv_dustdoes, unless it is pinned withsigma: 0.rv_dust_nearprior (Schlafly et al. 2016's R' mapped through our spectral path) was remapped under the new law at alpha 1.85: N(2.88, 0.19) -> N(2.84, 0.18).Nataf:2016.What the law gives
Measured on the real R = 3000 runtime grid, with the red-clump reference spectrum (4700 K, logg 2.5, [Fe/H] 0), band-integrated, at A_V = 3. "av" is the model's A_V parameter (the extinction at 0.5495 micron).
R_V = 1.946 is where A_I/E(V-I) meets Nataf+2016's mean. At alpha 1.85 the other three ratios match to +0.0%, -2.5% and +1.0%. In VISTA Ks, av/A_Ks = 13.76. The ratio av/A_Ks is flat in A_V: 13.90, 13.91 and 13.92 at A_V = 1, 3 and 8. Band-integrated A_I/A_V(band) is 0.545.
Consistency with #609 (exozippy-mkdust)
They are not consistent. #609 converts map values to A_V by hand with Nataf+2013's bulge means: A_V = 15.30 A_Ks and A_V = 6.458 E(J-Ks).
At the prior center, this law gives:
alpha does not close the E(J-Ks) gap: J and Ks both lie in the power law, so E(J-Ks)/E(V-I) barely moves with alpha. That gap is the known 15% disagreement between Nataf+2013 and Nataf+2016 in E(J-Ks)/E(V-I). This law follows 2016, and no law joined at 0.909 micron reaches 2013's 0.343.
#609 itself says its Ks lines "become the better choice once the near-infrared slope is fitted". Now that the slope is fitted, the consistent route is to write the map value in its own band with
sed: {dust_anchor_band: 2MASS/2MASS.Ks}(or VISTA Ks), so the fit's law, alpha included, does the conversion. A new test checks that this inversion follows alpha. This PR does not change #609 and is based on master, not on #609.Shipped examples
No shipped example sets
fit_rv_dust, so none should move. I built all 27 shipped configs that carry an SED on origin/master and on this branch, and compared the start logp and every per-term logp atinitial_point(). The 27 configs are every non-DC2018 SED config plus the fourDC2018/configsones; the DC2018 sweep and ablation trees were skipped as harness directories.All 27 are bit-identical: Delta logp = 0 and max |Delta term| = 0, with the same free variables. The configs are KMT-2019-BLG-1806 (x3), KMT-2021-BLG-1122L, MOA-2008-BLG-379, gj1214, hat3 (x5), hd80606 (x3), kelt17 (x3), kelt4 (x2), ob140939_today, toi3919 (x2), wasp18 and DC2018_128 (x4). No acceptance fixture changes.
Tests
tests/test_nir_power_law.pycovers:sed.nir_alphawith its prior;test_sed_fit_rv_dust.py: the inventory count is now 1 + 4 + 1 + 1, and the graph test passes alpha.test_redclump_recovery.py: the truth is generated at alpha 1.85.test_sed_fit_rv_dust.py,test_redclump.py,test_dust_profile.pyandtest_inspect_start.pypass locally (-n0, not slow).🤖 Generated with Claude Code
https://claude.ai/code/session_01AWjnwpYHm56hSpKBzbPhrG