Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow units for --ra and --dec, improve external trigger info table #4965

Merged
merged 2 commits into from
Dec 4, 2024

Conversation

titodalcanton
Copy link
Contributor

@titodalcanton titodalcanton commented Dec 3, 2024

This allows PyGRB users to do --ra 12deg or --ra 2rad, thus clearing confusion on the units and removing the need to convert from degrees to radians. It also improves the external trigger summary table in a couple ways.

Standard information about the request

This is a new feature and restyling of result presentation.

This change affects mainly PyGRB.

This is backwards compatible, but it will print a warning if --ra and --dec are used without units.

Motivation

While doing some test PyGRB runs, @Thomas-JACQUOT and I ran into some confusion about which angular units we are supposed to use. pycbc_multi_inspiral, pycbc_pygrb_grb_info_table and the workflow config now consistently take radians as input args. However, results are typically presented in degrees. More importantly, radians are seldom used in the astro community, so the user would have to manually convert degrees to radians as part of setting up PyGRB, which is annoying and risks introducing errors.

The table shown by pycbc_pygrb_grb_info_table is also using a non-standard format for the UTC time, and too many digits for the sky location parameters.

Contents

This introduces the ability to add a deg or rad prefix to the values passed via --ra and --dec, thus clearing any confusion on the units. It is still possible to give unit-less values, in which case the code will assume they are radians (consistent with the old behavior) and print a warning.

This change also cleans up the code of pycbc_pygrb_grb_info_table and changes its output so that 3 decimal digits are used for the sky location parameters, and the ISO date format is used for the UTC time.

Links to any issues or associated PRs

N/A

Testing performed

I manually ran pycbc_pygrb_grb_info_table for GRB190427A.

Before:

pycbc_pygrb_grb_info_table --trigger-time 1240374873 --ra 280.2194 --dec 40.30997 --sky-error 0.0404485333333 --ifos L1 V1 --output-file L1V1-PYGRB_GRB_INFO_TABLE_GRB190427A-1240372047-5648.html

image

After:

pycbc_pygrb_grb_info_table --trigger-time 1240374873 --ra 280.2194deg --dec 40.30997deg --sky-error 0.0404485333333deg --ifos L1 V1 --output-file ~/Desktop/L1V1-PYGRB_GRB_INFO_TABLE_GRB190427A-1240372047-5648.html

image

Reference from the old production run:
image

Additional notes

N/A

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

@titodalcanton titodalcanton added the PyGRB PyGRB development label Dec 3, 2024
bin/pycbc_multi_inspiral Outdated Show resolved Hide resolved
bin/pycbc_multi_inspiral Outdated Show resolved Hide resolved
bin/pygrb/pycbc_pygrb_grb_info_table Outdated Show resolved Hide resolved
bin/pygrb/pycbc_pygrb_grb_info_table Outdated Show resolved Hide resolved
bin/pygrb/pycbc_pygrb_grb_info_table Outdated Show resolved Hide resolved
@pannarale pannarale merged commit 3caa512 into gwastro:master Dec 4, 2024
29 checks passed
@titodalcanton titodalcanton deleted the pygrb-allow-units-in-radec branch December 4, 2024 15:17
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