rubix.telescope.lsf package#
Submodules#
rubix.telescope.lsf.lsf module#
Mainly reimplmented from SimSpin: https (//github.com/kateharborne/SimSpin/blob/4e8f0af0ebc0e43cc31729978deb3a554e039f6b/R/utilities.R#L570):
- rubix.telescope.lsf.lsf.apply_lsf(datacube: Float[Array, 'n1 n2 wave_bins'], lsf_sigma: float, wave_resolution: float, extend_factor: int = 12) Float[Array, 'n1 n2 wave_bins'][source]#
Apply the Line Spread Function (LSF) to a datacube.
This function first flattens the datacube, applies the LSF to the spectra, and then reshapes the datacube back to the original shape.
- Parameters:
datacube (Float[Array, "n1 n2 wave_bins"]) – The input datacube to apply the LSF to.
lsf_sigma (float) – The sigma of the LSF. Currently a Gaussian kernel.
wave_resolution (float) – The wave resolution of the spectra inside the datacube.
extend_factor (int) – The factor to extend the kernel by.
- Returns:
The convolved datacube.
- Return type:
convolved (ndarray)
- rubix.telescope.lsf.lsf.apply_lsf_spectra(spectra: Float[Array, 'n_spectra wave_bins'], lsf_sigma: float, wave_resolution: float, extend_factor: int = 12) Float[Array, 'n_spectra wave_bins'][source]#
Apply the Line Spread Function (LSF) to multiple spectra.
This function applies the LSF to multiple spectra in parallel using JAX’s vmap. Currently only supports a Gaussian kernel and fixed wave resolution across all spectra and wavelenghts.
- Parameters:
spectra (Float[Array, "n_spectra wave_bins"]) – The input spectra to apply the LSF to.
lsf_sigma (float) – The sigma of the LSF. Currently a Gaussian kernel.
wave_resolution (float) – The wave resolution of the spectra.
extend_factor (int) – The factor to extend the kernel by.
- Returns:
The convolved spectra.
- Return type:
convolved (ndarray)