100#define GENERALMESHTESTC_EMEM 1
101#define GENERALMESHTESTC_ERNG 2
102#define GENERALMESHTESTC_EFIO 3
103#define GENERALMESHTESTC_EOPT 4
104#define GENERALMESHTESTC_EMET 5
106#define GENERALMESHTESTC_MSGEMEM "memory (de)allocation error"
107#define GENERALMESHTESTC_MSGERNG "value out of range"
108#define GENERALMESHTESTC_MSGEFIO "file I/O error"
109#define GENERALMESHTESTC_MSGEOPT "unknown command-line option"
110#define GENERALMESHTESTC_MSGEMET "determinant of projected metric negative"
117#include <lal/AVFactories.h>
118#include <lal/LALgetopt.h>
119#include <lal/PtoleMetric.h>
120#include <lal/TwoDMesh.h>
121#include <lal/LALInitBarycenter.h>
126#define MIN_DURATION (86400./LAL_TWOPI)
127#define MAX_DURATION (3.16e7)
146int main(
int argc,
char **argv )
159 float a, b,
c,
d,
e,
f;
170 center.
longitude = ( 24.1 / 60 ) * LAL_PI_180;
171 center.
latitude = -( 72 + 5. / 60 ) * LAL_PI_180;
180 while ( ( opt =
LALgetopt( argc, argv,
"a:b:c:d:ef:l:m:pr:t:x" ) ) != -1 ) {
185 begin = atoi( LALoptarg );
188 if ( sscanf( LALoptarg,
"%f:%f:%f:%f:%f:%f", &
a, &b, &c, &
d, &e, &
f ) != 6 ) {
189 fprintf( stderr,
"coordinates should be hh:mm:ss:dd:mm:ss\n" );
192 center.
longitude = ( 15 *
a + b / 4 +
c / 240 ) * LAL_PI_180;
193 center.
latitude = (
d +
e / 60 +
f / 3600 ) * LAL_PI_180;
196 fMax = atof( LALoptarg );
199 if ( sscanf( LALoptarg,
"%f:%f:%f:%f",
200 &ra_min, &ra_max, &dec_min, &dec_max ) != 4 ) {
201 fprintf( stderr,
"coordinates should be ra_min, ra_max, dec_min, dec_max, all in degrees\n" );
218 if ( rectangular == 1 ) {
223 fprintf( stderr,
"%s line %d: %s\n", __FILE__, __LINE__,
230 if ( duration < MIN_DURATION || duration > MAX_DURATION ) {
231 fprintf( stderr,
"%s line %d: %s\n", __FILE__, __LINE__,
242 mesh.
nIn = MAX_NODES;
272 if (
stat.statusCode ) {
273 return stat.statusCode;
275 printf(
"created %d nodes\n", mesh.
nOut );
276 if ( mesh.
nOut == MAX_NODES ) {
277 printf(
"This overflowed your limit. Try a smaller search.\n" );
284 fp = fopen(
"mesh.dat",
"w" );
289 for ( node = firstNode; node; node = node->
next )
291 (
double )( ( node->
y ) * 180 / LAL_PI ), (
double )( ( node->
x ) * 180 / LAL_PI ) );
297 printf(
"destroyed %d nodes\n", mesh.
nOut );
298 if (
stat.statusCode ) {
316 y[0] = center.
longitude - sqrt( pow( radius * 1.001, 2 )
318 y[1] = center.
longitude + sqrt( pow( radius * 1.001, 2 )
373 if ( determinant < 0.0 ) {
374 printf(
"%s line %d: %s\n", __FILE__, __LINE__,
LALDetectorIndexGEO600DIFF
void getMetric(LALStatus *, meshREAL g[3], meshREAL skypos[2], void *params)
void getRange(LALStatus *, meshREAL y[2], meshREAL x, void *params)
#define GENERALMESHTESTC_EOPT
#define GENERALMESHTESTC_MSGERNG
#define GENERALMESHTESTC_MSGEMET
#define GENERALMESHTESTC_ERNG
#define GENERALMESHTESTC_EMEM
#define GENERALMESHTESTC_EFIO
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)
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.