00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #if 0
00032 <lalVerbatim file="PlaygroundCV">
00033 Author: Brown D. A.
00034 $Id: Playground.c,v 1.7 2008/04/29 20:22:00 kipp Exp $
00035 </lalVerbatim>
00036
00037 <lalLaTeX>
00038 \subsection{Module \texttt{Playground.c}}
00039 \label{ss:Playground.c}
00040
00041 Determines if a given time (or segment) is playground data.
00042
00043 \subsection*{Prototypes}
00044 \vspace{0.1in}
00045 \input{PlaygroundCP}
00046 \idx{LALINT8NanoSecIsPlayground()}
00047 \idx{XLALINT8NanoSecIsPlayground()}
00048 \idx{LALGPSIsPlayground()}
00049
00050 \subsubsection*{Description}
00051
00052 This module contains two routines to determine if a given time is in the data
00053 designated as playground or not. The first routines takes input as
00054 \texttt{INT8} nanoseconds and the second as a \texttt{LIGOTimeGPS} structure.
00055 The third routine decides if some or all of a given time interval is
00056 playground or not.
00057
00058 \subsubsection*{Algorithm}
00059
00060 The playground algorithm is given in LIGO techincal document T030020-01.
00061 Briefly, $t$ is playground if
00062 \begin{equation}
00063 t - 729273613 \% 6370 < 600.
00064 \end{equation}
00065
00066 \subsubsection*{Uses}
00067
00068 \subsubsection*{Notes}
00069
00070 \vfill{\footnotesize\input{PlaygroundCV}}
00071 </lalLaTeX>
00072 #endif
00073
00074 #include <lal/LALStdlib.h>
00075 #include <lal/Date.h>
00076 #include <lal/XLALError.h>
00077
00078 NRCSID( PLAYGROUNDC, "$Id: Playground.c,v 1.7 2008/04/29 20:22:00 kipp Exp $" );
00079
00080
00081 int
00082 XLALINT8NanoSecIsPlayground (
00083 const INT8 *ns
00084 )
00085
00086 {
00087 const INT8 start = 729273613 * LAL_INT8_C(1000000000);
00088 const INT8 interval = 6370 * LAL_INT8_C(1000000000);
00089 const INT8 length = 600 * LAL_INT8_C(1000000000);
00090 int playground;
00091
00092 if ( (*ns - start) % interval < length )
00093 {
00094 playground = 1;
00095 }
00096 else
00097 {
00098 playground = 0;
00099 }
00100
00101 return( playground );
00102 }
00103
00104
00105
00106 void
00107 LALINT8NanoSecIsPlayground (
00108 LALStatus *status,
00109 INT4 *playground,
00110 INT8 *ns
00111 )
00112
00113 {
00114 INITSTATUS( status, "LALINT8NanoSecIsPlayground", PLAYGROUNDC );
00115
00116 XLALPrintDeprecationWarning("LALINT8NanoSecIsPlayground", "XLALINT8NanoSecIsPlayground");
00117 *playground = XLALINT8NanoSecIsPlayground ( ns );
00118
00119 RETURN( status );
00120 }
00121
00122
00123 void
00124 LALGPSIsPlayground (
00125 LALStatus *status,
00126 INT4 *playground,
00127 LIGOTimeGPS *gpstime
00128 )
00129
00130 {
00131 INT8 ns;
00132
00133 INITSTATUS( status, "LALINT8NanoSecIsPlayground", PLAYGROUNDC );
00134 ATTATCHSTATUSPTR( status );
00135
00136 ns = XLALGPSToINT8NS(gpstime);
00137 *playground = XLALINT8NanoSecIsPlayground(&ns);
00138
00139 DETATCHSTATUSPTR( status );
00140 RETURN( status );
00141 }