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.AlertConsumer, 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 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

Filtering alerts 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.8.2a3.tar.gz (32.0 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.8.2a3-py3-none-any.whl (45.7 kB view details)

Uploaded Python 3

File details

Details for the file ampel-alerts-0.8.2a3.tar.gz.

File metadata

  • Download URL: ampel-alerts-0.8.2a3.tar.gz
  • Upload date:
  • Size: 32.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.9.9 Linux/5.11.0-1022-azure

File hashes

Hashes for ampel-alerts-0.8.2a3.tar.gz
Algorithm Hash digest
SHA256 ea0f8b35640d1a0310c1d62df808950607a3da5dc42e739dc5b6f666723c881c
MD5 ed71e8f3bde9e9318688fdb533d27045
BLAKE2b-256 d56e59704b45d917967a1ffcbf3d17a58ccd114874723da1bc94cd9c170b5e83

See more details on using hashes here.

File details

Details for the file ampel_alerts-0.8.2a3-py3-none-any.whl.

File metadata

  • Download URL: ampel_alerts-0.8.2a3-py3-none-any.whl
  • Upload date:
  • Size: 45.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.9.9 Linux/5.11.0-1022-azure

File hashes

Hashes for ampel_alerts-0.8.2a3-py3-none-any.whl
Algorithm Hash digest
SHA256 a551b18f64d4e6a346776a7384369875c2eecd5a11bb3116de058bc51daef09d
MD5 33aeac1706cea20b366ad825862b62fa
BLAKE2b-256 a19000157bdc81aa9c937e4a23f26eaa33f148af03c50043c1af1e57a10a6ef6

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