astrodbtoolkit / astrodbtoolkit/astrodb-bot

Template's PhotometryFilters.json ships Paranal/VISTA bands with no matching Paranal row in Telescopes.json/Instruments.json

Open
#102 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1
Forks
4
Avg merge
2d 10h
Merged PRs (30d)
5

Description

**Where:** The astrodb-template-db template's shipped reference data: `data/reference/PhotometryFilters.json` (inherited as-is from the template, never edited by this project) already contains `Paranal/VISTA.Y`, `Paranal/VISTA.J`, `Paranal/VISTA.H`, `Paranal/VISTA.Ks` (and other pre-populated bands like `PAN-STARRS/PS1.y`, `UKIRT/WFCAM.*`, `UKIRT/UKIDSS.*`, `UKIRT/UFTI.*`), but `data/reference/Telescopes.json` has no `Paranal` row at all (only `VLT-UT1..4` for that facility) and `Instruments.json` has no matching `Paranal` instrument row either.

**What happened:** `astrodb-ingest-photometry`'s Step 4 pattern (skip `ingest_photometry_filter` if the band already exists in `PhotometryFilters`, since `ingest_photometry_filter` raises "already exists") means the Telescopes/Instruments setup that `ingest_photometry_filter` would normally do as a side effect never ran for these pre-shipped bands. `ingest_photometry(..., telescope="Paranal", ...)` then failed for every VHS/VIKING/VVV/VIRAC2 magnitude with `Telescope Paranal not found in Telescopes table.` — 299 rows skipped on the first dry run.

**Workaround:** Added an explicit `ingest_instrument(db, telescope=telescope, instrument=instrument, mode="Imaging", raise_error=False)` call for every band in `BAND_SETUP` *before* the "does the filter already exist" check, regardless of whether `PhotometryFilters` already has the band. `ingest_instrument` is idempotent, so this is cheap and safe to always run.

**Suggested change:** Either (a) fix the shipped `data/reference/Telescopes.json`/`Instruments.json` in the upstream `astrodb-template-db` template to include `Paranal`/`VISTA` (and audit for other pre-populated `PhotometryFilters` bands with the same gap), or (b) update `astrodb-ingest-photometry`'s Step 4 instructions to call `ingest_instrument` unconditionally for every band's `(telescope, instrument)` pair before the "band already exists, skip" check, rather than only relying on `ingest_photometry_filter`'s side effect (which is skipped precisely when the band already exists).

---
_Reported from a gotchas.md log filed by a skill user (2026-08-28)._

Contributor guide

No contributing guide indexed for this repository

Research direction

Compare data/reference/PhotometryFilters.json with data/reference/Telescopes.json and data/reference/Instruments.json, then read astrodb-ingest-photometry's Step 4 and the BAND_SETUP workaround described here. Determine whether the fix belongs in the upstream template data or the Step 4 instructions; done means Paranal/VISTA bands have matching setup and the reported photometry rows are no longer skipped.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.