Slitless grating (wcc_sim.grating)

Full-frame slitless grating images: the wcc_etc.grating model placed on the detector.

Under development, as is wcc_etc.grating: the grating design is provisional.

wcc_etc.GratingSimulation supplies the physics for one star on one half of the grating (coating, diffraction efficiency, dispersion, dispersed PSF image and the slitless sky rate). This module places it on the array:

  • The grating has two halves, split at detector column split_x (default the array centre). The blue half (350-700 nm) is on the left and disperses along +x (rows); the red half (600-1100 nm) is on the right and disperses along +y (columns). Each star’s zeroth order is at its catalogue position.

  • The grating sits in front of the sensor, so the converging beam of a star has a finite footprint on it (beam_radius_px, 620 px on the IMX455). A star closer to the split than that sends part of its light through each half and gets both spectra, each scaled by the fraction of the beam on that half (blue_fraction). The sky rate changes across the split in the same way.

  • Every star of one spectral type shares one dispersed template per half (grating_template), scaled by its G magnitude.

Not modelled: the PSF of a beam clipped by the split (both spectra use the full-pupil PSF, and the central obscuration is ignored in the beam fraction), PSF wings and scattered light beyond the template (65 px across the dispersion), extended sources, defocus, and what wcc_etc.grating leaves out (static wavefront error, the dispersion change across the tilted sensor).

wcc_sim.grating.blue_fraction(x, split_x, beam_radius_px)[source]

Fraction of the beam of a source at column x that passes the blue (left) half.

The beam footprint on the grating is taken as a filled circle of radius beam_radius_px centred on the source; the fraction is the area of the circle left of split_x: 1 well left of the split, 0.5 on it, 0 well right.

class wcc_sim.grating.GratingTemplate(fine, origin, oversample)[source]

Bases: object

Dispersed image of one star [e-/s at G = REF_MAG] on a fine grid, detector-oriented.

fine has oversample fine pixels per detector pixel; the zeroth order is at the centre of detector pixel origin = (y0, x0) of the stamp. total is the rate in the template (all rendered orders).

stamp(sy=0, sx=0)[source]

Detector-resolution stamp with the source moved by (sy, sx) fine pixels; cached.

add(image, x, y, scale)[source]

Add scale x the template to image with the zeroth order at float pixel (x, y).

wcc_sim.grating.grating_template(spt, sensor='zwo', half='blue', oversample=5, orders=(-1, 0, 1, 2), grating=None)[source]

GratingTemplate of a Pickles type spt at G = REF_MAG on one half; memoized.

grating (dict) passes design overrides to wcc_etc.GratingSimulation (lines_per_mm, distance_mm, psf_npix, …).

wcc_sim.grating.simulate_grating_field(ra, dec, sensor='zwo', exptime=90.0, n_reads=1, pa=0.0, mag_limit=21.0, add_noise=True, seed=None, output=None, catalog=None, shape=None, oversample=5, orders=(-1, 0, 1, 2), split_x=None, grating=None, cache_dir=None, write_clean=True, gain_mode=None, offset_arcsec=(0.0, 0.0))[source]

Simulate one slitless-grating exposure of the Gaia field at (ra, dec) -> SimulatedField.

Under development (the grating design is provisional). See the module docstring for the layout and what is not modelled. The arguments not listed below (exptime, n_reads, pa, mag_limit, add_noise, seed, output, catalog, shape, cache_dir, write_clean, gain_mode, offset_arcsec) are those of simulate_field.

Parameters:
  • ra (float) – Pointing [deg, ICRS], the array centre (before offset_arcsec).

  • dec (float) – Pointing [deg, ICRS], the array centre (before offset_arcsec).

  • sensor (str, default "zwo") – “zwo” (Sony IMX455) or “qcmos” (HWK4123).

  • oversample (int, default 5) – Fine pixels per detector pixel of the templates (positive, odd); stars are placed to 1 / (2 oversample) px.

  • orders (tuple of int, default (-1, 0, 1, 2)) – Diffraction orders rendered.

  • split_x (float, optional) – Column [px of this frame] of the boundary between the blue (left) and red (right) half. Default (nx - 1) / 2, the centre of the (sub)array.

  • grating (dict, optional) – Design overrides for wcc_etc.GratingSimulation (lines_per_mm, distance_mm, levels, coating_peak, edge_width_nm, psf, psf_npix).

Returns:

CAT columns added: x, y (zeroth order), spt, spt_fallback, blue_fraction, rate_e_s (rendered rate, all orders and both halves), in_image, saturated (the star’s own brightest pixel, any order, reaches the per-frame ceiling; the SATMASK extension has the pixels, sky and neighbours included). params holds the geometry an extraction needs: grating_split_x, grating_beam_radius_px, grating_dispersion_px_nm, grating_orders.

Return type:

SimulatedField