gwastro / pycbc

Core package to analyze gravitational-wave data, find signals, and study their parameters. This package was used in the first direct detection of gravitational waves (GW150914), and is used in the ongoing analysis of LIGO/Virgo data.
http://pycbc.org
GNU General Public License v3.0
314 stars 351 forks source link

pycbc_inspiral does not work with --psd-file option #212

Closed micamu closed 9 years ago

micamu commented 9 years ago

First run: pycbc_inspiral with --psd-estimation option, and output the psd. Second run: use the generated psd in the previous run to refilter the data with the --psd-file option.

We expect the results from both runs to be very similar to each other. However, in the second case no triggers are produced.

The necessary tar ball (containing the test data set and the template bank, both pycbc_inspiral scripts with the command line options used, the output psd and the output triggers in both cases) can be found in atlas miram.cabero/PyCBC/SNRLoss/test/temp/testpsd.tar.gz

ahnitz commented 9 years ago

Thank you for the report, and the test case. This appears to be a duplicate of #206, and so we are aware of the problem and will work on a fix. Expect it in a few days unless someone else has time to write a patch.

In case you are interested the issue has to do with the fact that output PSDs are stored exactly as we use them and use zeros for values below the lower frequency cutoff. When reading in from a file, we use log interpolation which expects for these values to be valid (non-zero).

ahnitz commented 9 years ago

Miriam,

Please take a look at #225 and let me know if this fixes your problem.

micamu commented 9 years ago

Hi Alex,

indeed that fixes the problem, the triggers in the second run seem to agree with the triggers obtained on the first run. Thank you very much!

Cheers, Miriam

From: Alex Nitz notifications@github.com To: ligo-cbc/pycbc pycbc@noreply.github.com Cc: micamu miriam.cabero@aei.mpg.de Date: 27/08/2015 04:41 Subject: Re: [pycbc] pycbc_inspiral does not work with --psd-file option (#212)

Miriam, Please take a look at #225 and let me know if this fixes your problem. ? Reply to this email directly or view it on GitHub.

micamu commented 9 years ago

By the way, I noticed that when running pycbc_inspiral the following warning appears:

/home/miriam.cabero/pycbc-dev/local/lib/python2.7/site-packages/PyCBC-519076-py2.7.egg/pycbc/types/array.py:358: RuntimeWarning: divide by zero encountered in divide self._data /= other /home/miriam.cabero/pycbc-dev/local/lib/python2.7/site-packages/PyCBC-519076-py2.7.egg/pycbc/types/array.py:358: RuntimeWarning: invalid value encountered in divide self._data /= other

This appeared before together with a similar warning for read.py and interpolate.py,

/home/miriam.cabero/pycbc-dev/local/lib/python2.7/site-packages/PyCBC-519076-py2.7.egg/pycbc/psd/read.py:78: RuntimeWarning: divide by zero encountered in log slog = numpy.log(noise_data) /home/miriam.cabero/pycbc-dev/local/lib/python2.7/site-packages/scipy-0.16.0-py2.7-linux-x86_64.egg/scipy/interpolate/interpolate.py:468: RuntimeWarning: invalid value encountered in add y_new = slope*(x_new - x_lo)[:, None] + y_lo

but after changing read.py as you suggested, only the warning for array.py keeps appearing.

That makes me wonder if there might be also a problem with array.py, that might be also affecting the pycbc_inspiral results... Maybe something that would explain why am I having strange results with gatings (not necessarily, I haven't identified yet if that is due to the code or to the data)?

Cheers, Miriam

From: Alex Nitz notifications@github.com To: ligo-cbc/pycbc pycbc@noreply.github.com Cc: micamu miriam.cabero@aei.mpg.de Date: 27/08/2015 04:41 Subject: Re: [pycbc] pycbc_inspiral does not work with --psd-file option (#212)

Miriam, Please take a look at #225 and let me know if this fixes your problem. ? Reply to this email directly or view it on GitHub.

spxiwh commented 9 years ago

Hi Miriam,

The error in array.py is occurring because the inverse PSD is calculated at all frequencies, not just the ones where it is used (so 1/0. gives NANs in the inverse PSD at frequencies < f_low). However these values are not used in the matched-filter integral and do not affect results (you would get NANs in the output if that happened).

I'll let others argue whether this is the correct behaviour, I think it has advantages and disadvantages (foremost being the scary looking warning!)

Cheers Ian

ahnitz commented 9 years ago

Closing as I believe #225 supersedes this issue.

micamu commented 9 years ago

Hi Ian,

good to know, thanks for the explanation!

Cheers, Miriam

From: spxiwh notifications@github.com To: ligo-cbc/pycbc pycbc@noreply.github.com Cc: micamu miriam.cabero@aei.mpg.de Date: 27/08/2015 15:53 Subject: Re: [pycbc] pycbc_inspiral does not work with --psd-file option (#212)

Hi Miriam, The error in array.py is occurring because the inverse PSD is calculated at all frequencies, not just the ones where it is used (so 1/0. gives NANs in the inverse PSD at frequencies < f_low). However these values are not used in the matched-filter integral and do not affect results (you would get NANs in the output if that happened). I'll let others argue whether this is the correct behaviour, I think it has advantages and disadvantages (foremost being the scary looking warning!) Cheers Ian ? Reply to this email directly or view it on GitHub.