hispecdrp.primitives.lsf.lsf_convolve
Generic LSF utilities: PSF stamps → 1-D kernels and spectrum convolution.
This module has no dependency on hispecdrp.simulations. HDF / pyechelle
instrument-model loading lives in hispecdrp.simulations.lsf.
Functions
|
|
|
|
|
Apply a per-pixel Gaussian LSF to a 2-D |
|
Convolve a 1-D spectrum with a wavelength-dependent LSF. |
|
Convolve a 1-D order spectrum with a wavelength-dependent Gaussian LSF. |
|
Collapse an oversampled PSF stamp to a 1-D spectral LSF. |
|
Build a per-order 1-D LSF library from one fiber's PSF stamp block. |
|
Effective Gaussian σ (detector pixels) vs spectral sample from an LSF library. |
- _convolve_numba_1d_chromatic(spec_padded, kernels, spec_out)[source]
- _psf_oversample(block, pixelsize)[source]
- convolve_l2_with_gaussian_lsf(wave_2d, flux_2d, sigma_pix_2d, *, num_sigma=5.0)[source]
Apply a per-pixel Gaussian LSF to a 2-D
(order, pix)spectrum.sigma_pix_2dhas the same shape aswave_2d/flux_2dand is in detector spectral pixels.
- convolve_numba_1d_chromatic(spec, kernels, spec_out=None)[source]
Convolve a 1-D spectrum with a wavelength-dependent LSF.
kernelsis(n_wave, n_kernel)with an oddn_kernel. Each row is the normalized kernel at that sample. The wavelength grid must be uniform (same assumption asmake_kernels()).
- convolve_order_spectrum_gaussian_lsf(wave, flux, sigma_pix, *, num_sigma=5.0)[source]
Convolve a 1-D order spectrum with a wavelength-dependent Gaussian LSF.
sigma_pixis in detector spectral pixels; converted to wavelength using localdλ/dpixfromwave.
- lsf_1d_from_psf_stamp(stamp, *, oversample, half_width_pix=None)[source]
Collapse an oversampled PSF stamp to a 1-D spectral LSF.
Stamp layout matches deposit: axis 0 = cross-dispersion (
y), axis 1 = spectral (x). Returns(offsets_pix, kernel)withoffsetsin detector spectral pixels relative to the stamp center, andkernelnormalized to unit sum.
- lsf_library_from_psf_fiber_block(fiber_block, *, pixelsize=1.0)[source]
Build a per-order 1-D LSF library from one fiber’s PSF stamp block.
fiber_blockis{order: {psf_stamps, psf_wavelengths, ...}}(the layout written by the pyechelle HDF reader). Returns{order: {"wavelengths", "offsets_list", "kernels"}}.
- sigma_pix_from_lsf_library(lib, order, wave)[source]
Effective Gaussian σ (detector pixels) vs spectral sample from an LSF library.
Uses the second moment of each collapsed 1-D kernel, interpolated in wavelength. Missing orders return σ = 1 pixel.