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
orPhotoAlert
Purpose: having a common format that theAlertConsumer
and alert filters understand. APhotoAlert
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
orNone
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
Built Distribution
File details
Details for the file ampel_alerts-0.10.1.tar.gz
.
File metadata
- Download URL: ampel_alerts-0.10.1.tar.gz
- Upload date:
- Size: 33.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.12.3 Linux/6.5.0-1021-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 046d4761ace652164d0659cc7ec5df4623485966484e74a1d3863b0eb3818e05 |
|
MD5 | 1e10a528be231fcfb62e3e8ed349c2f1 |
|
BLAKE2b-256 | 38d1950edacff7e2168a7522a853263d786240c663f0fb3849f8fd4213495ee7 |
File details
Details for the file ampel_alerts-0.10.1-py3-none-any.whl
.
File metadata
- Download URL: ampel_alerts-0.10.1-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.12.3 Linux/6.5.0-1021-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e7d38812d7c233d17007c17d18253d9d4259a154f0d9e2b8f8d24b3debeb73a |
|
MD5 | 2f6a33b8c84b4b140b23c502ae4580bf |
|
BLAKE2b-256 | acb025ec7e9e2df097ef51d2494ad2cb9a23e045b152a14ed93cf8c9e063adff |