physics.py API¶
bh_molecule.physics
¶
Attributes¶
Classes¶
BHModel
¶
BH spectroscopy model. See Also Physics explainer
Attributes¶
K2eV = spc.Boltzmann / spc.eV
instance-attribute
¶
K2wn = spc.Boltzmann / (spc.h * spc.c * 100)
instance-attribute
¶
M_BH = 11.81
instance-attribute
¶
g_as = 8
instance-attribute
¶
v00_wl = v00_wl_df
instance-attribute
¶
wn2Hz = spc.c * 100.0
instance-attribute
¶
Functions¶
A_coeff(v: int, N2: int, N1: int) -> float
staticmethod
¶
Einstein :math:A_{ul}
for :math:A\,^1\Pi \rightarrow X\,^1\Sigma^+
line.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
v
|
int
|
Upper vibrational level :math: |
required |
N2
|
int
|
Upper rotational level :math: |
required |
N1
|
int
|
Lower rotational level :math: |
required |
Returns:
Type | Description |
---|---|
float
|
:math: |
See Also [Physics explainer — A coefficient](../phys.md#a-coeff)
|
|
energy(v: int, N: int, c: MolecularConstants) -> float
staticmethod
¶
Level term value :math:E(v,N)
[cm⁻¹].
Parameters:
Name | Type | Description | Default |
---|---|---|---|
v
|
int
|
Vibrational quantum number (:math: |
required |
N
|
int
|
Rotational quantum number (:math: |
required |
c
|
MolecularConstants
|
State constants (:math: |
required |
Returns:
Type | Description |
---|---|
float
|
Term value :math: |
See Also [Physics explainer — energy](../phys.md#energy)
|
|
full_fit_model(x: np.ndarray, C: float, T_rot: float, dx: float, w_inst: float, base: float, I_R7: float, I_R8: float) -> np.ndarray
¶
Composite forward model near 433 nm: BH Q-branch + two fixed Gaussians + baseline.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
ndarray
|
Wavelength grid [nm]. |
required |
C
|
float
|
Overall population/intensity scale for the BH Q-branch. |
required |
T_rot
|
float
|
Rotational temperature [K]. |
required |
dx
|
float
|
Grid shift [nm]. |
required |
w_inst
|
float
|
Instrumental Gaussian FWHM [nm]. |
required |
base
|
float
|
Constant baseline. |
required |
I_R7
|
float
|
Amplitude of auxiliary line at :math: |
required |
I_R8
|
float
|
Amplitude of auxiliary line at :math: |
required |
Returns:
Type | Description |
---|---|
ndarray
|
Model evaluated on |
See Also [Physics explainer — full fit model](../phys.md#full-fit-model)
|
|
line_profile(x, wl, w_inst, T)
¶
Gaussian line profile in wavelength with Doppler ⊕ instrumental FWHM.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
array_like
|
Wavelength grid [nm]. |
required |
wl
|
float
|
Line center wavelength [nm]. |
required |
w_inst
|
float
|
Instrumental FWHM [nm] (Gaussian). |
required |
T
|
float
|
Translational/kinetic temperature [K] for Doppler broadening. |
required |
Returns:
Type | Description |
---|---|
ndarray
|
Normalized profile sampled on |
See Also [Physics explainer — line profile](../phys.md#line-profile)
|
|
spectrum(x: np.ndarray, C: float, T_rot: float, w_inst: float, T_tra: float, branch: Branch, v_max: int = 2, N2_max: int = 22) -> np.ndarray
¶
Branch spectrum on a wavelength grid; sums Gaussian lines over P/Q/R.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
ndarray
|
Wavelength grid [nm]. |
required |
C
|
float
|
Population scale factor. |
required |
T_rot
|
float
|
Rotational temperature [K]. |
required |
w_inst
|
float
|
Instrumental Gaussian FWHM [nm]. |
required |
T_tra
|
float
|
Translational temperature [K] for Doppler. |
required |
branch
|
Branch
|
Rotational branch to synthesize. |
required |
v_max
|
int
|
Highest upper vibrational level :math: |
2
|
N2_max
|
int
|
Highest upper rotational level :math: |
22
|
Returns:
Type | Description |
---|---|
ndarray
|
Spectrum on |
See Also [Physics explainer — spectrum](../phys.md#spectrum)
|
|