Command-line interface
Installing the package puts two executables on your path: wcc-sim
(entry point wcc_sim.cli.main()), which exposes the full
simulate_field() pipeline, and wcc-phot
(wcc_phot.cli.main()), which runs run_photometry() on a
series of the frames it writes. wcc-sim first:
wcc-sim --ra 291.0 --dec 44.5 --sensorfilter zwo:r --focus 1 \
--exptime 90 --seed 42 -o field_1wave.fits
On success it prints a one-line summary and exits 0:
Wrote field_1wave.fits: 9568x6380 px, 52840 sources, focus=1w, 3121 saturated px
Options
Option |
Default |
Meaning |
|---|---|---|
|
none |
Pointing RA [deg, ICRS]. |
|
none |
Pointing Dec [deg, ICRS]. |
|
none |
Output FITS path. |
|
|
|
|
sensorfilter’s |
Waves of defocus: |
|
|
Total exposure time [s]. |
|
|
Coadded frames (ETC semantics; saturation is per frame). |
|
|
Position angle [deg E of N]. |
|
telescope’s |
Jitter Gaussian sigma [mas]. |
|
|
Gaia G faint limit of injected sources. |
|
off |
Skip the noise realization (expectation image only). |
|
off |
Omit the noiseless |
|
none |
RNG seed for a reproducible noise realization. |
|
full array |
Subarray shape, for quick looks and tests. |
|
per focus |
PSF stamp size [detector px, odd]; see PSFs and defocus. |
|
off |
Skip the analytic PSF wing beyond the stamp. Also switches the scattered-light halo off, since the halo is drawn by the wing machinery. |
|
per star |
Wavelength of the in-focus Airy core [nm], for every star (PSF
geometry only; the bandpass still sets the flux). Default: each
star’s effective wavelength through the band. Ignored for
|
|
off |
Skip the measured scattered-light halo (see Scattered light). |
|
|
Instrument-wide scattered fraction; default is the ray trace’s
image-plane fraction (7.13e-3). Recorded as |
|
detector’s |
Readout gain for multi-mode detectors. qCMOS: |
|
none |
Also write the one-page PSF radial-profile report (PDF + PNG, Airy
core vs scattered-light halo; |
|
none |
Gaia query cache directory (offline reruns; see Gaia catalogs). |
Cookbook
Quick look: 1024×1024 subarray, cached Gaia query:
wcc-sim --ra 291.0 --dec 44.5 --shape 1024 1024 \
--cache-dir gaia_cache --seed 42 -o quicklook.fits
Focus sweep: the same field at all three focus levels:
for f in 0 1 2; do
wcc-sim --ra 291.0 --dec 44.5 --focus $f --exptime 90 --seed 42 \
--shape 1024 1024 --cache-dir gaia_cache -o field_focus$f.fits
done
Full-frame qCMOS image, broadband filter:
wcc-sim --ra 150.1 --dec 2.2 --sensorfilter qcmos:bb \
--exptime 60 --seed 7 -o qcmos_bb.fits
Noiseless truth image for photometric closure (no noise, keep CLEAN):
wcc-sim --ra 291.0 --dec 44.5 --no-noise --shape 2048 2048 \
--cache-dir gaia_cache -o truth.fits
Bright-star handling: split 900 s into 10 reads so per-frame exposure stays short, and extend the jitter:
wcc-sim --ra 291.0 --dec 44.5 --exptime 900 --n-reads 10 \
--jitter 50 --seed 42 -o deep_10reads.fits
Scattered light: the same field with the halo off, and with the PSF report written next to the image:
wcc-sim --ra 291.0 --dec 44.5 --no-scatter --seed 42 -o no_halo.fits
wcc-sim --ra 291.0 --dec 44.5 --seed 42 --report psf_report.pdf -o with_halo.fits
qCMOS in its low-gain (1x) mode, so the 7500 e- well rather than the 12-bit ADC sets the saturation ceiling:
wcc-sim --ra 150.1 --dec 2.2 --sensorfilter qcmos:bb --gain-mode low \
--exptime 60 --seed 7 -o qcmos_lowgain.fits
wcc-phot
wcc-phot measures a differential light curve of one target against the
best reference stars across a series of wcc-sim frames of the same field
(same sensorfilter and focus). The target is a Gaia source_id or an
(RA, Dec) pair; everything else has a default derived from the frames’
headers and the model PSF:
wcc-phot series*.fits --source-id 2130453233564838016 -o phot.fits
wcc-phot series*.fits --ra 291.0 --dec 44.5 --method psf \
--report phot_report.pdf -o phot.fits
It prints a one-line summary (frames, target, references, aperture, rel-flux
RMS against the median predicted error) and writes a FITS file with
STARS (the selection), PHOT (one row per star per frame) and LC
(one row per frame) extensions; see wcc_phot.pipeline.PhotometryResult.
Option |
Default |
Meaning |
|---|---|---|
|
none |
One or more |
|
none |
Gaia |
|
none |
Target coordinates; must match a catalog star within 2 arcsec. |
|
none |
Output FITS path ( |
|
|
|
|
|
Number of reference stars (fewer are used, with a warning, when the field cannot supply them). |
|
model EE radius |
Aperture radius [px]; default encloses |
|
|
Background annulus radii [px]. |
|
|
Centre-of-mass centroid box side [px, odd]. |
|
|
PSF fit region side [px, odd] ( |
|
|
Encircled-energy fraction that sets the default |
|
|
Reject a reference with a neighbour brighter than G + |
|
none |
Also write the light curve as ECSV. |
|
none |
One-page PDF + PNG diagnostic report (field with apertures, light
curve, centroid drift, noise metrics;
|
|
off |
Matplotlib window updated as each frame is measured
( |
Mixed sensorfilters or focus levels in one series are rejected up front. Frames are streamed one at a time, so a long series does not need to fit in memory. The tutorial wcc-phot: differential photometry of a WCC image series walks through the same pipeline from Python.
Example scripts
The repository’s scripts/ directory contains ready-to-run examples:
Script |
What it does |
|---|---|
|
Python end-to-end smoke run: a Kepler-field pointing at all three
focus levels, 1024×1024, FITS to |
|
Single fast subarray image with a cached Gaia query. |
|
The CLI focus sweep above, one FITS per focus level. |
|
The same pointing on both detectors (IMX455 r-band, qCMOS broadband) for a side-by-side comparison. |
|
Five dithered 4096x4096 frames of the Kepler-field pointing, then
|
|
End-to-end validation: injects the TRAPPIST-1b transit into the
Gaia magnitude of TRAPPIST-1, simulates 36 x 300 s defocused frames,
runs |
|
End-to-end validation: synthetic Cepheids and calibration stars on
the M101 disk (Sersic galaxy light plus the real Gaia foreground),
with a recovered period-luminosity relation. |
|
Regenerates the packaged azimuthal scattered-light profile from the FRED stray-light map (see Scattered light). |
|
Regenerates the synthetic BP-RP / B-V colour table of the Pickles templates (network: synphot’s Johnson curves and Vega). |