Sign inSign up

vzgo666/vou_code

By vzgo666

Updated 9 months ago

Containerized VOU-Blazars: builds multi-wavelength SEDs, computes NEOWISE W-peak, redshift

Image
0

10K+

vzgo666/vou_code repository overview

VOU-Blazars Runner

This image runs the VOU-Blazars pipeline in two modes:

  • Web mode — requires UUID, writes results to Postgres (incl. redshift as a float).
  • Local mode — no UUID; skips DB and writes a JSON file (incl. redshift metadata).

Pipeline steps:

  1. Generate SED files
  2. Run additional data queries
  3. Resolve redshift via redshift/resolve_redshift.py (Python 3), pick a single best value
  4. Save to DB (web) or to JSON (local)

Build

docker build -t vzgo666/vou_code:latest .
# or: make localbuild

Run (Local Mode)

With Makefile

From the project root:

make run RA=83.633 DEC=22.0145
# example you used:
make run RA=338.1517 DEC=11.7308
  • No UUIDlocal mode
  • The container mounts your current dir to /output
  • A JSON file appears in your host dir named output_<RA>_<DEC>.json
Without Makefile
docker run --rm   -v "$(pwd)":/output   vzgo666/vou_code:latest   python2 app.py --ra 83.633 --dec 22.0145 --mode local

Run (Web Mode) — writes to DB

Requires a UUID that identifies the row in source_position_model:

docker run --rm   --network your_docker_network   vzgo666/vou_code:latest   python2 app.py --ra 83.633 --dec 22.0145 --uuid 00000000-0000-0000-0000-000000000000

The app uses DATABASE_URI in code:
postgresql://myuser:mypassword@postgres:5432/icra_docker
Ensure Postgres is reachable as postgres on the same Docker network, or change the URI.

On success, the app updates for that UUID:

  • source_position_model.w_peak (string)
  • source_position_model.redshift (float)

Output (Local Mode)

File name:

output_<RA>_<DEC>.json

Example content:

{
  "ra": "83.633",
  "dec": "22.0145",
  "w_peak": "…",
  "redshift": { "catalog": "DESI-DR1", "z": 0.1234 },
  "redshift_all": [
    { "catalog": "SDSS", "z": 0.123, "z_type": "spectroscopic" },
    { "catalog": "DESI-DR1", "z": 0.1234 }
  ],
  "count": 123,
  "data": [ /* SED rows */ ]
}

Notes:

  • DB stores a single float in source_position_model.redshift (no ±).
  • Local JSON includes redshift (best pick with catalog and z) and redshift_all for diagnostics.

Redshift Resolver

  • Location: redshift/resolve_redshift.py (spawned via system python3 by app.py).
  • Logic: queries multiple catalogs (SDSS, DESI-DR1, 6dF, 3HSP, 5BZCat, 4LAC-DR3, C3R2, EUCL-GAL, PHOT-Z, LAMOST, NED, SIMBAD), applies per-catalog angular thresholds, prefers spectroscopic > photometric, and selects a single best z.
  • Output to app.py: a one-line JSON_SUMMARY=... which app.py parses.

Frontend note: redshift is a single float now; display e.g. 0.123 — no ± parsing needed.


Project Layout (relevant)

/VOU_Blazars
  app.py                      # main runner (Python 2.7)
  utils.py
  additionaly_query/
    additional_data.py
  redshift/
    resolve_redshift.py       # Python 3
    catalogs.py
    helpers.py

app.py (Py2.7) spawns the resolver using python3 present in the image.


Troubleshooting

  • No redshift saved — check logs for “No redshift found by resolver.” or resolver errors.
  • Resolver spawn issues — ensure redshift/ exists in the image and python3 is available.
  • DB connection errors (web mode) — verify Docker network & hostname postgres, or update DATABASE_URI.

Tag summary

Content type

Image

Digest

sha256:abab2ff84

Size

659.5 MB

Last updated

9 months ago

docker pull vzgo666/vou_code