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

Save overlapping PSDs with inspiral and use precomputed psds for inspiral #4930

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

bhooshan-gadre
Copy link
Contributor

@bhooshan-gadre bhooshan-gadre commented Nov 7, 2024

TOP-LEVEL SUMMARY: Save overlapping PSDs with inspiral and use precomputed psds for inspiral

Standard information about the request

This is a new feature and efficiency update

This change may affect but not necessarily if the option is not given: the offline search, PyGRB

This change changes: scientific output

Motivation

  1. Use precomputed PSDs for inspiral.
  2. --psd-output option doesn't have all the PSDs used in inspiral and it is not in the format of calculate_psd output.

Contents

  1. Overlapping PSDs can be saved while running inspiral in calculate_psd format.
  2. Inspiral can also be run with a precomputed PSD file as an input.
  3. These PSD files can then later be merged. Thus, PSD computing workflow is not needed during offline search.
  4. The saved PSD can be used to filter injections.
  5. Another use case is null stream PSD for filtering strain from other IFOs of ET. This is what I am testing with MDC data.

PSD saving code should also be used in the calculate_psd executable. However, I need to understand how to handle MPI parts correctly.

Testing performed

  1. Test that the code works. It saves PSDs and inspiral can ingest precomputed PSD as expected.
  2. Verified that the first of the overlapping PSDs is the same as the one saved under data while using psd-output option.
  3. Still both outputs of inspiral (with and w/o precomputed PSDs) do not match exactly.
  • The author of this pull request confirms they will adhere to the code of conduct

bhooshan-gadre and others added 8 commits November 7, 2024 14:54
0. PSD files can either be merge PSD files or files saved as an output of inspiral jobs.
1. Added such option to psd options. If given, this takes precedence.
2. Added class to read those PSD files. This has inspiration from Tito's
   Time varying class.


class PrecomputedTimeVaryingPSD(object):
def __init__(self, opt, length, delta_f, sample_rate):
Copy link
Member

Choose a reason for hiding this comment

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

@bhooshan-gadre I think this is a nice way to do this, but I think it might also be useful to be able to invoke this class by hand. Would it not make sense to have a from_cli class method that uses a option/arg input and then a regular init method that could be invoked by hand ?

err_msg = "No PSDs found intersecting segment!"
raise ValueError(err_msg)
fd_segment.psd = best_psd
if opt.precomputed_psd_file:
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't it make sense to have the precomputed psd be gotten from the pycbc.psd.from_cli method instead? That way it can be invoked more broadly.

@@ -26,7 +26,7 @@ def newsnr(snr, reduced_x2, q=6., n=2.):
reduced chi-squared values. See http://arxiv.org/abs/1208.3491 for
definition. Previous implementation in glue/ligolw/lsctables.py
"""
nsnr = numpy.array(snr, ndmin=1, dtype=numpy.float64)
nsnr = numpy.array(numpy.abs(snr), ndmin=1, dtype=numpy.float64)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this change needed in the PR?

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