-
Notifications
You must be signed in to change notification settings - Fork 122
BUG: Fix GWSignalWaveformGenerator reconstruction in waveform posterior plots #1029
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
BUG: Fix GWSignalWaveformGenerator reconstruction in waveform posterior plots #1029
Conversation
2e73df8 to
d2cefdb
Compare
ColmTalbot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lorenzopompili00 thanks for opening this PR! I think we should add this functionality, but I'd like to think about whether we can find a more generic way of implementing this.
To be concrete, I'd suggest adding a new property to the WaveformGenerator like
class WaveformGenerator:
...
@property
def meta_data(self):
return dict()
class GWSignalWaveformGenerator:
...
@property
def meta_data(self):
return dict(
eccentricity=...
)We could also put in the information needed to reconstruct the WaveformGenerator for that class.
I'm interested to get thoughts from a wider group on this.
bilby/gw/likelihood/base.py
Outdated
| lal_version=self.lal_version, | ||
| lalsimulation_version=self.lalsimulation_version) | ||
|
|
||
| if isinstance(self.waveform_generator, GWSignalWaveformGenerator): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should just add a generic meta_data attribute to the waveform generator as for interferometers and then add that here? That would avoid having a special case here.
I like this suggestion, and would be in favour of adding |
|
Thanks for taking a look and for the feedback @ColmTalbot @mj-will! I agree your suggestion is cleaner, I have made changes to address it. |
ColmTalbot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making the changes, I'm happy with this version.
I was trying to plot some waveform reconstructions using
plot_interferometer_waveform_posteriorfor some eccentric PE runs using the newGWSignalWaveformGenerator, and I realized it is currently not working correctly.The reason is that the arguments required to instantiate
GWSignalWaveformGeneratorare not saved in the likelihood metadata, and are not passed to the waveform generator when it is instantiated inplot_interferometer_waveform_posteriorhere.A fix is to save and pass these extra arguments whenever the waveform generator is
GWSignalWaveformGenerator. I have added this via awaveform_generator_constructor_dict, inspired by thisbilby_pipemerge request. Let me know if you have any other preferences for handling this.