LALPulsar 7.1.1.1-eeff03c
IHS.c File Reference

Prototypes

ihsMaximaStructcreateihsMaxima (const UINT4 fbins, const UINT4 rows)
 Create vectors for IHS maxima struct. More...
 
void destroyihsMaxima (ihsMaximaStruct *data)
 Destroy vectors and the IHS maxima struct. More...
 
INT4 runIHS (ihsMaximaStruct *output, const ffdataStruct *input, const ihsfarStruct *ihsfarinput, const UserInput_t *params, const UINT4 rows, const REAL4VectorAligned *aveNoise, const REAL4VectorAligned *FbinMean)
 Run the IHS algorithm. More...
 
ihsValscreateihsVals (void)
 Allocate memory for ihsVals struct. More...
 
void destroyihsVals (ihsVals *ihsvals)
 Destroy ihsVals struct. More...
 
INT4 incHarmSum (ihsVals *output, const REAL4VectorAligned *input, const UINT4 ihsfactor)
 Compute the IHS sum maximum. More...
 
INT4 incHarmSumVector (REAL4VectorAligned *output, const REAL4VectorAligned *input, const UINT4 ihsfactor)
 Compute the IHS vector – does not compute the maximum value. More...
 
INT4 incHarmSumVectorWeighted (REAL4VectorAligned *output, const REAL4VectorAligned *input, const REAL4VectorAligned *aveNoise, const UINT4 ihsfactor)
 Compute the noise weighted IHS vector – does not compute the maximum value. More...
 
ihsfarStructcreateihsfarStruct (const UINT4 rows, const UserInput_t *params)
 Allocate memory for ihsfarStruct struct. More...
 
void destroyihsfarStruct (ihsfarStruct *ihsfarstruct)
 Destroy ihsfarStruct struct. More...
 
INT4 genIhsFar (ihsfarStruct *output, const UserInput_t *params, const UINT4 rows, const REAL4VectorAligned *aveNoise, const gsl_rng *rng)
 Compute the IHS FAR for a sum of a number of rows. More...
 
INT4 sumIHSarrayFAR (ihsfarStruct *outputfar, REAL4VectorAlignedArray *ihsvectorarray, const UINT4 rows, const REAL4VectorAligned *FbinMean, const UserInput_t *params, const gsl_rng *rng)
 Compute the IHS sums for a number of rows used for the FAR calculation. More...
 
INT4 sumIHSarray (ihsMaximaStruct *output, const ihsfarStruct *inputfar, REAL4VectorAlignedArray *ihsvectorarray, const UINT4 rows, const REAL4VectorAligned *FbinMean, const UserInput_t *params)
 Compute the IHS sums for a number of rows. More...
 
REAL4 ihsFOM (const INT4Vector *locs, const INT4 fomnorm)
 Calculate the IHS FOM for a number of rows. More...
 
INT4 findIHScandidates (candidateVector **candlist, const ihsfarStruct *ihsfarstruct, const UserInput_t *params, const ffdataStruct *ffdata, const ihsMaximaStruct *ihsmaxima, const REAL4VectorAligned *fbinavgs, const REAL4VectorSequence *trackedlines)
 Find IHS candidates above thresholds. More...
 
REAL8 ihs2h0 (const REAL8 ihsval, const UserInput_t *params)
 Convert the IHS statistic to an estimated h0, based on injections. More...
 

Go to the source code of this file.

Function Documentation

◆ createihsMaxima()

ihsMaximaStruct * createihsMaxima ( const UINT4  fbins,
const UINT4  rows 
)

Create vectors for IHS maxima struct.

Parameters
[in]fbinsNumber of frequency bins
[in]rowsNumber of neighboring rows to be summed
Returns
Pointer to a newly created ihsMaximaStruct

Definition at line 37 of file IHS.c.

◆ destroyihsMaxima()

void destroyihsMaxima ( ihsMaximaStruct data)

Destroy vectors and the IHS maxima struct.

Parameters
[in]dataPointer to an ihsMaximaStruct to be freed

Definition at line 65 of file IHS.c.

◆ runIHS()

INT4 runIHS ( ihsMaximaStruct output,
const ffdataStruct input,
const ihsfarStruct ihsfarinput,
const UserInput_t params,
const UINT4  rows,
const REAL4VectorAligned aveNoise,
const REAL4VectorAligned FbinMean 
)

Run the IHS algorithm.

Parameters
[out]outputPointer to the ihsMaximaStruct
[in]inputPointer to the ffdataStruct
[in]ihsfarinputPointer to the ihsfarStruct
[in]paramsPointer to UserInput_t
[in]rowsNumber of neighboring rows to be summed
[in]aveNoisePointer to a REAL4VectorAligned of 2nd FFT background powers
[in]FbinMeanPointer to a REAL4VectorAligned of normalized SFT background powers
Returns
Status value

Definition at line 89 of file IHS.c.

◆ createihsVals()

ihsVals * createihsVals ( void  )

Allocate memory for ihsVals struct.

Returns
Pointer to a newly created ihsVals structure

Definition at line 168 of file IHS.c.

◆ destroyihsVals()

void destroyihsVals ( ihsVals ihsvals)

Destroy ihsVals struct.

Parameters
[in]ihsvalsPointer to an ihsVals structure to be freed

Definition at line 180 of file IHS.c.

◆ incHarmSum()

INT4 incHarmSum ( ihsVals output,
const REAL4VectorAligned input,
const UINT4  ihsfactor 
)

Compute the IHS sum maximum.

Parameters
[out]outputPointer to the ihsVals structure
[in]inputPointer to a REAL4VectorAligned
[in]ihsfactorNumber of folds of the 2nd FFT
Returns
Status value

Definition at line 195 of file IHS.c.

