Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALPulsar 7.1.1.1-3a66518
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
TwoSpectTemplateBank.c
Go to the documentation of this file.
1/*
2* Copyright (C) 2014 Evan Goetz
3*
4* This program is free software; you can redistribute it and/or modify
5* it under the terms of the GNU General Public License as published by
6* the Free Software Foundation; either version 2 of the License, or
7* (at your option) any later version.
8*
9* This program is distributed in the hope that it will be useful,
10* but WITHOUT ANY WARRANTY; without even the implied warranty of
11* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12* GNU General Public License for more details.
13*
14* You should have received a copy of the GNU General Public License
15* along with with program; see the file COPYING. If not, write to the
16* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17* MA 02110-1301 USA
18*/
19
20#include "config.h"
21
22#include <lal/UserInput.h>
23#include <lal/LALPulsarVCSInfo.h>
24#include "templates.h"
25
26typedef struct {
31 REAL8 Tsft;
32 REAL8 SFToverlap;
33 REAL8 Tobs;
41
42INT4 InitUserVars2( UserVariables_t *uvar, int argc, char *argv[] );
43
44INT4 main( int argc, char *argv[] )
45{
47 XLAL_CHECK( InitUserVars2( &uvar, argc, argv ) == XLAL_SUCCESS, XLAL_EFUNC );
48
49 //Set vectormath
50 //if (uvar.vectorMath==1) XLAL_CHECK( XLALVectorDeviceSet(VECTORDEVICE_SSE) == XLAL_SUCCESS, XLAL_EFUNC );
51 //else if (uvar.vectorMath==2) XLAL_CHECK( XLALVectorDeviceSet(VECTORDEVICE_AVX) == XLAL_SUCCESS, XLAL_EFUNC );
52 //else XLAL_CHECK( XLALVectorDeviceSet(VECTORDEVICE_FPU) == XLAL_SUCCESS, XLAL_EFUNC );
53
55 XLAL_CHECK( ( vector = generateTwoSpectTemplateVector( uvar.Pmin, uvar.Pmax, uvar.dfmin, uvar.dfmax, uvar.Tsft, uvar.SFToverlap, uvar.Tobs, uvar.maxVectorLength, uvar.minTemplateLength, uvar.maxTemplateLength, uvar.vectorMath, uvar.exactflag ) ) != NULL, XLAL_EFUNC );
56
57 if ( XLALUserVarWasSet( &uvar.filename ) ) {
59 }
60
63
64 return 0;
65}
66
67INT4 InitUserVars2( UserVariables_t *uvar, int argc, char *argv[] )
68{
69 XLAL_CHECK( uvar != NULL, XLAL_EINVAL, "Invalid NULL input 'uvar'\n" );
70 XLAL_CHECK( argv != NULL, XLAL_EINVAL, "Invalid NULL input 'argv'\n" );
71
72 uvar->Tsft = 1800;
73 uvar->SFToverlap = 900;
74
75 XLALRegisterUvarMember( Pmin, REAL8, 0, REQUIRED, "Minimum period" );
76 XLALRegisterUvarMember( Pmax, REAL8, 0, REQUIRED, "Maximum period" );
77 XLALRegisterUvarMember( dfmin, REAL8, 0, REQUIRED, "Minimum modulation depth" );
78 XLALRegisterUvarMember( dfmax, REAL8, 0, REQUIRED, "Maximum modulation depth" );
79 XLALRegisterUvarMember( Tsft, REAL8, 0, OPTIONAL, "SFT coherence length" );
80 XLALRegisterUvarMember( SFToverlap, REAL8, 0, OPTIONAL, "SFT overlap in second" );
81 XLALRegisterUvarMember( Tobs, REAL8, 0, REQUIRED, "Total observation time" );
82 XLALRegisterUvarMember( minTemplateLength, INT4, 0, REQUIRED, "Minimum number of pixels in templates" );
83 XLALRegisterUvarMember( maxTemplateLength, INT4, 0, REQUIRED, "Maximum number of pixels in tempaltes" );
84 XLALRegisterUvarMember( maxVectorLength, INT4, 0, REQUIRED, "Maximum vector length" );
85 XLALRegisterUvarMember( vectorMath, INT4, 0, OPTIONAL, "Vector math flag: 0 = no SSE/AVX, 1 = SSE, 2 = AVX" );
86 XLALRegisterUvarMember( exactflag, BOOLEAN, 0, OPTIONAL, "Flag to specify using exact templates" );
87 XLALRegisterUvarMember( filename, STRING, 0, OPTIONAL, "Filename of output file (if not specified, the vector is destroyed upon exit)" );
88
89 BOOLEAN should_exit = 0;
91 if ( should_exit ) {
92 exit( 1 );
93 }
94
95 return XLAL_SUCCESS;
96}
const LALVCSInfoList lalPulsarVCSInfoList
NULL-terminated list of VCS and build information for LALPulsar and its dependencies
#define STRING(a)
INT4 InitUserVars2(UserVariables_t *uvar, int argc, char *argv[])
INT4 main(int argc, char *argv[])
unsigned char BOOLEAN
double REAL8
#define XLAL_INIT_DECL(var,...)
char CHAR
int32_t INT4
int XLALUserVarReadAllInput(BOOLEAN *should_exit, int argc, char *argv[], const LALVCSInfoList vcs_list)
void XLALDestroyUserVars(void)
#define XLALRegisterUvarMember(name, type, option, category,...)
int XLALUserVarWasSet(const void *cvar)
#define XLAL_CHECK(assertion,...)
XLAL_SUCCESS
XLAL_EFUNC
XLAL_EINVAL
user input variables
Definition: compareFstats.c:51
REAL8 SFToverlap
overlap SFTs by this many seconds
REAL8 Tsft
SFT time baseline Tsft.
INT4 writeTwoSpectTemplateVector(const TwoSpectTemplateVector *vector, const CHAR *filename)
Write a TwoSpectTemplateVector to binary file.
Definition: templates.c:222
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.
Definition: templates.c:156
void destroyTwoSpectTemplateVector(TwoSpectTemplateVector *vector)
Free a TwoSpectTemplateVector.
Definition: templates.c:120