Skip to main content

Alert support for the Ampel system

Project description


Alert support for AMPEL



Enables the processing of alerts by AMPEL.

The central class of this repository, ampel.alert.AlertConsumer, is capable of loading, filtering and "ingesting" these alerts.

  • The loading part involves 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.
  • During ingestion, the content of alerts is saved into the AMPEL database, possibly together with other different documents which can be created according to pre-defined directives.

The AlertConsumer 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 AlertConsumer 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

Alerts filtering is performed per channel, by subclasses of ampel.abstract.AbsAlertFilter. An AlertConsumer 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.ChainedIngestionHandler, ampel.abstract.AbsDocIngester

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.ZiDataPointShaper

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.10.3.tar.gz (33.9 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.10.3-py3-none-any.whl (49.8 kB view details)

Uploaded Python 3

File details

Details for the file ampel_alerts-0.10.3.tar.gz.

File metadata

  • Download URL: ampel_alerts-0.10.3.tar.gz
  • Upload date:
  • Size: 33.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.14.1 Linux/6.8.0-1041-azure

File hashes

Hashes for ampel_alerts-0.10.3.tar.gz
Algorithm Hash digest
SHA256 1bff97713ec353e0e524032843e7f6624cd95180b9c61c05f31b1519ece73c54
MD5 9f18696a3230889f49ba1fef393d57c1
BLAKE2b-256 35a5783adf969f9b39f8e64c0beb29dc83bdc0c295306ed17af24aec3c3aef2d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ampel_alerts-0.10.3-py3-none-any.whl
  • Upload date:
  • Size: 49.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.14.1 Linux/6.8.0-1041-azure

File hashes

Hashes for ampel_alerts-0.10.3-py3-none-any.whl
Algorithm Hash digest
SHA256 17334fb9f2f4ecf8ae6c24e71494c61b300e82420a56af1f0b64a0ff6e324552
MD5 9b55bb988655c543191b99452a1c848e
BLAKE2b-256 a33f6efb1f5428c3844ee5aadbc2c83e7f88a9dc4ac01fe711401e07ce21442f

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