cabaret.Observatory.generate_image_stack

cabaret.Observatory.generate_image_stack#

Observatory.generate_image_stack(ra: float, dec: float, exp_time: float, dateobs: datetime | None = None, light: int = 1, filter_band: Filters | str = Filters.G, airmass: float = 1.5, n_star_limit: int = 2000, rng: Generator = Generator(PCG64) at 0x741C174465E0, seed: int | None = None, timeout: float | None = None, sources: Sources | None = None, convert_all_to_adu: bool = True, wcs: WCS | None = None, fwhm_multiplier: float = 5.0, tap_source: GaiaTAPSource | GaiaSQLiteSource | str | None = None, tracking_ra_rate: float | Quantity = 0.0, tracking_dec_rate: float | Quantity = 0.0, n_trail_samples: int = 50, jitter_sigma: float = 0.0, additional_sources: Sources | None = None) ndarray[source]#

Generate a stack of images from different stages in the image simulation pipeline.

From first to last, the images are: 1. Base image with bias, dark, and flat applied. 2. Astronomical image with sources, sky background, and noise. 3. Final image with pixel defects applied.

Parameters:
  • ra (float) – Right ascension of the image center (degrees).

  • dec (float) – Declination of the image center (degrees).

  • exp_time (float) – Exposure time in seconds.

  • dateobs (datetime, optional) – Observation date and time (default: now, UTC).

  • light (int, optional) – If 1, simulate light exposure; if 0, simulate dark exposure.

  • camera (Camera, optional) – Camera configuration.

  • focuser (Focuser, optional) – Focuser configuration.

  • telescope (Telescope, optional) – Telescope configuration.

  • site (Site, optional) – Observatory site configuration.

  • filter_band (Filters or str, optional) – The filter to use for the flux column. Default is “G”.

  • airmass (float, optional) – Airmass value for the observation (default: 1.5).

  • n_star_limit (int, optional) – Maximum number of stars to simulate.

  • rng (numpy.random.Generator, optional) – Random number generator.

  • seed (int or None, optional) – Seed for the random number generator.

  • timeout (float or None, optional) – Timeout for Gaia query.

  • sources (Sources or None, optional) – Precomputed sources to use instead of querying Gaia.

  • convert_all_to_adu (bool, optional) – Whether to convert all images to ADU. Default is True.

  • wcs (WCS or None, optional) – World Coordinate System information for the image.

  • fwhm_multiplier (float, optional) – Multiplier to determine the rendering radius around each star (default: 5.0).

  • tracking_ra_rate (float, u.Quantity, optional) – Telescope tracking rate offset in right ascension, in angular sky coordinate units per second as expected by generate_image. Non-zero values simulate RA drift/trailing during the exposure.

  • tracking_dec_rate (float, u.Quantity, optional) – Telescope tracking rate offset in declination, in angular sky coordinate units per second as expected by generate_image. Non-zero values simulate Dec drift/trailing during the exposure.

  • n_trail_samples (int, optional) – Number of samples used to integrate source motion across the exposure when simulating star trails. Larger values give smoother trails at higher computational cost.

  • jitter_sigma (float, optional) – 1-sigma guiding jitter in arcsec applied per trail sample (default: 0). Larger values produce broader motion blur from random tracking variations.

  • additional_sources (Sources, optional) – Additional Sources to render in every image on top of the base source set. When supplied, they are appended to the sources obtained from Gaia, or to the explicitly provided sources collection; they do not replace those base sources.

Returns:

Simulated image stack as a 3D array (uint16, shape (3, height, width)). The first slice is the base image, the second is the astronomical image, and the third is the ADU image with pixel defects applied.

Return type:

np.ndarray