Skip to content

Revamp public alert page for O4

I got an email forwarded to me from leo singer from someone who asked him why the page https://gracedb.ligo.org/superevents/public/O4/ wasn't working... which was a reminder to me that the Public Alerts page needs to be updated ahead of O4.

This is what I'm thinking: /superevents/public/O3/ (the current page) and /superevents/public/O4/ will both forward to a single page, /superevents/public/.

On that page, there's two tables that are identical in content to the current public table, except one is for O4 (at the top) and one is for O3 (underneath). The HTML for the table is already in place so it doesn't need to be duplicated, but the querysets being fed into the table need to be different.

So what needs to happen is:

  • urls.py should be updated to forward URLs to the new page at /superevents/public/
  • views.py should be modified so that the context dictionary has two keys: (O3:, O4:) with the table contents as their values. Basically that means the self.object_list (which is a queryset of public superevents) in get_context_data needs to be filtered again for each observation run. Fortunately there is already the RUN_MAP dictionary (here) that has gpstimes to filter t_0 on. So, one filter for O3, and then defining a new variable like O4_START and then filtering from O4_START to now. There may be a better way of doing that. Side question: if someone tries to load the page before O4, and in this scenario, O4_START > now... is that going to break the query? Maybe? Then just catch the error with an except: and then return an empty dict, easy peasy.
  • public_alerts.html should be modified to accept the new context dictionary and render two tables. The table format should be cleaned up too to make it more consistent with the rest of the site, but that's largely the discretion of the dev.

There may be a few other sundry items in there to clean up that I forgot about.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information