Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ is a design question for `foundation.md`, not a test to relax.
| `stages/` | One module per stage. The foundation's stages are one function, `run(job: JobContext) -> None`, run by `rapidpipe job local`/`job run`/`job submit`: `import_products` (stage `import`), `intake` (one SOC L2 ASDF file, read anonymously from a public source root when the run says so, converted by `dev`'s `build_fits_file` into its gzipped FITS, the pixels of `[intake] dq_mask_bits` NaN as commissioning #238 sets them, with its `exposures` and `l2files` rows, the row's `mjdmid` and the header's `MJD-AVG` the exposure's mid-time, the file's own or the middle of its start and end; under `[pixel_area_map] lookup` the row's `pixel_area_map` and the header's `PAMREF` hold the CRDS name of the file's pixel area map, from the file, CRDS's best reference or the store's index, null when none answers), `packet` (`dev`'s alerts package at schema 00.09: Avro packets with three RICE-compressed cutouts, forced photometry and Gaia matches, the object catalog and window read as they stand and recorded, and the packet index; the triggers are the set's xsources, with the xobjects and xmemberships, under `[packet] alert_catalog = "xsources"`, or its sources, objects and memberships under `"sources"`, cut to `[packet] max_alerts` by |S/N|; every flux in nJy, calibrated at assembly by its own image's `l2files.zptmag` and pixel area map, with `zeroPoint` and `pixelAreaFactor` on each record, the tables' fluxes left instrumental) `reference` (`dev`'s awaicgen coadd of the named `l2files`, with its SExtractor catalog and, under `[reference.psfcat] enabled`, its Photutils PSF-fit catalog made with the reference PSF `[difference] reference_psf` chooses: `refimages`, `refimimages`, `refimcatalogs`, `dev`'s quality measurements in `refimmeta`, and a measured PSF's 18 `psfs` rows; a status 0 reference is published with its binding refused) `difference` (`dev`'s subtraction of the named `l2files` row against the named `refimages` row with the science PSF and the reference PSF it measures on the resampled reference: SFFT, always run and the only differencer published, with ZOGY (skipped by `[difference.zogy] run_zogy = false`; its catalogs are diagnostics) and naive beside it as `dev` runs them: `diffimages`, with `dev`'s quality measurements and the gate's numbers in `diffimmeta`, the `sources` set (SFFT's positive and negative PSF-fit catalogs, scored by the in-process ONNX RuBR-AT classifier, through `[difference.sources_database_prefilter]`, uncapped unless `[difference] max_sources` says otherwise) and `dev`'s uncapped `xsources` from SFFT's two SExtractor catalogs (through `[difference.xsources_database_prefilter]`, scored the same way); then the association, crossmatch and statistics in one, its sources matched in memory against its dataset's objects of every run in each source's field and its neighbours as it read them, each founding in its own field: `objects` founded here and `memberships`, reconciled at publish; the same over its xsources, `dev`'s crossMatchXSources: `xobjects` and `xmemberships`) and `psf` (new science: one filter and SCA's science `psfs` row, reduced from the CRDS ePSF reference the L2 file names, fetched by name). A stage's exit, through `job run`: 0 success, 64 usage, 65 bad/missing input, 70 unclassified error, 75 retryable transient failure. The older `main(argv)` contract's `admit` and `finalize` were retired 2026-10-25. The run model's database stages (`register`, `load`, `maintain`, `crossmatch`, `statistics`, `prune`, `alerts`, `export`) were retired with its schema; the foundation plan's Part 5 ports their science (into `difference` and `packet`; the `associate` stage that first held it retired 2026-10-24). |
| `science/` | Pure algorithms and tool wrappers the stages call (`difference`, `reference`, `intake`, `load`, `crossmatch`, `statistics`, `alerts`, plus `spatial` for HEALPix/tessellation, `crds` (CRDS's best reference of a type for a detector and exposure start, asked by JSON-RPC), and `catalogs`: the external catalogs' copies, `store` (built once per release by `python -m rapidpipe.science.catalogs.store`: NED's object directory mirrored and re-cut, NED-LVS and Gaia DR3 ingested, or the Gaia layout from one table, and `ingest-ss`, one day of the MPC orbits propagated with kete under the `ss` root) and their cone `readers`; a run's `catalogs` row names a copy's prefix; `alerts.kona` is `dev`'s KONA, the solar-system predictions the packet stage matches from the `ss` day at or before the trigger and the L2 header's ephemeris; `alerts.calibration` is the nJy arithmetic, a zero point's scale and a pixel area map's value at a position). No stage, `launch` or CLI imports. |
| `products/` | Product identifiers and kinds (`ids.py`), storage layout (`storage.py`), the difference image's bits and source flags (`diffimage`), `filters`, and `spatial` (the pure HEALPix and tessellation derivations; `science.spatial` re-exports them). |
| `db/` | `connection.py` (one connection from the `PG*` environment, a secret or a parameter tree) and `ids.py` (ULIDs). |
| `db/` | `connection.py` (one connection from the `PG*` environment, a secret or a parameter tree). |
| `foundation/` | The foundation plan's operations over `database/schema.sql`: `bookkeeping.py` (`create_dataset`, `list_datasets`, `create_run`, which refuses a dataset `datasets` does not hold, `create_job`, `run_show`, `job_show`), `official.py` (`change`, `undo`, `apply`, `Refused`), `publish.py` (`publish`, the manifest format, `PublishError`), `children.py` (the child tables of `sources` and `xsources`: their names, and a source set's child found from its difference image's L2 `mjdobs` and SCA, so readers query the children a task needs and never the parent; and the names of the field children of `objects`, `memberships`, `packets` and `forced`), `catalog.py` (reconcile at publish: a difference job's founded objects attached to those founded since its read, under the field's lock), `local.py` (`JobContext`, the foundation's stage contract, and `run_job`, one attempt run here and published), `prefix.py` (`get` and `put` for `file://` and `s3://` URLs), `layers.py` (`resolve`: a run's settings body from the base, the dataset overlay and the `--set`s, with the record of its layers), `publish_kafka.py` (`deliver`, the one send boundary, which a packet job calls for its own set as its last act, and `publish`, the sweep of a run's unstamped official sets: each message's value the wire header of its schema version and the packet's record, as `rapid_alert_packet` reads it, in gzipped batches; each set stamped `jobs.kafka_published_at` with its acknowledgements' partition and offsets), `stop.py` (`rapidpipe run stop` and `run cleanup`; `stop`: a run recorded as stopped, after which every path that records, submits or starts a job of it refuses, through `bookkeeping.admit`, and its Batch jobs asked to end; `cleanup`: a stopped, ended run's attempt directories that hold no published product listed, and removed only on `--delete`), `loop.py` (one pass of `rapidpipe loop`: the source root's new stems for a selection admitted and every ready job submitted one stage forward, no field chains or order, ending at the topic), `reprocess.py` (`rapidpipe reprocess`: one L2 file of a run's dataset processed again, intake, difference and packet in turn or the last two with `--skip-intake`, each job expecting the binding open on its key when it is recorded). The verbs in `cli/main.py` wrap them. |
| `launch/` | `__init__.py`: `submit` (a recorded job to AWS Batch as `job run --job <id>`). No retry and no attempt bookkeeping. |
| `cli/` | The `rapidpipe` command-line tool: `main.py` holds the foundation verbs (`run create`, `run show`, `run stop`, `run cleanup`, `job show`, `job local`, `job run`, `job submit`, `job wait`, `official change`, `official undo`, `publish`, `loop`, `reprocess`, `exposure id`, `dataset create`, `dataset list`); `vpo.py` holds `vpo run`, the resident planner, of which the held pass (`--hold`: reach the database, admit and submit nothing) is built; `rapidpipe <verb> --help` is the reference for each, and README.md's The command line lists them. |
Expand Down
4 changes: 2 additions & 2 deletions docs/foundation-smdc-step.md
Original file line number Diff line number Diff line change
Expand Up @@ -732,8 +732,8 @@ items no later part closed; each names where its numbers are.
132, 133 (PR 458) and 26, 66, 67 (PR 459); the reference's
MAGZP-missing check and import's PSFKIND mismatch still exit 70, not 65
(PR 459).
- **Code with no caller outside tests** remains: `db/ids.py` (`new_ulid`)
and `products/ids.py`, the latter not tested (PR 467).
- **Code with no caller outside tests** remains: `products/ids.py`, not
tested (PR 467); `db/ids.py` (`new_ulid`) was removed on 2026-12-05.
- **A one-epoch packet-equality acceptance depends on placement**:
nothing pins the instance type (PRs 469, 471).
- **The licence purge and statements** (licence-audit): the purge set, 28 paths and one rapid_systems edit, runs at the switch to `rebuild`; `awaicgen`, `py_zogy.py` and `modules/rubrat` need licence statements from their authors, and SExtractor's eight `cdf` configuration files a third-party notice (rapid_docs 178).
89 changes: 0 additions & 89 deletions rapidpipe/db/ids.py

This file was deleted.

2 changes: 1 addition & 1 deletion rapidpipe/science/alerts/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
- ``cutouts``: `dev`'s stamp extraction, on ``astropy.io.fits``.
- ``crossmatch``: KONA, reference-catalog, NED and Gaia matching.
- ``forced``: `dev`'s forced PSF photometry at fixed positions.
- ``assemble``: builders, alert assembly, the Avro container, BatchStats.
- ``assemble``: builders, alert assembly, the Avro container.
- ``schema/00/07/*.avsc``: `dev`'s schema files, verbatim, package data (00.06 kept beside).

``fastavro`` is imported at module scope here (the pipeline image's conda
Expand Down
Loading
Loading