GeneralMeshTest.c

Go to the documentation of this file.
00001 /*
00002 *  Copyright (C) 2007 Jolien Creighton, Ian Jones, Benjamin Owen
00003 *
00004 *  This program is free software; you can redistribute it and/or modify
00005 *  it under the terms of the GNU General Public License as published by
00006 *  the Free Software Foundation; either version 2 of the License, or
00007 *  (at your option) any later version.
00008 *
00009 *  This program is distributed in the hope that it will be useful,
00010 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 *  GNU General Public License for more details.
00013 *
00014 *  You should have received a copy of the GNU General Public License
00015 *  along with with program; see the file COPYING. If not, write to the
00016 *  Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
00017 *  MA  02111-1307  USA
00018 */
00019 
00020 /************************************** <lalVerbatim file="GeneralMeshTestCV">
00021 Author: Jones, D. I.,   Owen, B. J.  
00022 $Id: GeneralMeshTest.c,v 1.9 2007/06/08 14:41:52 bema Exp $
00023 ********************************************************** </lalVerbatim> */
00024  
00025 /**************************************************************** <lalLaTeX>
00026  
00027 \subsection{Program \texttt{GeneralMeshTest.c}}
00028 \label{ss:GeneralMeshTest}
00029  
00030 Tests and showcases the combination of a LAL metric function (of the
00031 user's specification) and \texttt{TwoDMesh} modules by producing a
00032 template mesh.
00033  
00034 \subsubsection*{Usage}
00035 \begin{verbatim}
00036 GeneralMeshTest
00037 \end{verbatim}
00038  
00039 \subsubsection*{Description}
00040 
00041 The \texttt{-a} option determines which LAL metric code is used.  The
00042 options are: 
00043 
00044 \hspace{1cm} 1 = PtoleMetric (default), 
00045 
00046 \hspace{1cm} 2 = (CoherentMetric \& DTBaryPtolemaic), 
00047 
00048 \hspace{1cm} 3 = (CoherentMetric \& DTEphemeris).
00049 
00050 The \texttt{-b} option sets the beginning GPS time of integration to
00051 the option argument. (Default is $731265908$ seconds, chosen to lie
00052 within the S2 run).
00053 
00054 The \texttt{-c} option determins the center of the patch.  This option
00055 is hardcoded to use equatorial coordinates and the argument should be
00056 given in hh:mm:ss:dd:mm:ss format.  (Default is the center of the
00057 globular cluster 47 Tuc).
00058 
00059 The \texttt{-d} option sets the detector to the option argument. The
00060 options are: 
00061  
00062 \hspace{1cm} 1 = LIGO Hanford 
00063 
00064 \hspace{1cm} 2 = LIGO Livingston
00065 
00066 \hspace{1cm} 3 = VIRGO 
00067 
00068 \hspace{1cm} 4 = GEO600 (default)
00069 
00070 \hspace{1cm} 5 = TAMA300 
00071 
00072 The \texttt{-e} option sets the LAL debug level to 1.  (The default is 0).
00073 
00074 The \texttt{-f} option sets the maximum frequency of integration (in Hz) to the
00075 option argument. (The default value is 1000.)
00076 
00077 The \texttt{-l} option determines, for a rectangular search region, the
00078 limits in right ascension and declination of the grid.  The argument should
00079 be given in degrees as RA(min):RA(max):dec(min):dec(max).  (The default is
00080 the octant of the sky defined by $0 < {\rm RA} < 90$ and $0< {\rm dec} <
00081 85$; this avoids the coordinate singularity at the poles.) This option
00082 automatically overrides whatever is specified by the \texttt{-r} option.
00083 
00084 The \texttt{-m} option sets the maximum mismatch of the mesh to the option
00085 argument. (Default is 0.02.)
00086 
00087 The texttt{-p} option causes the coordinates of the nodes to be written to 
00088 a file \texttt{mesh.dat}, for the benifit of users who don't have 
00089 \texttt{xmgrace} installed.  The format is one node per line, (RA, DEC), 
00090 with the angles in degrees.
00091 
00092 The \texttt{-r} option sets the radius (in arcminutes) of the circular
00093 sky patch.  If you specify radius zero you will get a search over a
00094 rectangular region whose limits in RA and dec are specified by the
00095 \texttt{-l} option.  (The default value is the radius of the globular
00096 cluster 47 Tuc).
00097 
00098 The \texttt{-t} option sets the duration of integration in seconds. (The 
00099 default is $39600$ seconds $= 11$ hours, which is chosen because it is of 
00100 the right size for S2 analyses).
00101 
00102 The \texttt{-x} option makes a plot of the mesh points on the sky patch using a
00103 system call to \texttt{xmgrace}. If \texttt{xmgrace} is not installed on your
00104 system, this option will not work. The plot goes to a file \texttt{mesh.agr}.
00105 
00106 \subsubsection*{Exit Codes}
00107 ************************************************ </lalLaTeX><lalErrTable> */
00108 #define GENERALMESHTESTC_EMEM 1
00109 #define GENERALMESHTESTC_ERNG 2
00110 #define GENERALMESHTESTC_EFIO 3
00111 #define GENERALMESHTESTC_EOPT 4
00112 #define GENERALMESHTESTC_EMET 5
00113 
00114 #define GENERALMESHTESTC_MSGEMEM "memory (de)allocation error"
00115 #define GENERALMESHTESTC_MSGERNG "value out of range"
00116 #define GENERALMESHTESTC_MSGEFIO "file I/O error"
00117 #define GENERALMESHTESTC_MSGEOPT "unknown command-line option"
00118 #define GENERALMESHTESTC_MSGEMET "determinant of projected metric negative"
00119 /************************************************** </lalErrTable><lalLaTeX>
00120  
00121 \subsubsection*{Algorithm}
00122  
00123 \subsubsection*{Uses}
00124 
00125 \begin{verbatim}
00126 lalDebugLevel                LALDCreateVector()
00127 LALCheckMemoryLeaks()        LALDDestroyVector()
00128 LALProjectMetric()           LALGetEarthTimes()
00129 LALPtoleMetric()             LALInitBarycenter()
00130 LALCreateTwoDMesh()          LALDestroyTwoDMesh()
00131 LALFree()                    LALCoherentMetric()
00132 \end{verbatim}     
00133 
00134           
00135  
00136 \subsubsection*{Notes}
00137 
00138 For most regions of parameter space the three metric codes seem to
00139 agree well.  However, for short (less than one day) runs, they are all
00140 capable of returning (unphysical) negative determinant metrics for
00141 points very close to the equator.
00142 
00143 
00144 \vfill{\footnotesize\input{GeneralMeshTestCV}}
00145  
00146 ************************************************************* </lalLaTeX> */
00147 
00148 
00149 #include <math.h>
00150 #include <stdio.h>
00151 #include <lal/AVFactories.h>
00152 #include <lal/LALXMGRInterface.h>
00153 #include <lal/PtoleMetric.h>
00154 #include <lal/StackMetric.h>
00155 #include <lal/TwoDMesh.h>
00156 #include <lal/LALBarycenter.h>
00157 
00158 
00159 
00160 NRCSID( GENERALMESHTESTC, "$Id: GeneralMeshTest.c,v 1.9 2007/06/08 14:41:52 bema Exp $" );
00161 
00162 #define MIN_DURATION (86400./LAL_TWOPI) /* one radian of rotation */
00163 #define MAX_DURATION (3.16e7)           /* one year; arbitrary */
00164 #define MIN_FREQ     1e2                /* more or less arbitrary */
00165 #define MAX_FREQ     1e4                /* more or less arbitrary */
00166 #define MAX_NODES    1e6                /* keep idiot users safe */
00167 
00168 /* IAN: Clumsy way of specifying rectangular search region if */
00169 /* the r=0 option is invoked.                                 */
00170 REAL4 ra_min;      
00171 REAL4 ra_max;     
00172 REAL4 dec_min;      
00173 REAL4 dec_max;      
00174 
00175 
00176 char *optarg = NULL;     /* option argument for getopt() */
00177 int  lalDebugLevel = 0;  /* default value */
00178 int  metric_code;        /* Which metric code to use: */
00179                          /* 1 = Ptolemetric */
00180                          /* 2 = CoherentMetric + DTBarycenter */
00181                          /* 3 = CoherentMetric + DTEphemeris  */
00182 
00183 
00184 
00185 void getRange( LALStatus *, REAL4 [2], REAL4, void * );
00186 void getMetric( LALStatus *, REAL4 [3], REAL4 [2], void * );
00187 
00188 /* BEN: This is a cheat. Should make a search area structure. */
00189 static SkyPosition center;  /* center of search */
00190 REAL4              radius;  /* radius of search, in arcminutes */
00191 
00192 REAL8Vector *tevlambda;   /* (f, a, d) input for CoherentMetric */
00193                           /* I've made it global so getMetric can see it */ 
00194                              
00195 int main( int argc, char **argv )
00196 {
00197   static LALStatus     stat;      /* status structure */
00198   INT2                 opt;       /* command-line option character */
00199   BOOLEAN              errors;    /* whether or not to showcase error traps */
00200   BOOLEAN              grace;     /* whether or not to graph using xmgrace */
00201   BOOLEAN              nonGrace;  /* whether or not to write to data file */
00202   TwoDMeshNode        *firstNode; /* head of linked list of nodes in mesh */
00203   static TwoDMeshParamStruc mesh; /* mesh parameters */
00204   static PtoleMetricIn search;    /* more mesh parameters */
00205   REAL4                mismatch;  /* mismatch threshold of mesh */
00206   int                  begin;     /* start time of integration (seconds) */
00207   REAL4                duration;  /* duration of integration (seconds) */
00208   REAL4                fMax;      /* maximum frequency of search */
00209   FILE                *fp;        /* where to write a plot */
00210   static MetricParamStruc tevparam;  /* Input structure for CoherentMetric */
00211   PulsarTimesParamStruc tevpulse; /* Input structure for CoherentMetric */
00212                                   /* (this is a member of tevparam) */
00213   EphemerisData       *eph;       /* To store ephemeris data */
00214   int                  detector;  /* Which detector to use: */
00215                                   /* 1 = Hanford,  2 = Livingston,  */
00216                                   /* 3 = Virgo,  4 = GEO,  5 = TAMA */
00217   float a, b, c, d, e, f;         /* To specify center of search region */
00218   BOOLEAN rectangular;            /* is the search region rectangular? */
00219   char earth[] = "earth00-04.dat";
00220   char sun[] = "sun00-04.dat";
00221   
00222   
00223   /* Set default values. */
00224   metric_code = 1;
00225   errors = 0; /* BEN: this is unused right now */
00226   grace = 0;
00227   nonGrace = 0;
00228   begin = 731265908;
00229   duration = 1e5;
00230   fMax = 1e3;
00231   mismatch = .02;
00232   /* This is (roughly) the center of globular cluster 47 Tuc. */
00233   center.system = COORDINATESYSTEM_EQUATORIAL;
00234   center.longitude = (24.1/60)*LAL_PI_180;
00235   center.latitude = -(72+5./60)*LAL_PI_180;
00236   radius = 24.0/60*LAL_PI_180;
00237   detector = 4;
00238   ra_min = 0.0;
00239   ra_max = LAL_PI_2;
00240   dec_min = 0.0;
00241   dec_max = LAL_PI_2;
00242   rectangular = 0;
00243 
00244   /* Parse and sanity-check the command-line options. */
00245   while( (opt = getopt( argc, argv, "a:b:c:d:ef:l:m:pr:t:x" )) != -1 )
00246   {
00247     switch( opt )
00248     {
00249     case '?':
00250       return GENERALMESHTESTC_EOPT;
00251     case 'a':
00252       metric_code = atoi( optarg );
00253       break;
00254     case 'b':
00255       begin = atoi( optarg );
00256       break;
00257     case 'c':
00258       if( sscanf( optarg, "%f:%f:%f:%f:%f:%f", &a, &b, &c, &d, &e, &f ) != 6)
00259       {
00260         fprintf( stderr, "coordinates should be hh:mm:ss:dd:mm:ss\n" );
00261         return GENERALMESHTESTC_EOPT;
00262       }
00263       center.longitude = (15*a+b/4+c/240)*LAL_PI_180;
00264       center.latitude = (d+e/60+f/3600)*LAL_PI_180;
00265       break;
00266     case 'd':
00267       detector = atoi( optarg );
00268       break;
00269     case 'e':
00270       lalDebugLevel = 1;
00271       break;
00272     case 'f':
00273       fMax = atof( optarg );
00274       break;
00275     case 'l':
00276       if( sscanf( optarg, "%f:%f:%f:%f", 
00277                   &ra_min, &ra_max, &dec_min, &dec_max) != 4)
00278         {
00279           fprintf( stderr, "coordinates should be ra_min, ra_max, dec_min, dec_max, all in degrees\n" );
00280           return GENERALMESHTESTC_EOPT;
00281         }
00282       ra_min  *= LAL_PI_180;
00283       ra_max  *= LAL_PI_180;
00284       dec_min *= LAL_PI_180;
00285       dec_max *= LAL_PI_180;
00286       rectangular = 1;
00287       radius = 0;
00288       break;
00289     case 'm':
00290       mismatch = atof( optarg );
00291       break;
00292     case 'p':
00293       nonGrace = 1;
00294       break;
00295     case 'r':
00296       if( rectangular == 1 )
00297         break;
00298       radius = LAL_PI_180/60*atof( optarg );
00299       if( radius < 0 ) {
00300         fprintf( stderr, "%s line %d: %s\n", __FILE__, __LINE__,
00301                  GENERALMESHTESTC_MSGERNG );
00302         return GENERALMESHTESTC_ERNG;
00303       }
00304       break;
00305     case 't':
00306       duration = atof( optarg );
00307       if( duration < MIN_DURATION || duration > MAX_DURATION ) {
00308         fprintf( stderr, "%s line %d: %s\n", __FILE__, __LINE__,
00309                  GENERALMESHTESTC_MSGERNG );
00310         return GENERALMESHTESTC_ERNG;
00311       }
00312       break;
00313     case 'x':
00314       grace = 1;
00315       break;
00316     } /* switch( opt ) */
00317   } /* while( getopt... ) */
00318 
00319 
00320   /* Set the mesh input parameters. */
00321   mesh.mThresh = mismatch;
00322   mesh.nIn = MAX_NODES;
00323   mesh.getRange = getRange;
00324   mesh.getMetric = getMetric;
00325   if(metric_code==1)
00326     mesh.metricParams = (void *) &search;
00327   if(metric_code==2 || metric_code==3)
00328     mesh.metricParams = (void *) &tevparam;
00329   if( radius == 0 ) 
00330     {
00331       mesh.domain[0] = dec_min;
00332       mesh.domain[1] = dec_max;
00333       /* I don't understand this line*/
00334       if(metric_code==1)
00335         mesh.rangeParams = (void *) &search;
00336       if(metric_code==2 || metric_code==3)
00337         {
00338           mesh.rangeParams = (void *) &tevparam;
00339         }
00340     }
00341   else 
00342     {
00343       mesh.domain[0] = center.latitude - radius;
00344       mesh.domain[1] = center.latitude + radius;
00345       mesh.rangeParams = NULL;
00346     }
00347 
00348 
00349   /* Set detector location */
00350   if(detector==1)
00351     tevpulse.site = &lalCachedDetectors[LALDetectorIndexLHODIFF];
00352   if(detector==2)
00353     tevpulse.site = &lalCachedDetectors[LALDetectorIndexLLODIFF];
00354   if(detector==3)
00355     tevpulse.site = &lalCachedDetectors[LALDetectorIndexVIRGODIFF];
00356   if(detector==4)
00357     tevpulse.site = &lalCachedDetectors[LALDetectorIndexGEO600DIFF];
00358   if(detector==5)
00359     tevpulse.site = &lalCachedDetectors[LALDetectorIndexTAMA300DIFF];
00360 
00361   search.site = tevpulse.site;
00362   tevpulse.latitude = search.site->frDetector.vertexLatitudeRadians;
00363   tevpulse.longitude = search.site->frDetector.vertexLongitudeRadians;
00364 
00365 
00366   /* Ptolemetric constants */
00367   search.position.system = COORDINATESYSTEM_EQUATORIAL;
00368   search.spindown = NULL;
00369   search.epoch.gpsSeconds = begin;
00370   search.epoch.gpsNanoSeconds = 0;
00371   search.duration = duration;
00372   search.maxFreq = fMax;
00373 
00374 
00375   /* CoherentMetric constants */
00376   tevlambda = NULL;
00377   LALDCreateVector( &stat, &tevlambda, 3 );
00378   tevlambda->data[0] = fMax;
00379   tevparam.constants = &tevpulse;
00380   tevparam.n = 1;
00381   tevparam.errors = 0;
00382   tevparam.start = 0; /* start time relative to epoch */
00383   tevpulse.t0 = 0.0;  /* Irrelavant */
00384   tevpulse.epoch.gpsSeconds = begin;
00385   tevpulse.epoch.gpsNanoSeconds = 0;
00386   tevparam.deltaT = duration;
00387 
00388 
00389   /* To fill in the fields tevpulse.tMidnight & tevpulse.tAutumn */
00390   LALGetEarthTimes( &stat, &tevpulse );
00391 
00392   /* Read in ephemeris data from files: */
00393   eph = (EphemerisData *)LALMalloc(sizeof(EphemerisData));
00394   eph->ephiles.earthEphemeris = earth;
00395   eph->ephiles.sunEphemeris = sun;
00396   eph->leap = 13; /* OK for 2000-2004 */
00397  
00398 
00399   LALInitBarycenter( &stat, eph );
00400   
00401   tevpulse.ephemeris = eph;
00402  
00403   /* Choose CoherentMetric timing function */
00404   if(metric_code==1)
00405     {
00406       printf("Using PtoleMetric()\n");
00407     }
00408   if(metric_code==2)
00409     {
00410       printf("Using CoherentMetric() with the BTBaryPtolemaic timing function\n");
00411       tevparam.dtCanon = LALDTBaryPtolemaic;
00412     }
00413   if(metric_code==3)
00414     {
00415       printf("Using CoherentMetric() with the DTEphemeris timing function\n");
00416       tevparam.dtCanon = LALDTEphemeris;
00417     }
00418 
00419 
00420   /* Create mesh */
00421   firstNode = NULL;
00422   LALCreateTwoDMesh( &stat, &firstNode, &mesh );
00423   if( stat.statusCode )
00424     return stat.statusCode;
00425   printf( "created %d nodes\n", mesh.nOut );
00426   if( mesh.nOut == MAX_NODES )
00427     printf( "This overflowed your limit. Try a smaller search.\n" );
00428 
00429 
00430   /* Create xmgrace plot, if required */
00431   if(grace)
00432     {
00433       TwoDMeshNode *node;
00434       fp = popen( "xmgrace -pipe", "w" );
00435       if( !fp )
00436         return GENERALMESHTESTC_EFIO;
00437       fprintf( fp, "@xaxis label \"Right ascension (degrees)\"\n" );
00438       fprintf( fp, "@yaxis label \"Declination (degrees)\"\n" );
00439       fprintf( fp, "@s0 line type 0\n");
00440       fprintf( fp, "@s0 symbol 8\n");
00441       fprintf( fp, "@s0 symbol size 0.300000\n");
00442       for( node = firstNode; node; node = node->next )
00443       fprintf( fp, "%e %e\n", 
00444                (double)((node->y)*180/LAL_PI), (double)((node->x)*180/LAL_PI));
00445       fclose( fp );
00446     }
00447 
00448 
00449   /* Write what we've got to file mesh.dat, if required */
00450   if( nonGrace )
00451   {
00452     TwoDMeshNode *node;
00453     fp = fopen( "mesh.dat", "w" );
00454     if( !fp )
00455       return GENERALMESHTESTC_EFIO;
00456 
00457     for( node = firstNode; node; node = node->next )
00458       fprintf( fp, "%e %e\n", 
00459                (double)((node->y)*180/LAL_PI), (double)((node->x)*180/LAL_PI));
00460     fclose( fp );
00461   }
00462 
00463   /* Clean up and leave. */
00464   LALDestroyTwoDMesh( &stat, &firstNode, &mesh.nOut );
00465   printf( "destroyed %d nodes\n", mesh.nOut );
00466   if( stat.statusCode )
00467     return GENERALMESHTESTC_EMEM;
00468 
00469   LALDDestroyVector( &stat, &tevlambda );
00470 
00471   LALFree( eph->ephemE );
00472   if( stat.statusCode )
00473   {
00474     printf( "%s line %d: %s\n", __FILE__, __LINE__,
00475             GENERALMESHTESTC_MSGEMEM );
00476     return GENERALMESHTESTC_EMEM;
00477   }
00478   LALFree( eph->ephemS );
00479   if( stat.statusCode )
00480   {
00481     printf( "%s line %d: %s\n", __FILE__, __LINE__,
00482             GENERALMESHTESTC_MSGEMEM );
00483     return GENERALMESHTESTC_EMEM;
00484   }
00485   LALFree( eph );
00486  if( stat.statusCode )
00487   {
00488     printf( "%s line %d: %s\n", __FILE__, __LINE__,
00489             GENERALMESHTESTC_MSGEMEM );
00490     return GENERALMESHTESTC_EMEM;
00491   }
00492 
00493 
00494   LALCheckMemoryLeaks();
00495   return 0;
00496 } /* main() */
00497 
00498 
00499 /* This is the parameter range function as required by TwoDMesh. */
00500 
00501 void getRange( LALStatus *stat, REAL4 y[2], REAL4 x, void *unused )
00502 {
00503   /* Set up shop. */
00504   INITSTATUS( stat, "getRange", GENERALMESHTESTC );
00505   ATTATCHSTATUSPTR( stat );
00506   
00507   /* Search a circle. BEN: The 1.001 is a kludge. */
00508   y[0] = center.longitude - sqrt( pow( radius*1.001, 2 )
00509                                   - pow( x-center.latitude, 2 ) );
00510   y[1] = center.longitude + sqrt( pow( radius*1.001, 2 )
00511                                   - pow( x-center.latitude, 2 ) );
00512     
00513   if( unused ) 
00514     {
00515       y[0] = ra_min;
00516       y[1] = ra_max;
00517     }
00518 
00519   /*
00520   printf("x = %le,  y[0] = %le,  y[1] = %le\n", (double)x, (double)y[0],
00521          (double)y[1]);
00522   */
00523 
00524   /* Clean up and leave. */
00525   DETATCHSTATUSPTR( stat );
00526   RETURN( stat );
00527 } /* getRange() */
00528 
00529 
00530 /* This is the wrapped metric function as required by TwoDMesh. */
00531 
00532 void getMetric( LALStatus *stat,
00533                 REAL4 g[3],
00534                 REAL4 x[2],
00535                 void *params )
00536 {
00537 
00538   REAL8Vector      *metric = NULL;   /* for output of metric */
00539   PtoleMetricIn    *Ppatch = NULL;   /* pointer for PtoleMetric params */
00540   MetricParamStruc *Cpatch = NULL;   /* pointer for CoherentMetric params */
00541   REAL8             determinant;     /* Determinant of projected metric */
00542 
00543 
00544   if(metric_code==1)
00545     Ppatch = params;
00546   
00547   if(metric_code==2 || metric_code==3)
00548     Cpatch = params;
00549   
00550 
00551   /* Set up shop. */
00552   INITSTATUS( stat, "getMetric", GENERALMESHTESTC );
00553   ATTATCHSTATUSPTR( stat );
00554   TRY( LALDCreateVector( stat->statusPtr, &metric, 6 ), stat );
00555   
00556   /* Translate input. */
00557   if(metric_code==1)
00558     {
00559       Ppatch->position.longitude = x[1];
00560       Ppatch->position.latitude =  x[0];
00561     }
00562   
00563   if(metric_code==2 || metric_code==3)
00564     {
00565       tevlambda->data[1] = x[1];
00566       tevlambda->data[2] = x[0];
00567     }
00568   
00569 
00570   /* Call the real metric function. */
00571   if(metric_code==1)
00572     LALPtoleMetric( stat->statusPtr, metric, Ppatch );
00573   if(metric_code==2 || metric_code==3)
00574      LALCoherentMetric( stat->statusPtr, metric, tevlambda, Cpatch );
00575 
00576   BEGINFAIL( stat )
00577     TRY( LALDDestroyVector( stat->statusPtr, &metric ), stat );
00578   ENDFAIL( stat );
00579   LALProjectMetric( stat->statusPtr, metric, 0 );
00580   BEGINFAIL( stat )
00581     TRY( LALDDestroyVector( stat->statusPtr, &metric ), stat );
00582   ENDFAIL( stat );
00583 
00584   determinant = metric->data[5]*metric->data[2]-pow(metric->data[4],2.0);
00585   if(determinant < 0.0)
00586     {
00587       printf( "%s line %d: %s\n", __FILE__, __LINE__,
00588               GENERALMESHTESTC_MSGEMET );
00589       return;
00590     }
00591 
00592 
00593 
00594   /* Translate output. */
00595   g[1] = metric->data[2];
00596   g[0] = metric->data[5];
00597   g[2] = metric->data[4];
00598  
00599   
00600   /* Clean up and leave. */
00601   TRY( LALDDestroyVector( stat->statusPtr, &metric ), stat );
00602   DETATCHSTATUSPTR( stat );
00603   RETURN( stat );
00604   
00605 
00606 } /* getMetric() */

Generated on Tue Oct 7 02:39:46 2008 for LAL by  doxygen 1.5.2