Skip to content

Handling empty table in PyGRB#5026

Merged
pannarale merged 6 commits intogwastro:masterfrom
pannarale:handle_empty_tables
Jan 30, 2025
Merged

Handling empty table in PyGRB#5026
pannarale merged 6 commits intogwastro:masterfrom
pannarale:handle_empty_tables

Conversation

@pannarale
Copy link
Copy Markdown
Contributor

@pannarale pannarale commented Jan 30, 2025

This PR enables the production of tables, within PyGRB, when the table needs to be empty.

Standard information about the request

This is a: new feature

This change affects: PyGRB

This change changes: result presentation

Motivation

The current version of pycbc_pygrb_page_tables (designed to handle missed/vetoed injections and loudest events) will not work when there is no injection/trigger to be displayed.

Contents

This PR fixes this issue. The script no longer assumes there are injections to be displayed; further, it checks whether there is an onsource trigger to be reported: if there is not, the h5 file will be empty, where as the html file will say "There are no events" in the first column and report "-" in the remaining columns, to leave a human readable message.

Testing performed

The functioning of this can be checked in sections 3.01, 3.03, and 6 of this webpage.

Additional notes

The code to handle the case in which the offsource yields no triggers is along the lines of the one implemented for the injections, but admittedly it is not tested in this run.

  • The author of this pull request confirms they will adhere to the code of conduct

@pannarale pannarale added the PyGRB PyGRB development label Jan 30, 2025
@pannarale pannarale self-assigned this Jan 30, 2025
Copy link
Copy Markdown
Contributor

@titodalcanton titodalcanton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but I have some suggestions that may make this code better.

Comment thread bin/pygrb/pycbc_pygrb_page_tables Outdated
Comment thread bin/pygrb/pycbc_pygrb_page_tables Outdated
Comment thread bin/pygrb/pycbc_pygrb_page_tables Outdated
Comment thread bin/pygrb/pycbc_pygrb_page_tables Outdated
Comment thread bin/pygrb/pycbc_pygrb_page_tables Outdated
pannarale and others added 4 commits January 30, 2025 06:06
Co-authored-by: Tito Dal Canton <tito@dalcanton.it>
Co-authored-by: Tito Dal Canton <tito@dalcanton.it>
@pannarale pannarale merged commit bf5ff50 into gwastro:master Jan 30, 2025
@pannarale pannarale deleted the handle_empty_tables branch January 30, 2025 17:47
khunsang pushed a commit to khunsang/pycbc that referenced this pull request May 23, 2025
* Empty tables fixes

* Fix table when there are no loud offsource triggers

* First review comment

* Update bin/pygrb/pycbc_pygrb_page_tables

Co-authored-by: Tito Dal Canton <tito@dalcanton.it>

* Second set of review comment

* Update bin/pygrb/pycbc_pygrb_page_tables

Co-authored-by: Tito Dal Canton <tito@dalcanton.it>

---------

Co-authored-by: Tito Dal Canton <tito@dalcanton.it>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PyGRB PyGRB development

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants