Skip to content

dirodriguezm/realtime-alerts-vizualization

Repository files navigation

Real time visualization of ZTF alerts

How to run

go build -o ztf-viz *.go
./ztf-viz

Development

  1. Generate go structs from the avro schemas
go install github.com/hamba/avro/v2/cmd/avrogen@<version>
avrogen -pkg main -o schemas.go -fullschema -fullname -tags json:snake schemas/candidate.avsc schemas/prv_candidate.avsc schemas/fp_hist.avsc schemas/cutout.avsc schemas/alert.avsc

Running avrogen is only necessary when the avro schemas change.

  1. Generate go code from templ files
go install github.com/a-h/templ/cmd/templ@latest
templ generate

You need to run templ generate for every change in the templates.

  1. Run the server
go run *.go
  1. Open the browser at http://localhost:8080

Optional: Send alerts to the kafka broker

There is a separate command that can produce random alerts to the Kafka broker every 1 second. To run it, use the following command:

go run *.go -cmd producer

While the producer is running, you can run the server with go run *.go and watch alerts appear every second.

You can easily run a local Kafka broker using docker:

docker compose up

And then you can connect to it using the default address localhost:9092.

Configuration

For a complete list of configuration options, run ./ztf-viz -h.

  1. Kafka broker address The command line flag -kafka-brokers can be used to specify the address of the Kafka broker. The default value is localhost:9092.

About

Web app for visualizing ZTF alerts in real time

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published