Skip to content

Fix LALInferencePrintInjectionSample

Salvatore Vitale requested to merge salvatore-vitale/lalsuite:master into master

The routine that prints the injected parameters and the (delta)logL an logP were not working correcting. Spin parameters, fref, and distance were actually not fixed to their true value before the logL was calculated. Fixed deltaLogL by explicitly recalculating logZnoise in the function.

Still not perfect: I don't have a routine to convert (ra,dec,time) -> (cosalpha,azimuth,t0), which would be necessary.

Thus, even after this patch this will only print meaningful injlogL with --no-detector-frame, until we fix that conversion too.

I added a --dont-sample flag to Next to return 0 after the *injection file is created, which I thought could be useful. However I'm not strongly attached to that idea, we can remove it and create an ad-hoc bin that does it.

EDIT:

with the latest version of this patch I have:

a) make the code work even with detector-frame sky coordinate b) removed the dont-sample option from Nest c) introduced a utility lalinference_injectedlike that gets the same exact command line as the sampler, but only create the output.injection file. This can be useful (it is for me at least) for pre-existing lalinference runs for which one would like to get the injected logL and logP. Running it on existing command lines will not overwrite existing samples (but it will overwrite SNR and PSD files unless --dont-dump-extras is given)

Edited by LALSuite Bot

Merge request reports