liger_iris_sim.sources.convolve
Functions
|
Convolve a point source at [y, x] with a PSF. |
|
Convolve a spectrum with a Gaussian line spread function (LSF) at an average resolution over the bandpass. |
- convolve_point_source(x: float, y: float, flux: ndarray, psf: ndarray, image_out: ndarray, fix_psf_phase: bool = True) ndarray[source]
Convolve a point source at [y, x] with a PSF.
- Parameters:
x (float) – The x-coordinate of the point source - second axis.
y (float) – The y-coordinate of the point source - first axis.
flux (np.ndarray) – The flux of the point source in any units.
psf (np.ndarray) – The PSF to convolve with.
image_out (np.ndarray) – The output image array to write the result into.
fix_psf_phase (bool) – If True, the PSF is shifted by the subpixel offset of the source.
- Returns:
image_out (np.ndarray) – An image with the convolved point source in the same units as flux.
- convolve_spectrum(wave: ndarray, spectrum: ndarray, resolution: float, n_res: float = 4) ndarray[source]
Convolve a spectrum with a Gaussian line spread function (LSF) at an average resolution over the bandpass.
- Parameters:
wave (np.ndarray) – The wavelength grid. Must be uniformly sampled.
spectrum (np.ndarray) – The spectrum grid.
resolution (float) – The desired resolution, R = lambda / fwhm.
n_res (float, optional) – The number of resolution elements (fwhm) to include in the LSF on each side. Defaults to 4.
- Returns:
spectrum_conv (np.ndarray) – The convolved spectrum, sampled on the same wavelength grid as the input.