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

Fix logic for determining frame type in pycbc_make_skymap #4937

Merged

Conversation

titodalcanton
Copy link
Contributor

Fixes a crash in pycbc_make_skymap triggered by using simulated strain and a detector that is not H1, L1 or V1.

Standard information about the request

This is a bug fix which affects only pycbc_make_skymap.

Motivation

A student reported that adding KAGRA to our example produces this error:

Traceback (most recent call last):
  File "/home/tito/virtualenvs/pycbc/bin/pycbc_make_skymap", line 574, in <module>
    main(opt.trig_time, opt.mass1, opt.mass2,
  File "/home/tito/virtualenvs/pycbc/bin/pycbc_make_skymap", line 111, in main
    frame_types[ifo] = default_frame_type(mean_trig_time, ifo)
  File "/home/tito/virtualenvs/pycbc/bin/pycbc_make_skymap", line 56, in default_frame_type
    raise ValueError('Detector {} not supported at time {}'.format(ifo, time))
ValueError: Detector K1 not supported at time 1272790260.0

Contents

The logic that determines the frame type to pass to pycbc_single_template was wrong in a trivial way. It was trying to guess the frame type based on the detector and trigger time even when the fake strain is being used, i.e. when no guessing is necessary. I reworked the logic to only guess the frame type when necessary.

Links to any issues or associated PRs

N/A

Testing performed

I ran the example before and after the fix, first with the default HLV network and then by adding KAGRA as well. Here are the results, just for fun:

image

image

Additional notes

Hopefully we will see KAGRA at 80 Mpc soon 🤞

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

Copy link
Contributor

@spxiwh spxiwh left a comment

Choose a reason for hiding this comment

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

Thanks!

@titodalcanton titodalcanton merged commit 717509d into gwastro:master Nov 14, 2024
29 checks passed
@titodalcanton titodalcanton deleted the fix-make-skymap-frame-type-logic branch November 14, 2024 12:27
prayush pushed a commit to prayush/pycbc that referenced this pull request Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants