Go to the source code of this file.
TwoSpectTemplate * createTwoSpectTemplate | ( | const UINT4 | length | ) |
Allocate a new TwoSpectTemplate.
[in] | length | Length of the template |
Definition at line 35 of file templates.c.
void resetTwoSpectTemplate | ( | TwoSpectTemplate * | template | ) |
Reset the values in a TwoSpectTemplate.
[in] | template | Pointer to a TwoSpectTemplate |
Definition at line 60 of file templates.c.
void destroyTwoSpectTemplate | ( | TwoSpectTemplate * | template | ) |
Free a TwoSpectTemplate.
[in] | template | Pointer to a TwoSpectTemplate |
Definition at line 78 of file templates.c.
TwoSpectTemplateVector * createTwoSpectTemplateVector | ( | const UINT4 | length, |
const UINT4 | templateLength | ||
) |
Create a TwoSpectTemplateVector.
[in] | length | The number of templates in the vector |
[in] | templateLength | The maximum number of pixels in a template |
Definition at line 94 of file templates.c.
void destroyTwoSpectTemplateVector | ( | TwoSpectTemplateVector * | vector | ) |
Free a TwoSpectTemplateVector.
[in] | vector | Pointer to the TwoSpectTemplateVector |
Definition at line 120 of file templates.c.
TwoSpectTemplateVector * generateTwoSpectTemplateVector | ( | const REAL8 | Pmin, |
const REAL8 | Pmax, | ||
const REAL8 | dfmin, | ||
const REAL8 | dfmax, | ||
const REAL8 | Tsft, | ||
const REAL8 | SFToverlap, | ||
const REAL8 | Tobs, | ||
const UINT4 | maxvectorlength, | ||
const UINT4 | minTemplateLength, | ||
const UINT4 | maxTemplateLength, | ||
const UINT4 | vectormathflag, | ||
const BOOLEAN | exactflag | ||
) |
Generate a TwoSpectTemplateVector containing the template data.
[in] | Pmin | Minimum orbital period (s) |
[in] | Pmax | Maximum orbital period (s) |
[in] | dfmin | Minimum modulation depth (Hz) |
[in] | dfmax | Maximum modulation depth (Hz) |
[in] | Tsft | Timespan of SFTs (s) |
[in] | SFToverlap | Overlap of SFTs (s) |
[in] | Tobs | Observation time (s) |
[in] | maxvectorlength | Limit the number of templates generated to be the maximum value specified here |
[in] | minTemplateLength | The minimum number of pixels in a template |
[in] | maxTemplateLength | The maximum number of pixels in a template |
[in] | vectormathflag | Flag specifying what type of vector math to use: 0 = none, 1 = SSE, 2 = AVX (for SSE and AVX, must compile using correct flags and instructions allowed on the CPU) |
[in] | exactflag | Flag specifying to use exact templates: 1 = enabled, 0 = disabled |
Definition at line 156 of file templates.c.
INT4 writeTwoSpectTemplateVector | ( | const TwoSpectTemplateVector * | vector, |
const CHAR * | filename | ||
) |
Write a TwoSpectTemplateVector to binary file.
[in] | vector | Pointer to the TwoSpectTemplateVector |
[in] | filename | String of the filename |
Definition at line 222 of file templates.c.
TwoSpectTemplateVector * readTwoSpectTemplateVector | ( | const CHAR * | filename | ) |
Read a TwoSpectTemplateVector from a binary file.
[in] | filename | String of the filename |
Definition at line 250 of file templates.c.
INT4 convertTemplateForSpecificFbin | ( | TwoSpectTemplate * | output, |
const TwoSpectTemplate * | input, | ||
const REAL8 | freq, | ||
const UserInput_t * | params | ||
) |
Convert an arbitrary frequency bin template into a template for a specific frequency bin.
When using this function, the input template should be generated first using makeTemplate*2 functions. Then call this function with a specific bin center frequency. The input template can contain an offset up to half a frequency bin in order to generate any frequency of a template. The output template must be at most as long as the input template. For shorter lengths, only the first output->templatedata->length values are kept
[in,out] | output | Pointer to a TwoSpectTemplate for a specific frequency bin |
[in] | input | Pointer to a TwoSpectTemplate for an arbitrary frequency bin |
[in] | freq | Frequency of a bin centered signal |
[in] | params | Pointer to a UserInput_t struct |
Definition at line 330 of file templates.c.
INT4 makeTemplateGaussians | ( | TwoSpectTemplate * | output, |
const candidate | input, | ||
const UserInput_t * | params | ||
) |
Make an estimated template based on FFT of train of Gaussians.
This is eq. 18 of E. Goetz and K. Riles (2011). This handles spillages of power into neighboring frequency bins a little more gracefully. Numerical stability issues mean that we need to compute exp(log(eq. 18)) = eq. 18 exp(log(eq. 18)) = exp(log(4*pi*sigma^2) - sigma^2*omegapr^2) * (1+cos(delta*omegapr)) * exp(log(1-cos(N*P*omegapr))-log(P*omegapr))
[out] | output | Pointer to TwoSpectTemplate |
[in] | input | An input candidate structure |
[in] | params | Pointer to UserInput_t |
Definition at line 289 of file templates.c.
INT4 makeTemplateGaussians2 | ( | TwoSpectTemplate * | output, |
const REAL8 | offset, | ||
const REAL8 | P, | ||
const REAL8 | deltaf, | ||
const REAL8 | Tsft, | ||
const REAL8 | SFToverlap, | ||
const REAL8 | Tobs, | ||
const UINT4 | minTemplateLength, | ||
const UINT4 | vectormathflag | ||
) |
Make an estimated template based on FFT of train of Gaussians.
This is eq. 18 of E. Goetz and K. Riles (2011). This handles spillages of power into neighboring frequency bins a little more gracefully. Numerical stability issues mean that we need to compute exp(log(eq. 18)) = eq. 18 exp(log(eq. 18)) = exp(log(4*pi*sigma^2) - sigma^2*omegapr^2) * (1+cos(delta*omegapr)) * exp(log(1-cos(N*P*omegapr))-log(P*omegapr))
[in,out] | output | Pointer to TwoSpectTemplate |
[in] | offset | Amount of offset from bin centered signal (-0.5 <= offset <= 0.5) |
[in] | P | Orbital period (seconds) |
[in] | deltaf | Modulation depth of the signal (Hz) |
[in] | Tsft | Length of an SFT (s) |
[in] | SFToverlap | SFT overlap (s) |
[in] | Tobs | Observation time (s) |
[in] | minTemplateLength | Minimum number of pixels in a template |
[in] | vectormathflag | Flag indicating to use vector math: 0 = none, 1 = SSE, 2 = AVX (must compile for vector math appropriately and CPU must have those instructions) |
Definition at line 374 of file templates.c.
INT4 makeTemplate | ( | TwoSpectTemplate * | output, |
const candidate | input, | ||
const UserInput_t * | params, | ||
const REAL4FFTPlan * | plan | ||
) |
Make an template based on FFT of sinc squared functions.
This is eq. 20 of E. Goetz and K. Riles (2011)
[out] | output | Pointer to TwoSpectTemplate |
[in] | input | An input candidate structure |
[in] | params | Pointer to UserInput_t |
[in] | plan | Pointer to REAL4FFTPlan |
Definition at line 727 of file templates.c.
INT4 makeTemplate2 | ( | TwoSpectTemplate * | output, |
const REAL8 | offset, | ||
const REAL8 | P, | ||
const REAL8 | deltaf, | ||
const REAL8 | Tsft, | ||
const REAL8 | SFToverlap, | ||
const REAL8 | Tobs, | ||
const UINT4 | minTemplateLength, | ||
const UINT4 | vectormathflag, | ||
const REAL4FFTPlan * | plan | ||
) |
Make an template based on FFT of sinc squared functions.
This is eq. 20 of E. Goetz and K. Riles (2011)
[in,out] | output | Pointer to TwoSpectTemplate |
[in] | offset | Amount of offset from bin centered signal (-0.5 <= offset <= 0.5) |
[in] | P | Orbital period (seconds) |
[in] | deltaf | Modulation depth of the signal (Hz) |
[in] | Tsft | Length of an SFT (s) |
[in] | SFToverlap | SFT overlap (s) |
[in] | Tobs | Observation time (s) |
[in] | minTemplateLength | Minimum number of pixels in a template |
[in] | vectormathflag | Flag indicating to use vector math: 0 = none, 1 = SSE, 2 = AVX (must compile for vector math appropriately and CPU must have those instructions) |
[in] | plan | Pointer to REAL4FFTPlan |
Definition at line 771 of file templates.c.
void insertionSort_template | ( | TwoSpectTemplate * | output, |
const REAL4 | weight, | ||
const INT4 | pixelloc | ||
) |
Insertion sort for the template weights.
[out] | output | Pointer to TwoSpectTemplate |
[in] | weight | Pixel weight |
[in] | pixelloc | Index of the pixel in the REAL4VectorAligned of the frequency-frequency plane |
Definition at line 938 of file templates.c.
Calculate sin(pi*x)/(pi*x)/(x^2-1)
x | Value from which to compute |
Definition at line 963 of file templates.c.
Calculate [sin(pi*x)/(pi*x)/(x^2-1)]^2.
x | Value from which to compute |
Definition at line 988 of file templates.c.