HEALPix integration for FASTDB: pg_healpix submodule, npix_order29 column, LIGO‑skymap helpers & tests#46
Merged
trivialTZ merged 10 commits intoLSSTDESC:u/ch/lvkfrom Sep 1, 2025
Conversation
…ed on flux, not dflux)
Fix error where nJy error bars were wrong for nondetections
healpix_ang2ipix_nest
…into tz_copy_of_lvk
npix_order29 column, LIGO‑skymap helpers & testsnpix_order29 column, LIGO‑skymap helpers & tests
Collaborator
Author
|
@hernandezc1 – If this looks good to you, feel free to go ahead and merge into the branch. |
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduces HEALPix support so that FASTDB can pre‑index every
diaobjectand cross‑match efficiently against incoming LIGO/Bayestar multi‑order sky‑maps. Key pieces are:extern/pg_healpixas a git‑submodule and compiles it inside the Postgres imagedb/2025‑07‑19_npix_order29.sql•
ALTER TABLE diaobject ADD COLUMN npix_order29 BIGINT• Bulk‑populate via
healpix_ang2ipix_nest(8192, ra, dec)(order ≈ 13 compromise)• Create
idx_diaobject_npix29for fast look‑ups.db/2025‑07‑19_skymap_helpers.sqlwith:decode_uniq(uniq)→ (order, ipix) andis_within(npix, order, ipix)for set‑based joins.pg_healpix;run_postgres.shauto‑CREATE EXTENSION pg_healpixat first start.npix_order29attribute tosrc/db.py’sDiaObjectmodel.docs/developers.rst&docs/index.rstupdated with notes for pg_healpix.test_skymap_crossmatch.py+ Bayestar FITS sample to exercise cross‑matching end‑to‑end.• Upstream test fix for non‑det flux‑error plotting merged.
*
pg_healpixgives us a C‑level implementation ofhealpix_ang2ipix_nestthat scales to millions of rows.* Helper functions keep all logic in‑database—no Python.
Implementation notes
pg_healpixuses order 13 (NSIDE=8192), which give lower resolution and still nests cleanly into LVK maps. The shift math inis_withinremains the same.Test
Future work
npix_order29: since bulk updating tens of millions of rows may lock the table, I will build the scheme leaving the column initially empty and populating it later in batches usingUPDATE … WHERE npix_order29 IS NULL.is_within(npix, order, ipix)SQL function to support set-based cross-matching betweendiaobjectand decodedUNIQpixels.