Skip to content

fixes #684 bug in TDModesFromPolarizations after NewInterface

Description

@geraint.pratten @vijay.varma

This fixes an issue raised by @jacob.langue. After the merge of the new-interface, the function XLALSimInspiralTDModesFromPolarizations did not work properly anymore. Running e.g. the snippet below,

import lal
import lalsimulation as lalsim
hlms = lalsim.SimInspiralTDModesFromPolarizations( \
                                                   100.0 * lal.MSUN_SI, 100 * lal.MSUN_SI, \
                                                0.0, 0.0, 0.5, \
                                                   0.0, 0.0, -0.5, \
                                                   2000 * lal.PC_SI*1e6, 0.0,  \
                                                   0.0, 0.0, 0.0, \
                                                   0.000244140625, 10, 10, \
                                                   None, 73)

threw the error

XLAL Error - XLALSimInspiralGenerateTDWaveform (../../../../git/lalsuite-new-interface-doxygen/lalsimulation/lib/LALSimInspiral.c:476): hplus and hcross must be pointers to NULL
XLAL Error - XLALSimInspiralGenerateTDWaveform (../../../../git/lalsuite-new-interface-doxygen/lalsimulation/lib/LALSimInspiral.c:476): Invalid argument
XLAL Error - XLALSimInspiralTDModesFromPolarizations (../../../../git/lalsuite-new-interface-doxygen/lalsimulation/lib/LALSimInspiral.c:952): Internal function call failed: Invalid argument

This happened because the new-interface explicitly checks that hplus, hcross are NULL here, this was not checked before.

With this fix, we declare hplus/hcross as NULL in the definition of XLALSimInspiralTDModesFromPolarizations.

API Changes and Justification

Backwards Compatible Changes

  • This change does not modify any class/function/struct/type definitions in a public C header file or any Python class/function definitions
  • This change adds new classes/functions/structs/types to a public C header file or Python module

Backwards Incompatible Changes

  • This change modifies an existing class/function/struct/type definition in a public C header file or Python module
  • This change removes an existing class/function/struct/type from a public C header file or Python module

If any of the Backwards Incompatible check boxes are ticked please provide a justification why this change is necessary and why it needs to be done in a backwards incompatible way.

Review Status

Rerunning the code snippet above gives the expected result.

Merge request reports