bilby-dev / bilby

A unified framework for stochastic sampling packages and gravitational-wave inference in Python. Note that we are currently transitioning from git.ligo.org/lscsoft/bilby, please bear with us!
https://bilby-dev.github.io/bilby/
MIT License
59 stars 66 forks source link

Time-domain approximant with Bilby (proposal of example) #672

Open bilby-bot opened 2 years ago

bilby-bot commented 2 years ago

In GitLab by @git.ligo:ecm on Jan 17, 2022, 17:58

Dear Bilby developers,

together with Tom Colin (intern student), we have put together a Jupyter notebook based on Tuto 3.2 of the ODW 2021 [https://github.com/gw-odw/odw-2021/blob/master/Tutorials/Day_3/Tuto_3.2_Parameter_estimation_for_compact_object_mergers.ipynb] that does a simplified analysis of GW150914 using a time-domain approximant using the same model (SEOBNRv4). Our objective is to get consistent posterior distributions. Here is our notebook:

Notebook

We align the template in time so that it matches well that of the frequency domain approximant. The time alignment code is:

    max_index = np.argmax(h_plus**2 + h_cross**2)
    delta_index =  len(h_plus) - max_index
    h_plus = np.roll(h_plus, delta_index)
    h_cross = np.roll(h_cross, delta_index)

which leaves a small time shift with the time-domain waveform obtained from the frequency-domain generator (using the exact same model). See sanity check in the notebook.

Questions:

  1. We obtain consistent posterior for the intrinsic parameters (chirp mass and mass ratio) but we see large discrepancies for geocent_time. See this corner plot

We conclude that the time alignment procedure is wrong. We struggle to understand how to align. Could you please give us a hint?

  1. We believe this type of exercise could be useful to other users. We could come up with a standalone script that could be added to the example/ folder of the Bilby tree. Is this something you would value?

Notes:

For the time-domain approximants, we coded the two following functions (see cell [19]):

def lalsim_SimInspiralTD(...): def _base_lal_cbc_td_waveform(...): def lal_binary_black_hole_td(...):

which are the exact symmetric of the following frequency-domain functions already included Bilby:

def lalsim_SimInspiralFD(...): https://git.ligo.org/lscsoft/bilby/-/blob/master/bilby/gw/utils.py#L735

def _base_lal_cbc_fd_waveform(...): https://git.ligo.org/lscsoft/bilby/-/blob/master/bilby/gw/source.py#L247

def lal_binary_black_hole(...): https://git.ligo.org/lscsoft/bilby/-/blob/master/bilby/gw/source.py#L14

Those could be added to the Bilby code as well.

Best, Eric and Tom

bilby-bot commented 2 years ago

In GitLab by @git.ligo:colm.talbot on Jan 17, 2022, 20:28

Hi @git.ligo:ecm and Tom, this is interesting to see. I'm not sure exactly where such an example would be best to live, but I agree that it could be very informative.

I have a few minor comments:

bilby-bot commented 2 years ago

In GitLab by @git.ligo:ecm on Jan 19, 2022, 10:28

Hi @git.ligo:colm.talbot

thank you for the quick feedback!

no tapering is done on the waveform here

Tapering is included at template generation stage with SEOBNRv4. This can be checked in figure [14] of our notebook. The orange template is clearly tapered. Actually, the lack of tapering would probably affect the posterior of all parameters, not only geocent_time. So, this seems unlikely to us that tapering is the culprit.

Our question is: what is the time-alignment convention that should be followed by the template in Bilby?

I'm not sure exactly where such an example would be best to live

We were thinking to: https://git.ligo.org/lscsoft/bilby/-/tree/master/examples/gw_examples/injection_examples

Eric and Tom