Verified Commit c0dda25a authored by David Keitel's avatar David Keitel Committed by Adam Mercer
Browse files

Merge branch 'fix-dimension-freqseries-Phenom' into 'master'

Fix dimension freq series PhenomHM(Pv3HM)XHM

See merge request lscsoft/lalsuite!1375

(cherry picked from commit afe28770)
parent 49b7087a
......@@ -1076,13 +1076,13 @@ tried to apply shift of -1.0/deltaF with deltaF=%g.",
if (!(hptilde))
XLAL_ERROR(XLAL_EFUNC);
memset((*hptilde)->data->data, 0, pHMFS->npts * sizeof(COMPLEX16));
XLALUnitDivide(&(*hptilde)->sampleUnits, &(*hptilde)->sampleUnits, &lalSecondUnit);
XLALUnitMultiply(&(*hptilde)->sampleUnits, &(*hptilde)->sampleUnits, &lalSecondUnit);
*hctilde = XLALCreateCOMPLEX16FrequencySeries("hctilde: FD waveform", &tC, 0.0, deltaF, &lalStrainUnit, pHMFS->npts);
if (!(hctilde))
XLAL_ERROR(XLAL_EFUNC);
memset((*hctilde)->data->data, 0, pHMFS->npts * sizeof(COMPLEX16));
XLALUnitDivide(&(*hctilde)->sampleUnits, &(*hctilde)->sampleUnits, &lalSecondUnit);
XLALUnitMultiply(&(*hctilde)->sampleUnits, &(*hctilde)->sampleUnits, &lalSecondUnit);
/* Adding the modes to form hplus, hcross
* - use of a function that copies XLALSimAddMode but for Fourier domain structures */
......
......@@ -414,13 +414,13 @@ tried to apply shift of -1.0/deltaF with deltaF=%g.",
if (!(hptilde))
XLAL_ERROR(XLAL_EFUNC);
memset((*hptilde)->data->data, 0, npts * sizeof(COMPLEX16));
XLALUnitDivide(&(*hptilde)->sampleUnits, &(*hptilde)->sampleUnits, &lalSecondUnit);
XLALUnitMultiply(&(*hptilde)->sampleUnits, &(*hptilde)->sampleUnits, &lalSecondUnit);
*hctilde = XLALCreateCOMPLEX16FrequencySeries("hctilde: FD waveform", &tC, 0.0, deltaF, &lalStrainUnit, npts);
if (!(hctilde))
XLAL_ERROR(XLAL_EFUNC);
memset((*hctilde)->data->data, 0, npts * sizeof(COMPLEX16));
XLALUnitDivide(&(*hctilde)->sampleUnits, &(*hctilde)->sampleUnits, &lalSecondUnit);
XLALUnitMultiply(&(*hctilde)->sampleUnits, &(*hctilde)->sampleUnits, &lalSecondUnit);
/* Frequency domain amplitude pre-factor */
const REAL8 amp0 = XLALSimPhenomUtilsFDamp0(Mtot_Msun, distance);
......
......@@ -1290,11 +1290,11 @@ static int IMRPhenomXHM_MultiMode(
*hptilde = XLALCreateCOMPLEX16FrequencySeries("hptilde: FD waveform", &(ligotimegps_zero), 0.0, deltaF, &lalStrainUnit, n);
if (!(hptilde)){ XLAL_ERROR(XLAL_EFUNC);}
memset((*hptilde)->data->data, 0, n * sizeof(COMPLEX16));
XLALUnitDivide(&(*hptilde)->sampleUnits, &(*hptilde)->sampleUnits, &lalSecondUnit);
XLALUnitMultiply(&(*hptilde)->sampleUnits, &(*hptilde)->sampleUnits, &lalSecondUnit);
*hctilde = XLALCreateCOMPLEX16FrequencySeries("hctilde: FD waveform", &(ligotimegps_zero), 0.0, deltaF, &lalStrainUnit, n);
if (!(hctilde)){ XLAL_ERROR(XLAL_EFUNC);}
memset((*hctilde)->data->data, 0, n * sizeof(COMPLEX16));
XLALUnitDivide(&(*hctilde)->sampleUnits, &(*hctilde)->sampleUnits, &lalSecondUnit);
XLALUnitMultiply(&(*hctilde)->sampleUnits, &(*hctilde)->sampleUnits, &lalSecondUnit);
init = 1;
}
/* Skip 22 mode if it was only required for the mixing of the 32 */
......@@ -1419,12 +1419,12 @@ static int IMRPhenomXHM_MultiMode2(
*hptilde = XLALCreateCOMPLEX16FrequencySeries("hptilde: FD waveform", &(ligotimegps_zero), 0.0, pWF->deltaF, &lalStrainUnit, n);
if (!(hptilde)){ XLAL_ERROR(XLAL_EFUNC);}
memset((*hptilde)->data->data, 0, n * sizeof(COMPLEX16)); // what is this for??
XLALUnitDivide(&(*hptilde)->sampleUnits, &(*hptilde)->sampleUnits, &lalSecondUnit); // what does it do?
XLALUnitMultiply(&(*hptilde)->sampleUnits, &(*hptilde)->sampleUnits, &lalSecondUnit); // what does it do?
*hctilde = XLALCreateCOMPLEX16FrequencySeries("hctilde: FD waveform", &(ligotimegps_zero), 0.0, pWF->deltaF, &lalStrainUnit, n);
if (!(hctilde)){ XLAL_ERROR(XLAL_EFUNC);}
memset((*hctilde)->data->data, 0, n * sizeof(COMPLEX16));
XLALUnitDivide(&(*hctilde)->sampleUnits, &(*hctilde)->sampleUnits, &lalSecondUnit);
XLALUnitMultiply(&(*hctilde)->sampleUnits, &(*hctilde)->sampleUnits, &lalSecondUnit);
#if DEBUG == 1
printf("\nlength htildelm = %zu\n", n);
......
......@@ -538,7 +538,8 @@ int XLALSimIMRPhenomXHMMultiBandOneMode(
/* Resize the COMPLEX16 frequency series */
*htildelm = XLALResizeCOMPLEX16FrequencySeries(*htildelm, 0, n_full);
XLAL_CHECK (*htildelm, XLAL_ENOMEM, "Failed to resize waveform COMPLEX16FrequencySeries of length %zu (for internal fCut=%f) to new length %zu (for user-requested f_max=%f).", n, pWF->fCut, n_full, pWF->fMax );
XLALUnitMultiply(&((*htildelm)->sampleUnits), &((*htildelm)->sampleUnits), &lalSecondUnit);
LALFree(pWF);
return offset;
......@@ -1241,7 +1242,8 @@ int XLALSimIMRPhenomXHMMultiBandOneModeMixing(
/* Resize the COMPLEX16 frequency series */
*htildelm = XLALResizeCOMPLEX16FrequencySeries(*htildelm, 0, n_full);
XLAL_CHECK (*htildelm, XLAL_ENOMEM, "Failed to resize waveform COMPLEX16FrequencySeries of length %zu (for internal fCut=%f) to new length %zu (for user-requested f_max=%f).", n, pWF->fCut, n_full, pWF->fMax );
XLALUnitMultiply(&((*htildelm)->sampleUnits), &((*htildelm)->sampleUnits), &lalSecondUnit);
LALFree(pWF);
return offset;
......
......@@ -1957,7 +1957,7 @@ static int IMRPhenomXPHM_OneMode(
/* Initialize hlmneg according to hlmpos. */
size_t npts = (*hlmpos)->data->length;
*hlmneg = XLALCreateCOMPLEX16FrequencySeries("hlmneg: FD waveform", &ligotimegps_zero, (*hlmpos)->f0, pWF->deltaF, &lalStrainUnit, npts);
*hlmneg = XLALCreateCOMPLEX16FrequencySeries("hlmneg: FD waveform", &(*hlmpos)->epoch, (*hlmpos)->f0, pWF->deltaF, &lalStrainUnit, npts);
XLAL_CHECK (*hlmneg, XLAL_ENOMEM, "Failed to allocated waveform COMPLEX16FrequencySeries of length %zu.", npts);
memset((*hlmneg)->data->data, 0, npts * sizeof(COMPLEX16));
XLALUnitMultiply(&((*hlmneg)->sampleUnits), &((*hlmneg)->sampleUnits), &lalSecondUnit);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment