00001 /* 00002 * Copyright (C) 2007 Thomas Essinger-Hileman, Jolien Creighton, Ian Jones, Benjamin Owen, Reinhard Prix, Karl Wette 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 /** 00021 * \author Jones, D. I. Owen, B. J. 00022 * \date 2001 -- 2006 00023 * \file 00024 * \ingroup PulsarMetric 00025 * \brief Provides routines to compute pulsar parameter-space metrics using the 00026 * ``Ptolemaic'' approximation. 00027 * 00028 * $Id: PtoleMetric.h,v 1.21 2007/11/09 18:02:57 kwwette Exp $ 00029 * 00030 * \par Description 00031 * 00032 This header covers routines for using a ``Ptolemaic'' (epicyclic) 00033 approximation to the detector motion to compute the parameter-space metric 00034 for a pulsar search. (At the moment, the search is assumed to be a single 00035 coherent integration.) The results should be very similar to those under the 00036 <tt>StackMetric.h</tt> header, and reading that documention is a good 00037 background for this documentation. 00038 00039 Why this extra header? Two words: simplicity and speed. The metric 00040 components can be expressed analytically in terms of trig functions, 00041 allowing one to get a feel for what the parameter space will look like 00042 before using a single CPU cycle. In addition, CPU usage is much reduced 00043 (compared to the routines in <tt>StackMetric.h</tt>) in numerical 00044 explorations such as testing the suitability of various tiling codes. Thus, 00045 the functions in this header can be very useful in the current stage of 00046 exploring parameter space and wondering how we can practically take 00047 advantage of correlations. It's also good at catching bugs and errors in the 00048 numerical routines under <tt>StackMetric.h</tt>. The effectiveness of the 00049 tiling at catching signals should be very little reduced by the 00050 approximation. Jones, Owen, and Whitbeck will write a short paper on this 00051 and other details. 00052 00053 * 00054 */ 00055 00056 #ifndef _PTOLEMETRIC_H 00057 #define _PTOLEMETRIC_H 00058 00059 #include <gsl/gsl_matrix.h> 00060 #include <lal/DetectorSite.h> 00061 #include <lal/LALConstants.h> 00062 #include <lal/LALStdlib.h> 00063 #include <lal/SkyCoordinates.h> 00064 #include <lal/LALBarycenter.h> 00065 00066 #ifdef __cplusplus 00067 extern "C" { 00068 #endif 00069 00070 NRCSID( PTOLEMETRICH, "$Id: PtoleMetric.h,v 1.21 2007/11/09 18:02:57 kwwette Exp $" ); 00071 00072 /** @{ \name Error conditions 00073 */ 00074 #define PTOLEMETRICH_ENULL 1 00075 #define PTOLEMETRICH_EPARM 2 00076 #define PTOLEMETRICH_EDIM 3 00077 #define PTOLEMETRICH_ENONULL 4 00078 #define PTOLEMETRICH_EMETRIC 5 00079 00080 #define PTOLEMETRICH_MSGENULL "unexpected null pointer" 00081 #define PTOLEMETRICH_MSGEPARM "bad parameter value" 00082 #define PTOLEMETRICH_MSGEDIM "bad array length" 00083 #define PTOLEMETRICH_MSGENONULL "unexpected non-null pointer" 00084 #define PTOLEMETRICH_MSGEMETRIC "unknown metric type" 00085 /* @} */ 00086 00087 /** Constants defining different types of pulsar-metrics. */ 00088 typedef enum 00089 { 00090 LAL_PMETRIC_NONE = 0, 00091 LAL_PMETRIC_COH_PTOLE_ANALYTIC, 00092 LAL_PMETRIC_COH_PTOLE_NUMERIC, 00093 LAL_PMETRIC_COH_EPHEM, 00094 LAL_PMETRIC_LAST 00095 } LALPulsarMetricType; 00096 /* </lalVerbatim> */ 00097 00098 #define PMETRIC_MIN(x,y) ((x) < (y) ? (x) : (y)) 00099 #define PMETRIC_MAX(x,y) ((x) > (y) ? (x) : (y)) 00100 00101 /** Translate metrix matrix-indices (a,b) into vector-index l */ 00102 #define PMETRIC_INDEX(a,b) (PMETRIC_MIN((a),(b))+PMETRIC_MAX((a),(b))*(PMETRIC_MAX((a),(b)) + 1 ) / 2 ) 00103 00104 00105 /** This structure will likely be changed to match up better with 00106 those under the StackMetric.h header. It contains the bare 00107 necessities, not needing function pointers etc. */ 00108 typedef struct 00109 tagPtoleMetricIn 00110 { 00111 SkyPosition position; /**< The equatorial coordinates at which the metric components are evaluated. */ 00112 REAL4Vector *spindown; /**< The (dimensionless) spindown parameters for which the metric components are evaluated. */ 00113 LIGOTimeGPS epoch; /**< When the coherent integration begins */ 00114 REAL4 duration; /**< Duration of integration, in seconds. */ 00115 REAL4 maxFreq; /**< The maximum frequency to be searched, in Hz. */ 00116 const LALDetector *site; /**< The detector site, used only for its latitude and longitude. */ 00117 const EphemerisData *ephemeris; /**< Not used for the Ptolemaic approximation, this is for compatibility with other metrics. */ 00118 LALPulsarMetricType metricType; /**< The type of metric to use: analytic, Ptolemaic or fully ephemeris-based. */ 00119 } PtoleMetricIn; 00120 00121 00122 /* ----- prototypes ----- */ 00123 void 00124 LALPtoleMetric( LALStatus *status, 00125 REAL8Vector *metric, 00126 PtoleMetricIn *input ); 00127 00128 void 00129 LALPulsarMetric( LALStatus *status, 00130 REAL8Vector **metric, 00131 PtoleMetricIn *input ); 00132 00133 int XLALFindMetricDim ( const REAL8Vector *metric ); 00134 00135 gsl_matrix *XLALSpindownMetric(UINT4, REAL8); 00136 00137 #ifdef __cplusplus 00138 } 00139 #endif 00140 00141 #endif
1.5.2