liger_iris_sim.sources.ifs

Functions

make_point_source_ifs_cube(xdet, ydet, wave, ...)

Render one or more point sources into an IFS data cube.

make_point_source_ifs_cube(xdet: float | ndarray, ydet: float | ndarray, wave: ndarray, psf: ndarray | list[ndarray], template: tuple[ndarray, ndarray] | ndarray, flux_int: float | ndarray | None = None, psf_indices: ndarray | None = None, resolution: float | None = None, z: float | ndarray | None = None, size: tuple[int, int] | None = None, cube_out: ndarray | None = None) ndarray[source]

Render one or more point sources into an IFS data cube.

Parameters:
  • xdet (float | np.ndarray) – X-coordinate(s) of the point source(s) in detector pixels (second axis).

  • ydet (float | np.ndarray) – Y-coordinate(s) of the point source(s) in detector pixels (first axis).

  • flux_int (float | np.ndarray | None) – Integrated flux over the bandpass for each source in photons / sec / m^2. If provided, the template is scaled so that its sum over the output wave grid matches this value. If None, the template is used as-is (and must already be in physical units).

  • wave (np.ndarray) – Output wavelength bin centres, in microns.

  • template (tuple[np.ndarray, np.ndarray] | np.ndarray) –

    Spectral template. Two forms are accepted:

    • (wave_t, flux_t) — a tuple of 1-D arrays giving the template wavelengths (microns) and flux density (photons / sec / m^2 / micron). The template is integrated over each output bin via rebin_spectrum.

    • np.ndarray — a 1-D array of length len(wave) already binned onto the output grid in photons / sec / m^2 per bin. No rebinning is applied unless a redshift is provided.

  • psf (np.ndarray | list[np.ndarray]) – PSF image, or list of PSF images (for a spatially-dependent PSF).

  • psf_indices (np.ndarray | None, optional) – When psf is a list, the integer index into that list for each source. Must have the same length as xdet.

  • resolution (float | None, optional) – If given, the flux-density template is convolved to this spectral resolution before rebinning.

  • z (float | np.ndarray | None, optional) – Redshift(s) for each source. The template wavelengths are multiplied by (1 + z) before rebinning onto the output grid.

  • size (tuple[int, int] | None, optional) – Spatial size of the output cube as (ny, nx). Required when cube_out is None.

  • cube_out (np.ndarray | None, optional) – Pre-allocated output array of shape (len(wave), ny, nx). If None a new zero-filled float32 array is created.

Returns:

cube_out (np.ndarray) – Data cube of shape (len(wave), ny, nx) in photons / sec / m^2 per spaxel per wavelength bin.