Closed jacopok closed 2 years ago
@jacopok I think either approach would be useful. I think having a version which does the time optimization for you is perfectly sensible, and a documentation improvement when not the case would also be good. These are both things we'd love to accept contributions for.
Thanks! As soon as I can I will try and make a pull request for them, starting with the documentation update.
The feature was implemented as the optimized_match
function in PR https://github.com/gwastro/pycbc/pull/3939.
When computing mismatches between waveforms that are very similar, but shifted by a time not corresponding to an integer number of timesteps, the
pycbc.matchedfilter.match
function is unreliable.I have a MWE (well, as minimal as I could make it) for the issue, with some mock data. I create some waveforms with small random fluctuations so that their unfaithfulness is ~1e-8. If these are shifted by a sub-sample amount, by adding a linear term to the phase, the results of computing one minus their
match
fluctuate by up to two orders of magnitude.After showing the problem I give a "toy" implementation for a mismatch-computing function that does not suffer from this issue.
I do not know whether this is worth implementing in
pycbc
, but I propose to at least include a warning in the documentation to discourage people from trying to usematch
to recover mismatches smaller than, say, 1e-4.The "optimized" curve at the bottom is what I get when computing the same mismatches with an optimization procedure, written as follows: