91#define PTOLEMESHTESTC_EMEM 1
92#define PTOLEMESHTESTC_ERNG 2
93#define PTOLEMESHTESTC_EFIO 3
94#define PTOLEMESHTESTC_EOPT 4
96#define PTOLEMESHTESTC_MSGEMEM "memory (de)allocation error"
97#define PTOLEMESHTESTC_MSGERNG "value out of range"
98#define PTOLEMESHTESTC_MSGEFIO "file I/O error"
99#define PTOLEMESHTESTC_MSGEOPT "unknown command-line option"
106#include <lal/AVFactories.h>
107#include <lal/LALgetopt.h>
108#include <lal/PtoleMetric.h>
109#include <lal/TwoDMesh.h>
114#define MIN_DURATION (86400./LAL_TWOPI)
115#define MAX_DURATION (86400.*5)
123#define RA_max LAL_PI_2/2.0
124#define dec_min LAL_PI_2/2.0
125#define dec_max LAL_PI_2
137int main(
int argc,
char **argv )
163 center.
longitude = ( 24.1 / 60 ) * LAL_PI_180;
164 center.
latitude = -( 72 + 5. / 60 ) * LAL_PI_180;
168 while ( ( opt =
LALgetopt( argc, argv,
"b:c:e:f:im:n:pr:t:x" ) ) != -1 ) {
170 float a, b,
c,
d,
e,
f;
174 begin = atof( LALoptarg );
177 if ( sscanf( LALoptarg,
"%f:%f:%f:%f:%f:%f", &
a, &b, &c, &
d, &e, &
f ) != 6 ) {
178 fprintf( stderr,
"coordinates should be hh:mm:ss:dd:mm:ss\n" );
181 center.
longitude = ( 15 *
a + b / 4 +
c / 240 ) * LAL_PI_180;
182 center.
latitude = (
d +
e / 60 +
f / 3600 ) * LAL_PI_180;
187 fMax = atof( LALoptarg );
195 maxNodes = atoi( LALoptarg );
203 fprintf( stderr,
"%s line %d: %s\n", __FILE__, __LINE__,
210 if ( duration < MIN_DURATION || duration > MAX_DURATION ) {
211 fprintf( stderr,
"%s line %d: %s\n", __FILE__, __LINE__,
245 if (
stat.statusCode ) {
246 return stat.statusCode;
248 printf(
"created %d nodes\n", mesh.
nOut );
253 fp = fopen(
"mesh.dat",
"w" );
258 for ( node = firstNode; node; node = node->
next ) {
266 printf(
"destroyed %d nodes\n", mesh.
nOut );
267 if (
stat.statusCode ) {
284 y[0] = center.
longitude - sqrt( pow( radius * 1.001, 2 )
286 y[1] = center.
longitude + sqrt( pow( radius * 1.001, 2 )
LALDetectorIndexGEO600DIFF
void getMetric(LALStatus *, meshREAL g[3], meshREAL skypos[2], void *params)
void getRange(LALStatus *, meshREAL y[2], meshREAL x, void *params)
void LALCheckMemoryLeaks(void)
#define ENDFAIL(statusptr)
#define TRY(func, statusptr)
#define ATTATCHSTATUSPTR(statusptr)
#define DETATCHSTATUSPTR(statusptr)
#define INITSTATUS(statusptr)
#define RETURN(statusptr)
#define BEGINFAIL(statusptr)
int LALgetopt(int argc, char *const *argv, const char *optstring)
#define PTOLEMESHTESTC_ERNG
#define PTOLEMESHTESTC_EOPT
#define PTOLEMESHTESTC_MSGERNG
#define PTOLEMESHTESTC_EFIO
#define PTOLEMESHTESTC_EMEM
int main(int argc, char **argv)
const LALDetector lalCachedDetectors[LAL_NUM_DETECTORS]
void LALPtoleMetric(LALStatus *status, REAL8Vector *metric, PtoleMetricIn *input)
Computes metric components for a pulsar search in the `‘Ptolemaic’' approximation; both the Earth's s...
void LALProjectMetric(LALStatus *stat, REAL8Vector *metric, BOOLEAN errors)
Project out the zeroth dimension of a metric.
COORDINATESYSTEM_EQUATORIAL
void LALCreateTwoDMesh(LALStatus *stat, TwoDMeshNode **mesh, TwoDMeshParamStruc *params)
void LALDestroyTwoDMesh(LALStatus *stat, TwoDMeshNode **mesh, UINT4 *nFree)
void LALDCreateVector(LALStatus *, REAL8Vector **, UINT4)
void LALDDestroyVector(LALStatus *, REAL8Vector **)
This structure will likely be changed to match up better with those under StackMetric....
SkyPosition position
The equatorial coordinates at which the metric components are evaluated.
REAL4Vector * spindown
The (dimensionless) spindown parameters for which the metric components are evaluated.
REAL4 maxFreq
The maximum frequency to be searched, in Hz.
const LALDetector * site
The detector site, used only for its latitude and longitude.
REAL4 duration
Duration of integration, in seconds.
LIGOTimeGPS epoch
When the coherent integration begins.
This structure represents a single node in a linked list of mesh points, specified in the coordinate ...
struct tagTwoDMeshNode * next
The next mesh point in the linked list; NULL if this is the tail.
REAL4 y
The coordinates of the mesh point.
This structure stores the parameters required by the two-dimensional mesh placement functions.
void(* getMetric)(LALStatus *, REAL4[3], REAL4[2], void *)
A function that returns in its second argument the components , , and (in that order) of the metri...
UINT4 nIn
The maximum number of mesh points allowed, after which the placement routine will quit.
void * metricParams
The parameters to be passed as the fourth argument of *getMetric(), above.
REAL4 mThresh
The maximum mismatch desired between any point in the region and the nearest mesh point; note that t...
void(* getRange)(LALStatus *, REAL4[2], REAL4, void *)
A function that returns in its second argument the range spanned by the parameter region for a speci...
UINT4 nOut
The number of mesh points added by the placement routine; if an error occurs, this will store the num...
REAL4 domain[2]
The domain spanned by the desired parameter region.
void * rangeParams
The parameters to be passed as the fourth argument of *getRange(), above.