Skip to content

Photometric color calibration node (SPCC / PCC) #116

Description

@bscholer

Why

SCNR-green (color_balance node) kills the dominant green cast on OSC stacks, but it can't fix an underlying R-heavy / B-light pedestal — the result is a neutralized-green but yellow-tinted sky. The proper fix is photometric color calibration: pick stars, look up their physical colors, derive a 3-channel gain transform, apply.

Siril 1.4 ships two relevant commands:

  • pcc — older, uses NOMAD or APASS, decent for broadband OSC.
  • spcc — Siril 1.4 successor, uses Gaia DR3 spectra + camera spectral response curves. Markedly more accurate.

Either applies a 3x3 color transform to every pixel (so background sky also goes neutral as a side effect, not just stars).

Catalog problem

Siril's spcc wants Gaia DR3 photometry locally. Full DR3 is ~hundreds of GB on disk; we are not shipping that in a Docker image. Options worth weighing:

1. On-demand Vizier / Gaia archive query (recommended starting point)

  • Fetch only the stars in the FOV from https://vizier.cds.unistra.fr or https://gea.esac.esa.int/archive on each spcc call.
  • Typical Dwarf 3 FOV: ~3° square, ~10k stars from Gaia DR3 — ~5 MB per query.
  • Pros: zero install footprint, always fresh, works in the CPU Docker image.
  • Cons: needs internet, subject to CDS rate limits (~10 requests/sec is fine), one extra failure mode.
  • Cache responses keyed on (RA, Dec, radius) under /scratch/astrolab/cache/_catalog/ so reruns are free.

2. Lazy local subset

  • First spcc call fetches the chunk for that sky region (HEALPix tile, ~50 MB per tile at NSIDE=64) and writes it to a Gaia mini-catalog on disk.
  • Subsequent renders in the same patch of sky hit local. Grows organically up to maybe a few GB for a casual hobbyist.
  • Pros: offline after first use per target.
  • Cons: more state, needs an admin endpoint to clear it.

3. APASS DR10 fallback

  • ~700 MB, B-V photometry, no spectra. Plain pcc works against it.
  • Pros: small enough to ship in the GPU image, decent for OSC broadband.
  • Cons: less accurate than SPCC, won't satisfy the long-term "do it right" goal.

4. NOMAD via Siril

  • Siril 1.4 already knows how to fetch NOMAD on demand (small footprint).
  • Pros: zero work from us.
  • Cons: NOMAD is older and less accurate than Gaia/APASS.

Proposed shape

New color_calibrate node (or extend color_balance with a mode: scnr | spcc | pcc enum):

  • Input: image (IMAGE_FITS, plate-solved; should run after register).
  • Params:
    • mode: scnr (current behavior) | spcc | pcc
    • catalog: gaia_vizier | gaia_local | apass | nomad (only relevant for spcc/pcc modes)
    • narrowband_mode: bool, for emission-line workflows
  • Implementation: shell out to Siril pcc / spcc with the right args; expect plate-solved input.
  • Cache key: include catalog choice so flipping catalog rebuilds.

Recommendation for v1

Start with option 1 (Vizier on-demand) + APASS fallback (option 3). Vizier is the right "hosted Gaia" answer with no install pain. APASS as a no-internet fallback covers offline use. Add option 2 later if rate limits or latency bite.

Out of scope for this issue

  • Siril SPCC's spectral response curves for the Dwarf 3 sensor — Siril ships a few presets but a Dwarf-specific curve is its own follow-up.
  • Switching the template default; this node lands as opt-in until the catalog story is solid.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions