utils¶
- starkzee.utils.species_to_ZA(species)[source]¶
Return (Z, A) for a species name string.
- Parameters:
species (
str) – Species identifier, case-insensitive. Accepted values:'H'/'hydrogen','D'/'deuterium','T'/'tritium'.- Returns:
- Raises:
ValueError – If species is not in the lookup table.
- starkzee.utils.nuclear_mass_kg(Z, A=None)[source]¶
Return the nuclear mass [kg] for nuclear charge Z and mass number A.
- starkzee.utils.reduced_mass_rydberg_ev(Z, A=None)[source]¶
Return the reduced-mass-corrected Rydberg energy for nuclear charge Z [eV].
Replaces the infinite-nuclear-mass value
RYDBERG_EVwith the atom-specific value:R_atom = R_∞ × μ / m_e = R_∞ / (1 + m_e / M_nucleus)
where M_nucleus is the nuclear mass from
nuclear_mass_kg().
- starkzee.utils.temp_ev_to_joules(t_ev)[source]¶
Convert a thermal energy from eV to Joules.
Uses the exact SI definition e = 1.602176634e-19 C so that 1 eV = e × 1 J exactly.
- starkzee.utils.temp_ev_to_kelvin(t_ev)[source]¶
Convert a thermal energy from eV to the equivalent temperature in Kelvin.
Uses k_B T = e × T_eV, so T [K] = e / k_B × T_eV.
- starkzee.utils.energy_ev_to_wavelength_nm(energy_ev)[source]¶
Convert photon energy in eV to vacuum wavelength in nm.
Uses the relation E = hc / λ, giving λ [nm] = hc [eV·nm] / E [eV].
- Parameters:
energy_ev (
floatorarray-like) – Photon energy [eV]. Zero-valued elements are mapped to zero wavelength rather than triggering a division-by-zero error.- Returns:
Vacuum wavelength [nm]. For an increasing energy array the returned wavelengths are in decreasing order.
- Return type:
floatorndarray
Notes
hc = 2π ħ c ≈ 1239.842 eV·nm. The code derives this from CODATA values of ħ and c so there is no hardcoded conversion constant.
- starkzee.utils.vacuum_to_air_wavelength_nm(wavelength_vac_nm)[source]¶
Convert vacuum wavelength(s) to air wavelength(s) using the Edlén (1966) formula.
Valid for standard dry air (15 °C, 101 325 Pa) over approximately 200–2000 nm. The formula is the one used by NIST ASD for all tabulated air wavelengths.
- Parameters:
wavelength_vac_nm (
floatorarray-like) – Vacuum wavelength [nm].- Returns:
Air wavelength [nm].
- Return type:
floatorndarray
Notes
Edlén (1966) dispersion formula:
(n − 1) × 10⁸ = 8342.13 + 2406030 / (130 − σ²) + 15997 / (38.9 − σ²)
where σ = 1/λ_vac [µm⁻¹] = 1000 / λ_vac [nm].
References
Edlén, B., Metrologia 2, 71 (1966).
- starkzee.utils.wavelength_nm_to_energy_ev(wavelength_nm)[source]¶
Convert vacuum wavelength in nm to photon energy in eV.
Uses E = hc / λ.
- starkzee.utils.frequency_thz_to_energy_ev(frequency_thz)[source]¶
Convert photon frequency in THz to energy in eV.
Uses E = h·f.
- starkzee.utils.energy_ev_to_frequency_thz(energy_ev)[source]¶
Convert photon energy in eV to frequency in THz.
Uses f = E / h.