End-to-end pipeline (wcc_sim.pipeline)
End-to-end WCC field simulation: Gaia -> rates -> PSF -> image -> FITS.
- class wcc_sim.pipeline.SimulatedField(image_adu: numpy.ndarray, image_e: numpy.ndarray, image_clean: numpy.ndarray, saturation_mask: numpy.ndarray, wcs: astropy.wcs.wcs.WCS, catalog: astropy.table.table.Table, params: dict = <factory>, models: dict = <factory>)[source]
Bases:
object- Parameters:
- plot(ax=None, which='adu', catalog=False, satmask=False, **kw)[source]
The image with an asinh stretch (
wcc_sim.plotting.plot_image()).whichis"adu","e"or"clean";catalog=Truecircles the in-image stars andsatmask=Trueoutlines the saturated pixels. Returns the axes.
- plot_cutout(ax=None, **kw)[source]
Log-stretched cutout around a star (
wcc_sim.psfreport.plot_cutout()).
- plot_psf_profile(ax=None, **kw)[source]
Radial PSF profile, model terms and render (
wcc_sim.psfreport.plot_psf_profile()).
- plot_satmask(ax=None)[source]
The saturation mask (
wcc_sim.psfreport.plot_satmask()).
- psf_report(path='wcc_sim_psf_report.pdf', **kw)[source]
Write the one-page PSF report (
wcc_sim.psfreport.make_psf_report()).
- wcc_sim.pipeline.simulate_field(ra, dec, sensorfilter='zwo:r', focus=None, exptime=90.0, n_reads=1, pa=0.0, jitter_sigma_mas=None, mag_limit=21.0, add_noise=True, seed=None, output=None, catalog=None, shape=None, stamp_npix=None, oversample=11, wings=True, wavelength_nm=None, scatter=True, scatter_fraction=None, cache_dir=None, write_clean=True, report=None, extended_sources=None, chromatic=False, wing_floor_sigma=0.1, gain_mode=None)[source]
Simulate one WCC detector image of the Gaia field at (ra, dec).
Parameters mirror the design spec; shape=(ny, nx) overrides the full array (useful for quick looks and tests), catalog= bypasses the Gaia query with a pre-made Table. wings=True (default) extends bright-star PSFs beyond the finite stamp with an analytic power-law wing (see wcc_sim.wings) so truncation stays below 0.1 sigma of the background noise instead of printing square “postage stamp” edges.
wing_floor_sigma sets how far out each star’s wing and halo are drawn: to the radius where that star’s surface brightness falls to this many sigma of the background noise. The default 0.1 keeps the truncation invisible in any single pixel, which is what it was chosen for – but it is a systematic cut, so a statistic that averages many pixels sees it at sqrt(N) times that. Measuring a scattered-light background over ~1e5 pixels needs ~0.01 or below, at which point the drawn radius grows and so does the render time. params[“wing_floor_e”] reports the level in electrons and psf_decomposition(…)[“r_out_px”] the radius it put on row 0; when that radius is smaller than the distance from the star to the far corner of the array, the corners of the frame have no starlight in them at all.
scatter=True (default) adds the measured scattered-light halo from the FRED stray-light model (see wcc_sim.scatter) as a second additive PSF term, reaching ~37,000 px – past the chip diagonal, so bright-star contamination of faint neighbours is modelled everywhere on the array. Beyond ~1000 px it exceeds the diffraction wing by an order of magnitude. scatter_fraction overrides the instrument-wide scattered fraction (default: FRED’s
F_FOCAL, 7.13e-3; see wcc_sim.scatter). The halo is drawn by the wing machinery, so wings=False turns it off as well; params[“scatter”] reports what actually ran.In focus, each star’s Airy core is built at the effective wavelength of its spectral template through the band – what wcc_etc does for the same star – rather than at the filter pivot, which is ~130 nm too blue for an M dwarf in the broad band (23% too high a peak pixel). The per-star value is recorded in the CAT column psf_wavelength_nm. wavelength_nm overrides this for every star (PSF geometry only – the synthetic photometry still uses the full bandpass, so electron rates are unchanged); use it to put the core at the 450 nm of the FRED stray-light run. Ignored for focus != 0, which uses fixed Huygens images. The field-level PSF (wing fit, extended-source kernels, PSF report) stays at the pivot or override wavelength, recorded in PSFWAVE.
report=path writes a PDF+PNG showing the PSF’s radial profile split into its Airy and scattered-light terms (see wcc_sim.psfreport).
extended_sources (list of wcc_sim.extended.SersicComponent) adds smooth analytic components, rendered at native resolution and FFT-convolved with the PSF before the noise model. chromatic=True replaces the central-wavelength PSF with spectrum-weighted effective PSFs — per spectral type for point sources and per (template, ebv) for extended components; it is a documented no-op for focus != 0 (the defocus PSF has no wavelength model).
gain_mode picks the readout gain for detectors that have several. The qCMOS defaults to its 32x photon-number-resolving mode, whose 12-bit ADC clips at 552 e- per frame, 15x below the 7500 e- well; gain_mode=”low” (1x) lets the well clip first. The ceiling that applied is recorded as params[“saturation_e”] (header SATLEVEL) and the mode as GAINMODE.