retrieve_alerts

lsst.alert.packet.retrieve_alerts(fp, reader_schema=None)

Read alert packets from the given I/O stream.

Parameters:
fp : derivative of IOBase

I/O stream from which data will be read.

reader_schema : dict or list, optional

A schema describing the contents of the Avro packets. If not provided, the schema used when writing the alert stream will be used.

Returns:
schema : lsst.alert.Schema

The schema with which alerts were written (which may be different from the schema being used for deserialization).

records : iterable of dict

Alert records.

Raises:
RuntimeError

Raised if alert data could not be read.