Open martinjohndyer opened 5 months ago
However, there are a few issues still to be solved before we could consider actually processing IGWN alerts, which I'll note here:
ivo://gwnet/LVC#S240723b-1-Preliminary
, ivo://gwnet/LVC#S240723b-2-Preliminary
, ivo://gwnet/LVC#S240723b-3-Update
etc. The key is the increasing notice number, which is not included in the new alerts. In other words we can't tell the difference between the first and second preliminary alert, there's no indicator of which is 1 and which is 2. We could check our own database archive and guess, or we could query GraceDB, but it's a pain. We need an IVORN for the database (#85 ), for the time being I fell back to the timestamp just like EP alerts with no ID (https://github.com/GOTO-OBS/gtecs-alert/issues/80#issuecomment-2245164878). This could work as long as we don't want to run both classic and new alerts in parallel, because then we'd have no way to compare and see if we'd recieved an alert before. Again, the solution would probably be to remove IVORNs from the database entirely and have other values used to compare alerts.GWNotice.from_gracedb()
method to allow it to get the newer notices too, I'm not entirel sure how the get_slack_channel()
function would work but I suppose it would be best to try to match to the same type as the new alert.
First, GCNs were published using the VOEvent schema. This was based on XML, and frankly it was a pain to work with (non-unique dictionary keys!!). We use the Python voevent-parse package (https://github.com/timstaley/voevent-parse), but they are still annoying and I'll be glad when they're gone.
NASA have been slowly working on a new schema for GCNs, based on JSON. This is their Unified Schema (https://gcn.nasa.gov/docs/notices/schema), and it is an improvement. They are getting rid of the IVORNs, which makes each notice a bit harder to refer to, but we can reconstruct them (we use the IVORNs as the unique key in the database for instance).
LIGO/Virgo/Kagra/IGWN already made a similar change for their Kafka alerts (https://emfollow.docs.ligo.org/userguide/content.html#kafka-notice-gcn-scimma), they have their own schema with examples here: https://emfollow.docs.ligo.org/userguide/content.html#kafka. Notably the alerts include the skymap data embedded in binary format, which will save having to download it separately.
These new JSON-based alerts shouldn't be confused for the JSON VOEvents that SCIMMA's Hop client produces (see #81). Those are just the old XML events converted into JSON. Here's an example:
XML VOEvent
And so on. It's old and bulky, with repeated tags and needless discriptions.
SCIMMA JSON VOEvents
Although it doesn't look like it saves much vertical space here, the move away from XML does make things a lot easier (e.g. by not needing closing tags). Sadly it still has to conform to the VOEvent schema, with the "Who", "What", "WhereWhen", "How", "Why" structure. Most annoyingly, VOEvents allow repeated non-unique parameter values. That's why here
Params
is a list of dictionaries, each with aname
value, instead of just a dictionary.New IGWN JSON alerts
That's the entire message, minus the massively truncated
skymap
field. Because they have full control over the schema, IGWN can really cut out a lot of the chaff.New GCN JSON alerts
This is the sample EP alert from https://gcn.nasa.gov/docs/schema/v4.0.0/gcn/notices/einstein_probe/wxt/alert.schema.json. Nice and to-the-point.
Now because these new events are not VOEvents, there will have to be some major changes within the
gtecs.alert
code. Honestly I'd been putting it off, since only really the GW events had moved over and they were still publishing the old-style events in parallel. However now EP is only producing the new events #80 the changes can't really be held off any longer...