jwspecabund.direct
Direct T_e method for ionic and total abundances.
Uses PyNEB for the atomic physics: electron temperature from
auroral-to-nebular line ratios, electron density from density-sensitive
doublets, and ionic abundances via getIonAbundance().
References
DESI DR2 (arXiv:2601.02463) T_e-T_e relation
Osterbrock & Ferland (2006) for Case B recombination
Functions
|
Derive T_e(low) from T_e(high) using an empirical T_e-T_e relation. |
|
Predict the CIII] 1909/1907 flux ratio at a given electron density. |
|
Compute T_e(N+) from the [NII] auroral/nebular ratio. |
|
Compute T_e(O++) from the [OIII] auroral/nebular ratio. |
|
Compute T_e(O++) from the [OIII] UV/optical ratio 1666/(5007+4959). |
|
Compute all available ionic abundances. |
|
Compute electron density from a density-sensitive doublet. |
|
Compute electron density from the CIII] 1907/1909 ratio. |
|
Compute electron density from the NIV] 1483/1486 ratio. |
|
Derive total element abundances from ionic abundances + ICFs. |
|
Predict the NIV] 1483/1486 flux ratio at a given electron density. |
- jwspecabund.direct.Te_low_from_high(Te_high, relation='desi')[source]
Derive T_e(low) from T_e(high) using an empirical T_e-T_e relation.
- jwspecabund.direct.ciii_ratio_at_density(ne, Te=10000.0)[source]
Predict the CIII] 1909/1907 flux ratio at a given electron density.
Useful for fixing the CIII] doublet ratio in the fitter when the density is assumed or known from another diagnostic.
- jwspecabund.direct.compute_Te_NII(flux_5756, flux_6585, ne)[source]
Compute T_e(N+) from the [NII] auroral/nebular ratio.
- jwspecabund.direct.compute_Te_OIII(flux_4363, flux_5007, flux_4959, ne)[source]
Compute T_e(O++) from the [OIII] auroral/nebular ratio.
Uses PyNEB
getTemDen()on the O++ atom with the standard diagnostic ratio [OIII] 4363 / ([OIII] 5007 + [OIII] 4959).
- jwspecabund.direct.compute_Te_OIII_1666(flux_1666, flux_5007, flux_4959, ne)[source]
Compute T_e(O++) from the [OIII] UV/optical ratio 1666/(5007+4959).
Uses the O III] 1666 Å intercombination line (5→2 transition) as a UV auroral diagnostic when [OIII] 4363 is unavailable or low-SNR. The emissivity ratio 1666/(5007+4959) is monotonically increasing with T_e and more temperature-sensitive than 4363/(5007+4959) due to the larger energy gap (7.5 eV vs 2.8 eV).
- jwspecabund.direct.compute_ionic_abundances(fluxes, Te_high, Te_low, ne, ne_mid=None, ne_high=None)[source]
Compute all available ionic abundances.
- Parameters:
fluxes (dict) – Dust-corrected emission-line fluxes keyed by line name. Must include
"HBETA"for normalisation.Te_high (float) – T_e(O++) in K.
Te_low (float) – T_e(O+/N+) in K.
ne (float) – Electron density in cm^-3 (low-ionisation zone).
ne_mid (float, optional) – Electron density for the intermediate-ionisation zone (cm^-3). Traced by CIII] 1907/1909 (~24 eV). If
None, defaults to ne. Used for O²⁺, Ne²⁺, C²⁺, N²⁺, S²⁺, Ar²⁺. O²⁺ and Ne²⁺ use this intermediate-zone density (not ne_high): the [OIII] 5007/Hβ and [NeIII] 3869/Hβ abundances are density- insensitive below ~10⁴–10⁵ cm⁻³, and CIII] (24–48 eV) overlaps the O²⁺ zone (35–55 eV), whereas NIV] (47–77 eV) traces more highly-ionised gas. This decouples O²⁺/Ne²⁺ from the noisy high-ionisation N IV] density.ne_high (float, optional) – Electron density for the high-ionisation zone (cm^-3). Traced by NIV] 1483/1486 (~47 eV). If
None, defaults to ne_mid. Used for N³⁺, N⁴⁺, C³⁺.
- Returns:
Ionic abundances, e.g.
{"O+/H+": val, "O++/H+": val, ...}.- Return type:
- jwspecabund.direct.compute_ne(flux_line1, flux_line2, doublet='SII', Te_guess=10000.0)[source]
Compute electron density from a density-sensitive doublet.
- Parameters:
- Returns:
Electron density n_e in cm^-3.
- Return type:
- jwspecabund.direct.compute_ne_CIII(flux_1907, flux_1909, Te_guess=10000.0)[source]
Compute electron density from the CIII] 1907/1909 ratio.
Probes the intermediate-ionisation zone.
- jwspecabund.direct.compute_ne_NIV(flux_1483, flux_1486, Te_guess=10000.0)[source]
Compute electron density from the NIV] 1483/1486 ratio.
Probes the high-ionisation zone.
- jwspecabund.direct.compute_total_abundances(ionic, logU=None, Z_Zsun=None, ne=None, icf_method='auto', ionic_upper_limits=None, _lock_NO_icf=None)[source]
Derive total element abundances from ionic abundances + ICFs.
- Parameters:
ionic (dict) – Ionic abundance dict from
compute_ionic_abundances().logU (float, optional) – Ionisation parameter log(U). Required for Martinez+25 ICFs.
Z_Zsun (float, optional) – Gas-phase metallicity in solar units. Required for Martinez+25 ICFs.
ne (float, optional) – Electron density in cm^-3 for Martinez+25 ICF density interpolation.
icf_method (str) –
"auto"(default): use Martinez+25 for N/O when logU is provided, fall back to Izotov+06 otherwise."martinez25": force Martinez+25 ICFs (requires logU and Z_Zsun)."izotov06": use Izotov+06 ICFs only."direct_sum": sum all detected nitrogen ions directly (Topping+2024, Yanagisawa+2025, Cameron+2023). Tiered fallback: Tier 1 (N⁺ + N²⁺ + N³⁺) / (O⁺ + O²⁺), Tier 2/3 (N²⁺ + N³⁺) / O²⁺, Tier 4 Izotov+06 optical fallback._lock_NO_icf (str | None)
- Returns:
Total abundance ratios:
"O/H","N/O","S/O","Ne/O","Ar/O","C/O","N/O_UV"as available. When Martinez+25 is used, also includes"NO_icf_name"and"icf_method"keys.- Return type: