WeightedBatchPreprocessing (WBPP)
WeightedBatchPreprocessing (WBPP) is the script that turns lights, darks, flats and bias frames into calibrated, registered and integrated master lights. It groups the data automatically by filter, exposure and binning.
Purpose
| Task | Result |
|---|---|
| calibrate and stack subs | one master light per filter, or one colour master for OSC |
| align several filters | all masters registered to the same reference image |
| create an astrometric solution | basis for Calibrates the colours of a broadband or OSC image by comparing thousands of stars with Gaia spectra – objective and reproducible, including background neutralisation. Open fundamentals →, Corrects gradients using a reference map of the sky (MARS) and can therefore distinguish real large-scale signal from gradients. For broadband data; requires SPFC. Open fundamentals → and annotation |
WhyWBPP rather than individual processes?
The script chains all steps with consistent settings. Errors from manual intermediate steps disappear, and the pipeline is reproducible.
Principle
| Stage | Effect |
|---|---|
| Calibration | bias, dark and flat remove offset, dark current, hot pixels, vignetting and dust |
| Cosmetic correction | removes remaining hot and cold pixels before registration smears them into trails |
| Debayering (OSC only) | reconstructs a colour image from the Bayer pattern |
| Weighting | favours subs with good seeing and transparency |
| Registration | aligns all images pixel-exactly to a reference image |
| Local normalization | evens out brightness and gradient differences between subs |
| Integration with rejection | averages the images, removes outliers such as satellites and aircraft |
Parameters
Organised by the tabs of WBPP 3.1.x; the position of individual options may differ between versions.
Bias / Darks / Flats / Lights tabs
Load files with +Bias, +Darks, +Flats, +Lights or +Directory.
| Tab | Check | Why |
|---|---|---|
| Bias | master bias or individual frames recognised | flats are calibrated with bias because they are too short for their own dark |
| Darks | exposure matching the lights, same temperature | only a matching dark removes dark current and hot pixels correctly |
| Flats | one group per filter; filter keyword correct | vignetting and dust differ per filter |
| Lights | grouping, exposure and filter plausible | wrong grouping leads to wrong calibration |
Calibration tab
Flat groups: bias (or dark flats) assigned.
Light groups:
| Section | Setting | Why |
|---|---|---|
| Calibration Settings | dark Auto; Optimize Master Dark off when exposure and temperature match | dark optimisation scales the dark and can create artefacts with CMOS sensors |
| Output Pedestal Settings | automatic | prevents negative values or clipping after dark subtraction |
| Cosmetic Correction | enabled (auto-detect hot/cold) | see Principle |
| CFA Settings | mono: off. OSC: see Chains calibration, cosmetic correction, weighting, registration, normalisation and integration into a reproducible pipeline – from individual subs to aligned master lights. Open fundamentals → |
Check: in the light table dark ✓ and flat ✓, flat with the matching filter.
Post-Calibration tab
| Section | Setting | Why |
|---|---|---|
| Subframe Weighting | PSF Signal Weight | weights by the signal-to-noise ratio of the stars |
| Image Registration | default; with several filters one common reference image | all masters must align pixel-exactly, otherwise colour fringes |
| Astrometric Solution | enabled | basis for SPCC, MGC and annotation |
| Local Normalization | enabled | improves rejection and weighting |
| Image Integration | rejection Generalized Extreme Studentized Deviate (from about 50 subs per filter) | robust outlier detection for large stacks |
| Drizzle | optional 2× only when undersampled (image scale above about 2″/px), then the same for all filters | drizzle changes the geometry; mixed scales cannot be combined |
| Autocrop | enabled | crops registration borders that disturb gradient correction and statistics |
Pipeline tab and right panel
- Pipeline: check that all required steps are active.
- Registration Reference Image: mode auto, or manually the best frame of the strongest filter – it defines the geometry of all masters.
- Global Options: Generate rejection maps enabled; Preserve white balance at default (off).
- Output Directory: project folder. Start with Run.
Typical applications
Monochrome camera with several filters
One flat and one light group per filter; CFA off; one common registration reference. Result: aligned masters per filter (e.g. L, R, G, B, Ha or Ha, OIII, SII).
Colour camera (OSC)
| Group | Setting |
|---|---|
| Flats | CFA images enabled → Apply to all flat frames |
| Lights | CFA images enabled, mosaic pattern Auto, debayer method VNG → Apply to all light frames |
| Drizzle (optional) | Bayer drizzle 1×; 2× only when undersampled |
- Why VNG: interpolates edge-adaptively and produces fewer colour artefacts at stars than bilinear or SuperPixel at full resolution.
- Why Bayer drizzle: reconstructs the colour channels directly from the subs instead of interpolating missing colour values – sharper stars, less colour noise; needs many dithered subs.
- The integrated image may look greenish at first. This is expected and is corrected by Calibrates the colours of a broadband or OSC image by comparing thousands of stars with Gaia spectra – objective and reproducible, including background neutralisation. Open fundamentals →. Older WBPP versions offered Separate CFA flat scaling factors for this; in 3.x it is no longer a separate checkbox.
- Check: light table dark ✓, flat ✓; flat table bias ✓, CFA images Yes. Result: one colour master.
Reading rejection maps
The rejection maps are stored in the large master light (without “autocrop”) as additional images (rejection_low, rejection_high, possibly slope); opening it shows several windows.
- Narrow lines in
rejection_high: satellites successfully removed. - Artefacts in the master without a counterpart in the rejection map were present in all subs (e.g. stray light from a star outside the field). Rejection cannot remove them → crop (DynamicCrop).
What a good result looks like
Typical errors
| Observation | Cause | Remedy |
|---|---|---|
| Dust donuts, vignetting in the master | flat missing or wrong filter | check flat assignment |
| Hot pixel trails | cosmetic correction off, dark not matching | enable cosmetic correction, matching dark |
| Colour fringes when combining | filters registered to different references | one common reference image |
| Green cast (OSC) | expected after debayering | colour calibration with SPCC |
| Streaks in the master, not in the rejection map | stray light in all subs | crop before gradient correction |
| Masters cannot be combined | drizzle applied to one filter only | same drizzle for all filters |
When to use it – and when not
| Good for | Better another tool |
|---|---|
| standard preprocessing of mono and OSC data | removing borders and stray light → DynamicCrop (afterwards) |
| a reproducible pipeline across several nights | gradients in the master → Models large-scale brightness and colour gradients (light pollution, moon, residual vignetting) and subtracts them – structures are kept out of the model by protection masks. Open fundamentals → (afterwards) |
HaLRGB workflow · MultiscaleGradientCorrection (MGC) · Narrowband workflow (HOO/SHO) · OSC workflow with a quad band-pass filter · SpectrophotometricColorCalibration (SPCC)