Alert information contained with the two (or three) visits per night

We (Lasair team) were having a discussion today about linking the information contained in each event alert within a single night. Here’s a typical scenario and question

Visit 1 (g-band) - a DIASource is detected and this is the first detecion in the history of the survey at this position. An alert is issused (with the contents Alert Production Database). No further information is released, a DIAObject is not (yet) created as there is no history to report.

Visit 2 (r-band) - the second of the visit pairs is taken, 30 mins or so later. A DIASource is detected at the same position as the r-band source.

Now, what happens with this DIASource ? Will it be associated with the first DIASource taken just 30mins earlier and will the Visit 2 DIASoure alert packet have a DIAObject record that includes the information from Visit 1 (as in Alert Production Database) ?
And will nDiaSources be set to 2 ?

We’d like to check if the prompt processing will already link the 2 (or more) detections of the same source within a night. Or if this is something the brokers need to do.
As Lasair works on filtering the alerts before they are written to our database, there’s a big advantage for us to filter out DIAObjects there are >=2 detections from >= 2 visits (rejecting singletons).

Apologies is this is documented and we’ve missed it, we couldn’t see it explicitly. Any info would be useful for all the brokers (and users)

Stephen and Lasair team

Hi @ssmartt, we create a DIAObject at the time of the first DIASource. The second DIASource will associate to that DIAObject and the second alert will contain the history (with nDiaSources set to 2 as you indicate).

We’re confident this works for standard WFD visit pairs, but it will break down for images taken in rapid succession (whether due to marginal field overlaps or repeated images taken in the DDFs). The output in that case is a bit less predictable as it depends on pipeline and APDB performance. We expect we are going to need an end-of-night process to tidy up duplicate DIAObjects and other association issues, but we have not yet developed it.

thanks @ebellm, this is perfect.

Understand about the back to back images, and the difficulty in linking when the exposures are separated by a time of order the alert production time. A clean up at the end of night would work work well from the broker and user side, we can then filter on the alerts with nDiaSources>=2, which would not trigger immediately for the back-to-backs but would catch them at end of night alert DIAObject creation. That would be extremely valuable.

Will there also be diaForcedSources associated with the close pair of diaSources? This would be a great way to catch fast risers.

@roy as part of precovery, but we can’t do retroactive forced photometry fast enough to get it in the alert packet on the first night.