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
57 stars 63 forks source link

Limitations of plot_interferometer_waveform_posterior() when different injection and recovery models are used #15

Open tamaraevst opened 1 year ago

tamaraevst commented 1 year ago

I am new to Bilby, however when using the code for my project I noticed that plot_interferometer_waveform_posterior() function uses only the waveform generator of the recovery model when plotting the results. In particular, the following line is responsible for that, whose initialisation of the waveform is subsequently used in the plotting routine:

waveform_generator = self.waveform_generator_class(
            duration=self.duration, sampling_frequency=self.sampling_frequency,
            start_time=self.start_time,
            frequency_domain_source_model=self.frequency_domain_source_model,
            time_domain_source_model=self.time_domain_source_model,
            parameter_conversion=self.parameter_conversion,
            waveform_arguments=self.waveform_arguments)

This is not an issue if the same injection and recovery waveforms are used. However, this limits the applicability of this function for more complicated scenarios where these models are not the same. I would like to suggest the following options that could be implemented as changes to account for this issue:

I would be happy to make the change through a PR, depending what option the developers think is most suitable.

ColmTalbot commented 8 months ago

Hi @tamaraevst thanks for opening this issue, I agree we should fix it and I think your second suggestion would be best. Adding it to the Interferometer meta data in this method might be a good starting point.

This repository is a mirror for our main development repo (git.ligo.org/lscsoft/bilby) so opening a PR will add some complexity. I'm hopeful that we'll be able to support this in future though.

If you're still interested in this, please let me know, otherwise, I'll label this as help wanted.

tamaraevst commented 8 months ago

Hi @ColmTalbot, if it is not very urgent, I would be happy to work on this! My hands are full with some other work, so I will not be able to do it immediately, so it may take some time if that's okay?

ColmTalbot commented 8 months ago

This isn't an urgent fix, so let us know when you have time.

tamaraevst commented 7 months ago

The timeline is more likely to be over the late spring or the summer, hope that is okay! When I am done, shall I create a PR on git.ligo.org/lscsoft/bilby repo?