Issue with injection parameters in run_sampler
Email from Stephen Feeney:
It's nothing enormous, but it can result in the results.injection_parameter storing the wrong inclination angle, iota. This happens for me because I'm using a reference frequency that is different from bilby's default. In bilby/core/sampler/init.py, in run_sampler, when appending the injection_parameters to the result object, conversion_function is called without passing in the likelihood object (which in turn contains the user-specified minimum and reference frequencies). This means result.injection_parameters uses the default reference_frequency when converting theta_jn etc. into iota, and as a result my results objects' iotas don't match the ones actually used when injected signals. Niche :) But I thought you'd want to know :)
Pointing to the code, this line needs to also pass in the likelihood.
However, this creates a bit of a problem: if users pass in their own conversion functions which don't accept the likelihood it will fall over.
Fundamentally, I think we are missing a standard interface for the "conversion" function. I think the resolution here is to set a convention for the conversion function. What do folks think?