Skip to main content

Alert support for the Ampel system

Project description


Alert support for AMPEL



This add-on enables the processing of alerts by AMPEL. The central class of this repository, ampel.alert.AlertProcessor, is capable of loading, filtering, ingesting these alerts.

  • The loading part involves system (or instrument) specific classes.
  • The optional filtering part allows the selection of events based on pre-defined rules. High-throughput systems, such as ZTF or LSST in astronomy, rely on such filters.
  • The ingestion is the step where the content of alerts is saved into the AMPEL database, possibly along with different other documents which can be created according to pre-defined directives.

The AlertProcessor operates on the first three tiers of AMPEL: T0, T1 and T2.

Loading Alert

Performed by subclasses of ampel.abstract.AbsAlertSupplier.

Concrete implementation examples: ampel.ztf.alert.ZiAlertSupplier

Actions break-down:

  • Load bytes (tar, network, ...)
  • Deserialize (avro, bson, json, ...)
  • First shape (instrument specific): morph into AmpelAlert or PhotoAlert Purpose: having a common format that the AlertProcessor and alert filters understand. A PhotoAlert typically contains two distinct flat sequences, one for photopoints and one for upperlimits. The associated object ID, such as the ZTF name, is converted into nummerical ampel IDs. This is necessary for all alerts (rejected one as well) since "autocomplete" is based on true Ampel IDs.

Filtering Alert

Filtering alerts is performed per channel by subclasses of ampel.abstract.AbsAlertFilter. An AlertProcessor instance can handle multiple filters. Alert filters methods provided by user units are called by the class FilterBlock, that handles associated operations (what happens to rejected alerts ? what about auto-complete, etc...) FilterBlock instances are themselves embedded in FilterBlocksHandler

Filters can return:

  • False or None to reject an alert.
  • True to accept the alert and create all t1/t2 documents defined in the alert processor directive
  • An int number to accept the alert and create only the t1/t2 documents associated with this group id (as defined in the alert processor directive)

Ingesting Alert

If any channel accepts a given alert, DB updates need to occur. v0.7 brought many updates regarding how ingestion happens. Class: ampel.alert.IngestionHandler, ampel.abstract.ingest.AbsIngester

More details later

Directives

Nesting is chaining

Second shape: morph into DataPoint

Alerts that pass any T0 filter are further shaped in order to fullfill some requirements for DB storage and easy later retrieval. Among other things, individual datapoints can be tagged during this step. For ZTF, upper limits do not feature a unique ID, so we have to build our own. Each datapoint is shaped into a ampel.content.DataPoint structure.

Implementation example: ampel.ztf.ingest.ZiT0PhotoPointShaper

Compilers

Optimize the number of created documents

Ingesters

Create and upserts documents into the DB

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ampel-alerts-0.7.1.tar.gz (34.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ampel_alerts-0.7.1-py3-none-any.whl (47.8 kB view details)

Uploaded Python 3

File details

Details for the file ampel-alerts-0.7.1.tar.gz.

File metadata

  • Download URL: ampel-alerts-0.7.1.tar.gz
  • Upload date:
  • Size: 34.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.6 CPython/3.8.9 Linux/5.4.0-1046-azure

File hashes

Hashes for ampel-alerts-0.7.1.tar.gz
Algorithm Hash digest
SHA256 4f0d596b745e2dc1e41d9c1fe9148a37c9f4c9501c426dd8baf981173bfb208a
MD5 9ebffa3c33c5e128c84c3c595cdbeb59
BLAKE2b-256 8931b6440663beb1a7cbd2dce0ab77e53365e245b24d401974bdfac401b58b29

See more details on using hashes here.

File details

Details for the file ampel_alerts-0.7.1-py3-none-any.whl.

File metadata

  • Download URL: ampel_alerts-0.7.1-py3-none-any.whl
  • Upload date:
  • Size: 47.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.6 CPython/3.8.9 Linux/5.4.0-1046-azure

File hashes

Hashes for ampel_alerts-0.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8c98ff3719ee535e52db74d2e18480031b4640f288523886c56702ed33b5dc76
MD5 44aa8a33d540b7ee36912a3c5f613f99
BLAKE2b-256 0f0db61252f35d3c5bf16375d5a5d6049afb6ab37a1bc7deb926607cbccea8bd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page