Skip to main content

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

Metadata

Release files for ampel-alerts 0.10.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ampel-alerts 0.10.3
File Size Uploaded Provenance Actions
ampel_alerts-0.10.3.tar.gz 33.9 kB Without provenance Details for ampel_alerts-0.10.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ampel-alerts 0.10.3
File Interpreter ABI Platform Actions
ampel_alerts-0.10.3-py3-none-any.whl Python 3 none any Details for ampel_alerts-0.10.3-py3-none-any.whl

Total release size: 83.7 kB

Release files / ampel_alerts-0.10.3.tar.gz

Download URL ampel_alerts-0.10.3.tar.gz
Size 33.9 kB
Tags Source
SHA-256 checksum
How to use checksums
1bff97713ec353e0e524032843e7f6624cd95180b9c61c05f31b1519ece73c54
BLAKE2b-256 checksum
How to use checksums
35a5783adf969f9b39f8e64c0beb29dc83bdc0c295306ed17af24aec3c3aef2d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.14.1 Linux/6.8.0-1041-azure

Release files / ampel_alerts-0.10.3-py3-none-any.whl

Download URL ampel_alerts-0.10.3-py3-none-any.whl
Size 49.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
17334fb9f2f4ecf8ae6c24e71494c61b300e82420a56af1f0b64a0ff6e324552
BLAKE2b-256 checksum
How to use checksums
a33f6efb1f5428c3844ee5aadbc2c83e7f88a9dc4ac01fe711401e07ce21442f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.14.1 Linux/6.8.0-1041-azure

Security for ampel-alerts 0.10.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.10.3 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page