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

Use gating windows in sngl_minifollowup and allow 'triggers within vetoes' option #4549

Conversation

GarethCabournDavies
Copy link
Contributor

When we have lots of things in the autogating vetoes, these can dominate the singles minifollowups.

This allows us to provide the gating vetoes to this job as elsewhere in order to remove them.

However they are still informative (e.g. we may have an autogated loud signal!). So we also have a minifollowup with --vetoed-time-only option.

The main changes here are:

  • Add the gating vetoes options and implement
  • Allow a --vetoed-time-only option
  • Allow passing of both veto file and foreground-censor file, this is as we do not want foreground-censored things to show up in a 'vetoed time only' section
    • Update the offline workflow to use this specification as appropriate

@GarethCabournDavies GarethCabournDavies added the v23_release_branch PRs applied to the v2.3.X release branch or to be cherry-picked if merging to master label Nov 1, 2023
@GarethCabournDavies
Copy link
Contributor Author

(I've added the v23 release branch label, but this is not vital, more a helpful addition)

@GarethCabournDavies
Copy link
Contributor Author

An example (behind LVK paywall) with the O4a chunk 2 test is here

Copy link
Contributor

@maxtrevor maxtrevor 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 to me, approving

@tdent
Copy link
Contributor

tdent commented Nov 2, 2023

It looks like it works, but I am not quite convinced that this will be what we want to do, ie will it allow us to catch a moderately loud signal whose merger happens to lie in a gating veto.
The 'loudest vetoed' sections in the example (in both ifos) list things which even at event number 10 are still pretty loud, and they all have really high masses. If there was (say) a moderately loud low mass signal with a merger 1-2s after a gating window, it might not make it to this list.

@tdent
Copy link
Contributor

tdent commented Nov 2, 2023

Maybe what would mitigate this would be to apply some more intelligent statistic ranking (ie loudest by what statistic - IMO it should ideally be the one used for detecting singles) to the 'loudest vetoed' section ..

Anyway I will ask for the release branch tag to be removed until we have thought about this a bit more.

@GarethCabournDavies GarethCabournDavies removed the v23_release_branch PRs applied to the v2.3.X release branch or to be cherry-picked if merging to master label Nov 2, 2023
@GarethCabournDavies
Copy link
Contributor Author

That's a fair point, and I think having the ranking-statistic option with quadsum as default (i.e. pass sngl-ranking straight through), and calculating the single-detector statistic should work for that. I've removed the release branch tag and will remove the request on the cherry-pick PR as well

@tdent
Copy link
Contributor

tdent commented Nov 2, 2023

OK, so your example used newsnr_sgveto_psdvar_threshold ranking .. maybe activating the actual sngls detection statistic needs a bit more code plumbing then.

@tdent
Copy link
Contributor

tdent commented Nov 3, 2023

FWIW, I don't think there is a reason to not merge this now, unless you want to mark it as draft and add more actual code changes later.

@GarethCabournDavies
Copy link
Contributor Author

I am already very close to getting the ranking-statistic changes in, so it may be worth waiting, though I will mark as draft for now

@GarethCabournDavies GarethCabournDavies marked this pull request as draft November 3, 2023 13:24
@GarethCabournDavies
Copy link
Contributor Author

So I was completely done when I said 'very close' before. But it turned out there was a bug when calling rank_stat_single with the quadsum statistic, this took me longer than I care to admit to find, so the tests were all failing. Workflow running now, and I will link it and mark as ready when it is done

@GarethCabournDavies
Copy link
Contributor Author

A couple of minor associated fixes, and we have results again:

https://ldas-jobs.ligo.caltech.edu/~gareth.cabourndavies/testoutput/veto_sngl_minifollowup/a2_TEST_2/

@GarethCabournDavies GarethCabournDavies marked this pull request as ready for review November 9, 2023 12:59
@GarethCabournDavies
Copy link
Contributor Author

GarethCabournDavies commented Nov 9, 2023

See GarethCabournDavies/pycbc@c53e31d...sngls_minifollow_gating_veto for changes since the last review

@GarethCabournDavies
Copy link
Contributor Author

I think this is ready now - I'll be away next week, so please merge if we are happy with it, and apply the release branch tag if we are going to use it in O4 production runs

@GarethCabournDavies GarethCabournDavies added the v23_release_branch PRs applied to the v2.3.X release branch or to be cherry-picked if merging to master label Nov 16, 2023
@GarethCabournDavies
Copy link
Contributor Author

Any comments since last review? If not I will merge

@GarethCabournDavies
Copy link
Contributor Author

No comments against this, so I will merge

@GarethCabournDavies GarethCabournDavies merged commit a203541 into gwastro:master Nov 23, 2023
31 checks passed
@GarethCabournDavies GarethCabournDavies deleted the sngls_minifollow_gating_veto branch November 23, 2023 13:33
maxtrevor pushed a commit to maxtrevor/pycbc that referenced this pull request Dec 11, 2023
…toes' option (gwastro#4549)

* Use gating windows in sngl_minifollowup - also allow 'triggers within vetoes' option

* Minor fixes

* add infor if fewer triggers than requested

* Allow pycbc_sngls_minifollowup to use single ranking statistic

* Fix bug in rank_stat_single for quadsum/phasetd statistics

* mask may be boolean now

* fix broken pycbc_page_snglinfo due to bugfix

* page_snglinfo to use the ranking statistic used

* missed change
bhooshan-gadre pushed a commit to bhooshan-gadre/pycbc that referenced this pull request Dec 19, 2023
…toes' option (gwastro#4549)

* Use gating windows in sngl_minifollowup - also allow 'triggers within vetoes' option

* Minor fixes

* add infor if fewer triggers than requested

* Allow pycbc_sngls_minifollowup to use single ranking statistic

* Fix bug in rank_stat_single for quadsum/phasetd statistics

* mask may be boolean now

* fix broken pycbc_page_snglinfo due to bugfix

* page_snglinfo to use the ranking statistic used

* missed change
@tdent
Copy link
Contributor

tdent commented Jan 8, 2024

So did we agree that this is now not a risk for missing loudish signals with merger inside a gating veto window?

@GarethCabournDavies
Copy link
Contributor Author

These would show up in the 'within vetoes' followup page, so long as that is specified in the config files

spxiwh pushed a commit to spxiwh/pycbc that referenced this pull request Jan 8, 2024
…toes' option (gwastro#4549)

* Use gating windows in sngl_minifollowup - also allow 'triggers within vetoes' option

* Minor fixes

* add infor if fewer triggers than requested

* Allow pycbc_sngls_minifollowup to use single ranking statistic

* Fix bug in rank_stat_single for quadsum/phasetd statistics

* mask may be boolean now

* fix broken pycbc_page_snglinfo due to bugfix

* page_snglinfo to use the ranking statistic used

* missed change
@tdent
Copy link
Contributor

tdent commented Jan 8, 2024

OK, is a MR required for that?

@GarethCabournDavies
Copy link
Contributor Author

Added one for the CI here: #4597

There is also one for O4 production runs in the repo for that

@tdent
Copy link
Contributor

tdent commented Jan 8, 2024

Ah, I see one there (currently in draft state I think)

spxiwh added a commit that referenced this pull request Jan 9, 2024
* Use gating windows in sngl_minifollowup and allow 'triggers within vetoes' option (#4549)

* Use gating windows in sngl_minifollowup - also allow 'triggers within vetoes' option

* Minor fixes

* add infor if fewer triggers than requested

* Allow pycbc_sngls_minifollowup to use single ranking statistic

* Fix bug in rank_stat_single for quadsum/phasetd statistics

* mask may be boolean now

* fix broken pycbc_page_snglinfo due to bugfix

* page_snglinfo to use the ranking statistic used

* missed change

* Fix cases where ifar limit was not being applied (#4574)

* Fix cases where ifar limit was not being applied

* some more missed cases / long lines

* redoing a couple more long lines

* missed one more place

* unrelated bug where the IFOs were not in the right order for use with the significance_dict

* remove removal of downranked triggers (#4579)

* remove removal of downranked triggers

* add brief explanation into the caption

* bug in choosing the far calculation method (#4593)

* bug in which IFO combo is used for calculating the FAR in each combination during HR

* Safety catch

* Update release number

* add coordinates_space.py (#4289)

* add coordinates_space.py

* add LISA/SSB frame params

* add LISA_to_GEO and GEO_to_LISA

* add coordinates_space into FieldArray

* add doc and Astropy support

* update comments on sympy

* use fsolve from scipy instead

* fix cc issues

* fix cc issues

* minor fix

* update

* not use iteration

* decouple LISA orbit and more accurate Earth

* rename

* remove jplephem

* add the angular displacement of the Earth

* use radians

* make func readable in .ini

* reverse back to master

* correct psi range

* reverse to master

* fix unit issue in earth_position_SSB

* put LISA to the "right" position

* add LISA specific transform classes here

* change names

* update

* make a package for coordinates

* remove coordinates_space import

* move __all__ into __init__.py

* remove all coordinates_space

* change TIME_OFFSET to seconds

* fix SOBHB issue

* rename

* add SSB or LISA params into fid_params

* rename

* fix cc issues

* fix cc issue

* fix cc issue

* update

* update

* fix

* add default names

* overwrite params with same names

* remove pre-fixed names

* remove all pre-fixed names

* not pop

* fix inverse transform

* update tc

* not overwrite

* add SNR support for multi-model

* Update waveform.py

* t0 issue

* t0 issue

* Update space.py

* add obstime

* np.mod(psi_newframe, 2*np.pi)

* fix obstime

* add support for array inputs

* Update hierarchical.py

* just use Alex's implementation

* CustomTransformMultiOutputs is in another PR, so remove it

* add LDC and LAL convention correction

* use pycbc standard names

* more meaningful name

* use pycbc standard names

* Update relbin.py

* Update parameters.py

* remove unnecessary changes

* fix cc issue

* fix cc issue

* fix cc issue

* fix cc issue

* compactify

* compactify

* add __all__ back

* Update transforms.py

* Update transforms.py

* Update test_transforms.py

* Update transforms.py

* update doc

* fix time warning

* Update space.py

* Update test_transforms.py

* Create test_coordinates_space.py

* fix cc issues

* fix cc issues

* fix cc issue

* Update tox.ini

* Update tox.ini

* Update tox.ini

* Update tox.ini

* Update tox.ini

* Update tox.ini

* Update tox.ini

* Update test_coordinates_space.py

* add inline doc

* Update tox.ini

* add check of bbhx

* Update test_coordinates_space.py

* Update tox.ini

* Update test_coordinates_space.py

* add MultibandRelativeTimeDom into hierarchical.py

* Update __init__.py

* Update hierarchical.py

* Update hierarchical.py

* Update relbin.py

* Update hierarchical.py

* Update hierarchical.py

* Update relbin.py

* Update hierarchical.py

* Update hierarchical.py

* Update hierarchical.py

* Update hierarchical.py

* Update hierarchical.py

* Update relbin.py

* Update hierarchical.py

* Update hierarchical.py

* Update relbin.py

* Update __init__.py

* Update space.py

* Update space.py

* Update space.py

* fix psi issue

* Update test_coordinates_space.py

* Update test_coordinates_space.py

* update lalsimulation cvmfs path (#4580)

* update lalsimulation cvmfs path

* missed that the mount location needs to be changed as well

* more references to previsou CVMFS location

* Revert "add coordinates_space.py (#4289)"

This reverts commit e3418c7.

* REmoving lisa examples

* REmove inference examples

* Remove LISA deps

* Removing more LISA things

---------

Co-authored-by: Gareth S Cabourn Davies <[email protected]>
Co-authored-by: Shichao Wu <[email protected]>
@tdent
Copy link
Contributor

tdent commented Jan 9, 2024

Ultimately we should replace gating veto with re-ranking around a gated time, ie gating DQ segment .. that is under development

@spxiwh spxiwh removed the v23_release_branch PRs applied to the v2.3.X release branch or to be cherry-picked if merging to master label Jan 16, 2024
bhooshan-gadre pushed a commit to bhooshan-gadre/pycbc that referenced this pull request Mar 4, 2024
…toes' option (gwastro#4549)

* Use gating windows in sngl_minifollowup - also allow 'triggers within vetoes' option

* Minor fixes

* add infor if fewer triggers than requested

* Allow pycbc_sngls_minifollowup to use single ranking statistic

* Fix bug in rank_stat_single for quadsum/phasetd statistics

* mask may be boolean now

* fix broken pycbc_page_snglinfo due to bugfix

* page_snglinfo to use the ranking statistic used

* missed change
lpathak97 pushed a commit to lpathak97/pycbc that referenced this pull request Mar 13, 2024
…toes' option (gwastro#4549)

* Use gating windows in sngl_minifollowup - also allow 'triggers within vetoes' option

* Minor fixes

* add infor if fewer triggers than requested

* Allow pycbc_sngls_minifollowup to use single ranking statistic

* Fix bug in rank_stat_single for quadsum/phasetd statistics

* mask may be boolean now

* fix broken pycbc_page_snglinfo due to bugfix

* page_snglinfo to use the ranking statistic used

* missed change
acorreia61201 pushed a commit to acorreia61201/pycbc that referenced this pull request Apr 4, 2024
…toes' option (gwastro#4549)

* Use gating windows in sngl_minifollowup - also allow 'triggers within vetoes' option

* Minor fixes

* add infor if fewer triggers than requested

* Allow pycbc_sngls_minifollowup to use single ranking statistic

* Fix bug in rank_stat_single for quadsum/phasetd statistics

* mask may be boolean now

* fix broken pycbc_page_snglinfo due to bugfix

* page_snglinfo to use the ranking statistic used

* missed change
GarethCabournDavies added a commit to GarethCabournDavies/pycbc that referenced this pull request Jul 24, 2024
* Use gating windows in sngl_minifollowup and allow 'triggers within vetoes' option (gwastro#4549)

* Use gating windows in sngl_minifollowup - also allow 'triggers within vetoes' option

* Minor fixes

* add infor if fewer triggers than requested

* Allow pycbc_sngls_minifollowup to use single ranking statistic

* Fix bug in rank_stat_single for quadsum/phasetd statistics

* mask may be boolean now

* fix broken pycbc_page_snglinfo due to bugfix

* page_snglinfo to use the ranking statistic used

* missed change

* Fix cases where ifar limit was not being applied (gwastro#4574)

* Fix cases where ifar limit was not being applied

* some more missed cases / long lines

* redoing a couple more long lines

* missed one more place

* unrelated bug where the IFOs were not in the right order for use with the significance_dict

* remove removal of downranked triggers (gwastro#4579)

* remove removal of downranked triggers

* add brief explanation into the caption

* bug in choosing the far calculation method (gwastro#4593)

* bug in which IFO combo is used for calculating the FAR in each combination during HR

* Safety catch

* Update release number

* add coordinates_space.py (gwastro#4289)

* add coordinates_space.py

* add LISA/SSB frame params

* add LISA_to_GEO and GEO_to_LISA

* add coordinates_space into FieldArray

* add doc and Astropy support

* update comments on sympy

* use fsolve from scipy instead

* fix cc issues

* fix cc issues

* minor fix

* update

* not use iteration

* decouple LISA orbit and more accurate Earth

* rename

* remove jplephem

* add the angular displacement of the Earth

* use radians

* make func readable in .ini

* reverse back to master

* correct psi range

* reverse to master

* fix unit issue in earth_position_SSB

* put LISA to the "right" position

* add LISA specific transform classes here

* change names

* update

* make a package for coordinates

* remove coordinates_space import

* move __all__ into __init__.py

* remove all coordinates_space

* change TIME_OFFSET to seconds

* fix SOBHB issue

* rename

* add SSB or LISA params into fid_params

* rename

* fix cc issues

* fix cc issue

* fix cc issue

* update

* update

* fix

* add default names

* overwrite params with same names

* remove pre-fixed names

* remove all pre-fixed names

* not pop

* fix inverse transform

* update tc

* not overwrite

* add SNR support for multi-model

* Update waveform.py

* t0 issue

* t0 issue

* Update space.py

* add obstime

* np.mod(psi_newframe, 2*np.pi)

* fix obstime

* add support for array inputs

* Update hierarchical.py

* just use Alex's implementation

* CustomTransformMultiOutputs is in another PR, so remove it

* add LDC and LAL convention correction

* use pycbc standard names

* more meaningful name

* use pycbc standard names

* Update relbin.py

* Update parameters.py

* remove unnecessary changes

* fix cc issue

* fix cc issue

* fix cc issue

* fix cc issue

* compactify

* compactify

* add __all__ back

* Update transforms.py

* Update transforms.py

* Update test_transforms.py

* Update transforms.py

* update doc

* fix time warning

* Update space.py

* Update test_transforms.py

* Create test_coordinates_space.py

* fix cc issues

* fix cc issues

* fix cc issue

* Update tox.ini

* Update tox.ini

* Update tox.ini

* Update tox.ini

* Update tox.ini

* Update tox.ini

* Update tox.ini

* Update test_coordinates_space.py

* add inline doc

* Update tox.ini

* add check of bbhx

* Update test_coordinates_space.py

* Update tox.ini

* Update test_coordinates_space.py

* add MultibandRelativeTimeDom into hierarchical.py

* Update __init__.py

* Update hierarchical.py

* Update hierarchical.py

* Update relbin.py

* Update hierarchical.py

* Update hierarchical.py

* Update relbin.py

* Update hierarchical.py

* Update hierarchical.py

* Update hierarchical.py

* Update hierarchical.py

* Update hierarchical.py

* Update relbin.py

* Update hierarchical.py

* Update hierarchical.py

* Update relbin.py

* Update __init__.py

* Update space.py

* Update space.py

* Update space.py

* fix psi issue

* Update test_coordinates_space.py

* Update test_coordinates_space.py

* update lalsimulation cvmfs path (gwastro#4580)

* update lalsimulation cvmfs path

* missed that the mount location needs to be changed as well

* more references to previsou CVMFS location

* Revert "add coordinates_space.py (gwastro#4289)"

This reverts commit e3418c7.

* REmoving lisa examples

* REmove inference examples

* Remove LISA deps

* Removing more LISA things

---------

Co-authored-by: Gareth S Cabourn Davies <[email protected]>
Co-authored-by: Shichao Wu <[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.

4 participants