◆ incHarmSumVector()

INT4 incHarmSumVector ( REAL4VectorAligned output,
const REAL4VectorAligned input,
const UINT4  ihsfactor 
)

Compute the IHS vector – does not compute the maximum value.

Parameters
[out]outputPointer to a REAL4VectorAligned to contain the folded values
[in]inputPointer to a REAL4VectorAligned for the input to the IHS
[in]ihsfactorNumber of folds of the 2nd FFT
Returns
Status value

Definition at line 228 of file IHS.c.

◆ incHarmSumVectorWeighted()

INT4 incHarmSumVectorWeighted ( REAL4VectorAligned output,
const REAL4VectorAligned input,
const REAL4VectorAligned aveNoise,
const UINT4  ihsfactor 
)

Compute the noise weighted IHS vector – does not compute the maximum value.

Parameters
[out]outputPointer to a REAL4VectorAligned to contain the folded values
[in]inputPointer to a REAL4VectorAligned for the input to the IHS
[in]aveNoisePointer to a REAL4VectorAligned of 2nd FFT background powers
[in]ihsfactorNumber of folds of the 2nd FFT
Returns
Status value

Definition at line 259 of file IHS.c.

◆ createihsfarStruct()

ihsfarStruct * createihsfarStruct ( const UINT4  rows,
const UserInput_t params 
)

Allocate memory for ihsfarStruct struct.

Parameters
[in]rowsNumber of neighbors to sum
[in]paramsPointer to UserInput_t
Returns
Pointer to a newly allocated ihsfarStruct

Definition at line 289 of file IHS.c.

◆ destroyihsfarStruct()

void destroyihsfarStruct ( ihsfarStruct ihsfarstruct)

Destroy ihsfarStruct struct.

Parameters
[in]ihsfarstructPointer to the ihsfarStruct to be destroyed

Definition at line 316 of file IHS.c.

◆ genIhsFar()

INT4 genIhsFar ( ihsfarStruct output,
const UserInput_t params,
const UINT4  rows,
const REAL4VectorAligned aveNoise,
const gsl_rng *  rng 
)

Compute the IHS FAR for a sum of a number of rows.

Parameters
[out]outputPointer to the output ihsfarStruct
[in]paramsPointer to UserInput_t
[in]rowsNumber of neighbors to sum
[in]aveNoisePointer to REAL4VectorAligned of 2nd FFT background powers
[in]rngPointer to GSL random number generator
Returns
Status value

Definition at line 340 of file IHS.c.

◆ sumIHSarrayFAR()

INT4 sumIHSarrayFAR ( ihsfarStruct outputfar,
REAL4VectorAlignedArray ihsvectorarray,
const UINT4  rows,
const REAL4VectorAligned FbinMean,
const UserInput_t params,
const gsl_rng *  rng 
)

Compute the IHS sums for a number of rows used for the FAR calculation.

Parameters
[out]outputfarPointer to the output ihsfarStruct
[in]ihsvectorarrayPointer to REAL4VectorAlignedArray to be summed
[in]rowsNumber of neighbors to sum
[in]FbinMeanPointer to REAL4VectorAligned of normalized SFT background powers
[in]paramsPointer to UserInput_t
[in]rngPointer to random number generator
Returns
Status value

Definition at line 469 of file IHS.c.

◆ sumIHSarray()

INT4 sumIHSarray ( ihsMaximaStruct output,
const ihsfarStruct inputfar,
REAL4VectorAlignedArray ihsvectorarray,
const UINT4  rows,
const REAL4VectorAligned FbinMean,
const UserInput_t params 
)

Compute the IHS sums for a number of rows.

In the function we will select the the location which is the maximum above the noise

Parameters
[out]outputPointer to the output ihsMaximaStruct
[in]inputfarPointer to ihsfarStruct
[in]ihsvectorarrayPointer to REAL4VectorAlignedArray to be summed
[in]rowsNumber of neighbors to sum
[in]FbinMeanPointer to REAL4VectorAligned of normalized SFT background powers
[in]paramsPointer to UserInput_t
Returns
Status value

Definition at line 639 of file IHS.c.

◆ ihsFOM()

REAL4 ihsFOM ( const INT4Vector locs,
const INT4  fomnorm 
)

Calculate the IHS FOM for a number of rows.

Parameters
[in]locsPointer to INT4Vector of location values
[in]fomnormNormalization value and is the number of XXX
Returns
IHS FOM value

Definition at line 782 of file IHS.c.

◆ findIHScandidates()

INT4 findIHScandidates ( candidateVector **  candlist,
const ihsfarStruct ihsfarstruct,
const UserInput_t params,
const ffdataStruct ffdata,
const ihsMaximaStruct ihsmaxima,
const REAL4VectorAligned fbinavgs,
const REAL4VectorSequence trackedlines 
)

Find IHS candidates above thresholds.

Parameters
[out]candlistPointer to a pointer containing the candidate list
[in]ihsfarstructPointer to ihsfarStruct
[in]paramsPointer to UserInput_t
[in]ffdataPointer to ffdataStruct
[in]ihsmaximaPointer to ihsMaximaStruct containing the data to be tested above thresholds
[in]fbinavgsPointer to REAL4VectorAligned of normalized SFT background powers
[in]trackedlinesPointer to REAL4VectorSequence of lines (allowed to be NULL if no lines)
Returns
Status value

Definition at line 809 of file IHS.c.

◆ ihs2h0()

REAL8 ihs2h0 ( const REAL8  ihsval,
const UserInput_t params 
)

Convert the IHS statistic to an estimated h0, based on injections.

Parameters
[in]ihsvalThe IHS statistic value
[in]paramsPointer to UserInput_t
Returns
Estimated h0

Definition at line 1083 of file IHS.c.