retrieve_alerts#

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

Read alert packets from the given I/O stream.

Parameters#

fpderivative of IOBase

I/O stream from which data will be read.

reader_schemadict 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#

schemalsst.alert.Schema

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

recordsiterable of dict

Alert records.

Raises#

RuntimeError

Raised if alert data could not be read.