This package provides information about, and utilties for working with, LSST alerts in Apache Avro format. In particular, it includes:
- Alert schemas;
- Examples of alert contents;
- Utilities code for working with alerts.
Refer to DMTN-093 for more information on the LSST alert format.
Alert schemas are located in the
Schemas are filed according to their version number, following a
FORWARD_TRANSITIVE compatibility within a major version, per the Confluent compatibility model.
The latest version of the schema may always be found in
Example Alert Contents
Example alert contents are provided in the
sample_data directories included with the corresponding schema.
Although this package contains multiple versions of the alert schema, this library code is only written and tested using the latest version (
schema/latest) at present.
Future versions of this package should offer wider compatibility.
The name of the package is lsst-alert-packet:
$ pip install lsst-alert-packet
This package may be managed using EUPS. Assuming EUPS is available on your system, simply:
$ git clone https://github.com/lsst/alert_packet.git $ setup -r alert_packet
lsst.alert.packet Python package provides a suite of routines for working with alerts in the Avro format.
validateAvroRoundTrip.py demonstrates round-tripping a simple alert through the Avro system.
Sample data is provided in the
schema/latest/sample_data/alert.json file, or an alternative may be provided on the command line.
Optionally, the path to binary data files to be included in the packet as “postage stamp” images may be provided.
$ validateAvroRoundTrip.py --input-data=./schema/latest/sample_data/alert.json --cutout-template=./examples/stamp-678.fits --cutout-difference=./examples/stamp-679.fits
simulateAlerts.py writes simulated alert packets to disk in Avro format.
The resultant data is schema compliant, but the simulations are not intended to be realistic: packets are populated with pseudorandom numbers.
The number of visits per year (equivalent to the number of previous DIASources observed for each alert) and the number of alerts to simulate may be specified on the command line.
$ simulateAlerts.py --visits-per-year=100 --num-alerts=10 ./output_file.avro