simulate_alert#

lsst.alert.packet.simulate_alert(schema, keepNull=None, arrayCount=None)#

Parse the schema and generate a compliant alert with random contents.

Parameters#

schemadict

Schema to which to conform. Should be fully resolved (i.e., not contain any references to special LSST types).

keepNull{list of str, None}

Schema keys for which to output null values.

arrayCount{dict, None}

Number of array items to randomly generate for each provided schema key.

Returns#

outputdict

Packet with random values corresponding to provided schema.

Notes#

keepNull and arrayCount expect schema keys without namespaces (e.g., 'diaSourceId', not 'lsst.alert.diaSource.diaSourceId'. This is sufficient because our schemas have unique keys but is not fully general.

Todo#

This should accept an instance of lsst.alert.Schema and do whatever resolution is necessary internally.