simulate_alert#
- lsst.alert.packet.simulate_alert(schema, keepNull=None, arrayCount=None)#
Parse the schema and generate a compliant alert with random contents.
Parameters#
- schema
dict Schema to which to conform. Should be fully resolved (i.e., not contain any references to special LSST types).
- keepNull{
listofstr,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#
- output
dict Packet with random values corresponding to provided schema.
Notes#
keepNullandarrayCountexpect 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.Schemaand do whatever resolution is necessary internally.- schema