jwspecfit.resolution
Spectral resolution models for JWST NIRSpec gratings.
Provides resolving power R(λ) and instrumental line broadening σ(λ) for prism, medium-resolution, and high-resolution gratings, as well as user-supplied numeric or callable R values.
Functions
|
Estimate resolving power from the pixel spacing. |
|
Constant resolving power for a named grating. |
|
Resolving power R(λ) for NIRSpec PRISM/CLEAR (Jakobsen+22 Fig. |
|
Return R(λ) array from either a grating name or user-supplied R. |
|
Instrumental Gaussian σ in Angstroms. |
|
Instrumental Gaussian σ in km/s. |
- jwspecfit.resolution.R_from_pixels(lam_um)[source]
Estimate resolving power from the pixel spacing.
Assumes the spectrum is Nyquist-sampled, so that the FWHM of the line-spread function spans ~2 pixels: R ≈ λ / (2 Δλ).
Returns a callable
R(lam_um)that can be passed directly toresolve_R(),sigma_inst_A(), orfit_lines().This is a rough estimate and should only be used as a fallback when neither a grating name nor an explicit R is available.
- Parameters:
lam_um (array_like) – Wavelength in microns (must be sorted).
- Returns:
Function
R(lam_um) -> np.ndarraythat interpolates the estimated resolving power.- Return type:
callable
- jwspecfit.resolution.R_prism(lam_um, post_launch=True)[source]
Resolving power R(λ) for NIRSpec PRISM/CLEAR (Jakobsen+22 Fig. 6).
Tabulated values from Jakobsen et al. 2022 (A&A 661, A80, Fig. 6 — pre-launch instrument-model curve), interpolated linearly in λ. When post_launch=True (default), the curve is multiplied by 1.3, the correction factor adopted by Pollock+26 / de Graaff+25 to reflect the post-launch on-orbit performance.
- Parameters:
lam_um (array_like) – Wavelength in microns.
post_launch (bool) – If
True(default), apply the 1.3× post-launch correction.
- Returns:
Resolving power R at each wavelength.
- Return type:
np.ndarray
- jwspecfit.resolution.resolve_R(lam_um, grating=None, R=None)[source]
Return R(λ) array from either a grating name or user-supplied R.
- Parameters:
- Returns:
Resolving power at each wavelength.
- Return type:
np.ndarray
- Raises:
ValueError – If neither grating nor R is specified.
- jwspecfit.resolution.sigma_inst_A(lam_um, grating=None, R=None)[source]
Instrumental Gaussian σ in Angstroms.
σ_inst = λ / (R × 2.3548)