Suppose you have built a classifier for the Rubin data about astrophysical objects: the six-band lightcurve, and perhaps also the crossmatches and association with known objects. The annotation capability allows you to run the classifier in near real time as alerts come in, and if you wish share the results with others. First you make a Lasair “pre-filter” to winnow down the millions of alerts per night to something reasonable: it could use host galaxy association from Sherlock, or the Alerce stamp classifier (another annotator), or perhaps a watchlist of where TDE events are likely. You will make a program that can receive the identity of the alerts from the pre-filter, and fetch the full lightcurve from Lasair. The result of your classification will be encoded into some simple JSON and other attributes, then pushed back into Lasair.
It’s quite a sophisticated workflow, but not bad if done in these five stages:
-
The first thing is to get a Lasair account, and note down the corresponding API key. Next, write a short description of your annotator and sent it to the Lasair team; we will set it up and connect it to your account. You can have a private annotator so only you can see it, or a public annotator for everyone. Full instructions here. Note that your API key will needed in the program that posts to it.
-
Next, make the pre-filter and set it to active. Then wait a few days for alerts to flow into it. Make your receiving code with the Lasair client and your API key, and check that alerts are being received. You can change the
group_id
to get the results again from the start. There is a video aboutgroup_id
. -
For each alert received, use the client to fetch the lightcurve and other data, then run it through your classifier. Choose how to represent the results as
classdict
,classification
, andexplanations
, for example this toy annotation:
classdict = {'fruit': 'apple'. 'radius': 6}
classification = 'ripe'
explanation = 'another nice apple'
- Finally, change the annotation code to push the annotation back into Lasair, with code like this:
L.annotate(
topic_out,
objectId,
classification,
version='0.1',
explanation=explanation,
classdict=classdict,
url='')
Full instructions here.
- Then run your annotation code continuously or regularly, as you prefer, to fetch all the alerts since last time you ran it, analyse them, and annotate the associated objects. When you build a filter, you can filter on your classification results. If the annotator is public, anyone can use the results.