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

Add details of closest triggers to the injection minifollowup #4503

Conversation

GarethCabournDavies
Copy link
Contributor

The injection minifollowups currently show the closest event, this means that anything which had a trigger at the same time, but was discarded for some reason, is not obvious.

For example, this should help to diagnose why things are present in the SNR triggers plot, but not the reweighted SNR plot

@spxiwh
Copy link
Contributor

spxiwh commented Oct 2, 2023

Want to see an example of this ... Running it now.

trigger_times = {}
for trig in single_triggers:
ifo = trig.ifo
with h5py.File(trig.lfn, 'r') as trig_f:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this will hit the same issue as noted in #4510

I will implement something similar to the fix there in this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually this won't be as bad as we will be using the injection HDF_TRIGGER_MERGE files rather than FULL_DATA, but should still be fixed

Copy link
Contributor

Choose a reason for hiding this comment

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

It's less important here, as the injection TRIGGER_MERGE are an order of magnitude smaller than the full_data one ... but still, avoiding having all trigger times read into memory, when it's not needed, could be useful. It would likely slow the code down a bit though, hopefully only a small amount.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added a method to find the triggers in a +/- 2s window around the missed injections, and not to display triggers outwith the window.

It might be good to cut this default to 1s maybe

@spxiwh
Copy link
Contributor

spxiwh commented Oct 2, 2023

I updated the suggestion to just f'"{title}"' .... I don't think the str case is now needed.

# But only ones which are within a small window of the missed injection
missed_inj_times = numpy.sort(f['injections/tc'][:][missed])

# Note: Adding 2 * Earth diameter in light seconds to the window here
Copy link
Contributor

Choose a reason for hiding this comment

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

Should it be 2 diameters or just 1, given that you have a left and right edge?
In fact, if the injection stated end time is at geocentre, should it not rather be Earth radius?

I guess if we're not totally clear about the geocentre then 1* diameter on each side is 'safe'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's the point, this bit is more about cutting out things which aren't nearby - two earth diameters is probably bigger than really necessary, but is basically to help ensure that the number of triggers is manageable

Copy link
Contributor

Choose a reason for hiding this comment

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

Are you saying that more than 1 diameter on either side is ever needed?
If not we should change to that

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have updated to 1 diameter

Trigger times to be checked against the missed injection times

snr: numpy array
(Unused, but to prevent a TypeError) SNR of the triggers
Copy link
Contributor

Choose a reason for hiding this comment

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

This is cryptic (very unclear why a TypeError might arise). I am guessing that the way the .select method is set up requires this. If so, rephrase eg 'Required by design of the HFile.select method but not used'

Copy link
Contributor

@tdent tdent left a comment

Choose a reason for hiding this comment

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

Approve if it works, modulo small tweak to docstring

@spxiwh
Copy link
Contributor

spxiwh commented Oct 9, 2023

LGTM thanks!

@GarethCabournDavies GarethCabournDavies force-pushed the inj_followup_closest_triggers branch from c38702c to f9b8b44 Compare October 9, 2023 15:52
@GarethCabournDavies GarethCabournDavies enabled auto-merge (squash) October 9, 2023 15:57
@GarethCabournDavies GarethCabournDavies merged commit fa89889 into gwastro:master Oct 9, 2023
30 of 31 checks passed
GarethCabournDavies added a commit to GarethCabournDavies/pycbc that referenced this pull request Oct 11, 2023
…o#4503)

* Add details of closest triggers (not just event) to the injection minifollowup

* Dont know how this was deleted

* Wrap titles with quotes

Co-authored-by: Ian Harry <[email protected]>

* Use existing functions to reduce the number of trigger times being stored

* Let the max window be set as a command line argument, deal with case where closest trigger is far away from the injection

* remove import I thought I would use but didnt

* Use the loudest SNR event in a tiny window instead of simply closest time

* missed re-setting the ifo in this loop

* Apply suggestions from code review

* TD comment

---------

Co-authored-by: Ian Harry <[email protected]>
@GarethCabournDavies GarethCabournDavies deleted the inj_followup_closest_triggers branch October 16, 2023 09:03
PRAVEEN-mnl pushed a commit to PRAVEEN-mnl/pycbc that referenced this pull request Nov 3, 2023
…o#4503)

* Add details of closest triggers (not just event) to the injection minifollowup

* Dont know how this was deleted

* Wrap titles with quotes

Co-authored-by: Ian Harry <[email protected]>

* Use existing functions to reduce the number of trigger times being stored

* Let the max window be set as a command line argument, deal with case where closest trigger is far away from the injection

* remove import I thought I would use but didnt

* Use the loudest SNR event in a tiny window instead of simply closest time

* missed re-setting the ifo in this loop

* Apply suggestions from code review

* TD comment

---------

Co-authored-by: Ian Harry <[email protected]>
bhooshan-gadre pushed a commit to bhooshan-gadre/pycbc that referenced this pull request Mar 4, 2024
…o#4503)

* Add details of closest triggers (not just event) to the injection minifollowup

* Dont know how this was deleted

* Wrap titles with quotes

Co-authored-by: Ian Harry <[email protected]>

* Use existing functions to reduce the number of trigger times being stored

* Let the max window be set as a command line argument, deal with case where closest trigger is far away from the injection

* remove import I thought I would use but didnt

* Use the loudest SNR event in a tiny window instead of simply closest time

* missed re-setting the ifo in this loop

* Apply suggestions from code review

* TD comment

---------

Co-authored-by: Ian Harry <[email protected]>
lpathak97 pushed a commit to lpathak97/pycbc that referenced this pull request Mar 13, 2024
…o#4503)

* Add details of closest triggers (not just event) to the injection minifollowup

* Dont know how this was deleted

* Wrap titles with quotes

Co-authored-by: Ian Harry <[email protected]>

* Use existing functions to reduce the number of trigger times being stored

* Let the max window be set as a command line argument, deal with case where closest trigger is far away from the injection

* remove import I thought I would use but didnt

* Use the loudest SNR event in a tiny window instead of simply closest time

* missed re-setting the ifo in this loop

* Apply suggestions from code review

* TD comment

---------

Co-authored-by: Ian Harry <[email protected]>
acorreia61201 pushed a commit to acorreia61201/pycbc that referenced this pull request Apr 4, 2024
…o#4503)

* Add details of closest triggers (not just event) to the injection minifollowup

* Dont know how this was deleted

* Wrap titles with quotes

Co-authored-by: Ian Harry <[email protected]>

* Use existing functions to reduce the number of trigger times being stored

* Let the max window be set as a command line argument, deal with case where closest trigger is far away from the injection

* remove import I thought I would use but didnt

* Use the loudest SNR event in a tiny window instead of simply closest time

* missed re-setting the ifo in this loop

* Apply suggestions from code review

* TD comment

---------

Co-authored-by: Ian Harry <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants