Set likelihood to -inf if waveform_generator fails
Various XLAL issues can occur, like if the sampler steps outside the prior on its MCMC walk:
SMPLR 0 init evolve: 35%|ââââ | 35/100 [14:37<29:02, 26.81s/it] XLAL Error - XLALSimIMRSpinAlignedEOBModes: Mass ratio larger than 100! [109/869]
SEOBNRv2, SEOBNRv2_opt, SEOBNRv4, and SEOBNRv4_opt are only available for mass ratios up to 100. [108/869]
XLAL Error - XLALSimIMRSpinAlignedEOBModes (LALSimIMRSpinAlignedEOB.c:993): Invalid argument [107/869]
XLAL Error - XLALSimIMRSpinAlignedEOBWaveformAll (LALSimIMRSpinAlignedEOB.c:3217): Internal function call failed: Invalid argument [106/869]
XLAL Error - XLALSimIMRSpinAlignedEOBWaveform (LALSimIMRSpinAlignedEOB.c:635): Internal function call failed: Invalid argument [105/869]
XLAL Error - XLALSimInspiralChooseTDWaveform (LALSimInspiral.c:968): Internal function call failed: Invalid argument [104/869]
XLAL Error - XLALSimInspiralTDFromTD (LALSimInspiral.c:1894): Internal function call failed: Invalid argument [103/869]
XLAL Error - XLALSimInspiralTD (LALSimInspiral.c:2133): Internal function call failed: Invalid argument [102/869]
XLAL Error - XLALSimInspiralFD (LALSimInspiral.c:2346): Internal function call failed: Invalid argument
One solution is to catch the exit code returned by the LALSim error and include an exception in the waveform generator such that if it fails, the likelihood is set to -inf to indicate that this region of parameter space isn't allowed, and so that sampling can continue. LALSim returns specific exit codes for different errors: https://lscsoft.docs.ligo.org/lalsuite/lal/group___x_l_a_l_error__h.html#ggacd0e128cb3ee1cc61f98d9e1add4d267a785106db6dbfb84fcfc4c99ae74b306d