00001 /* 00002 * Copyright (C) 2007 Bruce Allen, Jolien Creighton, Tania Regimbau 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 00022 /* 00023 <lalVerbatim file="SimulatePopcornHV"> 00024 Author: Tania Regimbau 00025 $Id: SimulatePopcorn.h,v 1.12 2007/06/08 14:41:47 bema Exp $ 00026 </lalVerbatim> 00027 00028 <lalLaTeX> 00029 \section{Header \texttt{SimulatePopcorn.h}} 00030 \label{s:SimulatePopcorn.h} 00031 00032 Provides prototype for simulating whitened time-domain signals in a pair 00033 of detectors that arises from low duty cycle astrophysical backgrounds. 00034 00035 \subsection*{Synopsis} 00036 \begin{verbatim} 00037 #include <lal/SimulatePopcorn.h> 00038 \end{verbatim} 00039 00040 </lalLaTeX> 00041 */ 00042 00043 00044 #ifndef _SIMULATEPOPCOR_H 00045 #define _SIMULATEPOPCOR_H 00046 00047 00048 #include <stdio.h> 00049 #include <math.h> 00050 #include <string.h> 00051 #include <time.h> 00052 #include <lal/LALStdlib.h> 00053 #include <lal/LALConstants.h> 00054 #include <lal/StochasticCrossCorrelation.h> 00055 #include <lal/AVFactories.h> 00056 #include <lal/RealFFT.h> 00057 #include <lal/ComplexFFT.h> 00058 #include <lal/Units.h> 00059 #include <lal/Random.h> 00060 #include <lal/DetectorSite.h> 00061 00062 00063 #ifdef __cplusplus 00064 extern "C" { 00065 #endif 00066 00067 NRCSID (SIMULATEPOPCORNH, "$Id: SimulatePopcorn.h,v 1.12 2007/06/08 14:41:47 bema Exp $"); 00068 /* 00069 <lalLaTeX> 00070 \subsection*{Error conditions} 00071 \input{SimulatePopcornHErrTab} 00072 </lalLaTeX> 00073 */ 00074 /* 00075 <lalErrTable file="SimulatePopcornHErrTab"> 00076 */ 00077 00078 #define SIMULATEPOPCORNH_ENULLP 1 00079 #define SIMULATEPOPCORNH_ENONNULLFMIN 2 00080 #define SIMULATEPOPCORNH_EMMDELTA 3 00081 #define SIMULATEPOPCORNH_EMMLEN 4 00082 #define SIMULATEPOPCORNH_EBV 5 00083 00084 00085 #define SIMULATEPOPCORNH_MSGENULLP "Null pointer" 00086 #define SIMULATEPOPCORNH_MSGENONNULLFMIN "Non zero start frequency" 00087 #define SIMULATEPOPCORNH_MSGEMMDELTA "Mismatch in sequence spacings" 00088 #define SIMULATEPOPCORNH_MSGEMMLEN "Mismatch in sequence lengths" 00089 #define SIMULATEPOPCORNH_MSGEBV "Bad input or parameter" 00090 00091 /*</lalErrTable> */ 00092 /*<lalLaTeX> 00093 \subsection*{Structures} 00094 These constants define the cosmological model 00095 \begin{verbatim}*/ 00096 #define SIMULATEPOPCORN_ho 0.7 00097 #define SIMULATEPOPCORN_OMEGAMATTER 0.3 00098 #define SIMULATEPOPCORN_OMEGAVACUUM 0.7 00099 /*\end{verbatim}*/ 00100 /*</lalLaTeX>*/ 00101 /*<lalLaTeX> 00102 \subsection*{Structures} 00103 These are function pointers to functions that model burst waveforms. 00104 00105 \begin{verbatim}*/ 00106 typedef void (REAL4LALWform) (REAL4 *output, REAL4 input); 00107 /*\end{verbatim}*/ 00108 /*</lalLaTeX>*/ 00109 00110 /*<lalLaTeX> 00111 The following structure contains the input of the simulation. 00112 \begin{verbatim}*/ 00113 typedef struct tagSimPopcornInputStruc { 00114 REAL4LALWform *inputwform; /*waveform of a single burst*/ 00115 REAL4 inputduration; /*mean duration of a single burst*/ 00116 REAL4 inputlambda; /*mean tims interval between successive bursts*/ 00117 UINT4 inputNdataset; /*number of detector sites 1 for H1/H2, 2 for H/L*/ 00118 INT2 inputsite0; /*first detector code*/ 00119 INT2 inputsite1; /*second detector code*/ 00120 COMPLEX8FrequencySeries *wfilter0; /*response of the first detector*/ 00121 COMPLEX8FrequencySeries *wfilter1; /*response of the second detector*/ 00122 } SimPopcornInputStruc; 00123 /*\end{verbatim}*/ 00124 /*</lalLaTeX>*/ 00125 /*<lalLaTeX> 00126 00127 The following structure contains the parameters of the simulation. 00128 \begin{verbatim}*/ 00129 typedef struct tagSimPopcornParamsStruc { 00130 UINT4 paramsstarttime; /*starting time*/ 00131 UINT4 paramslength; /*length of the time serie in s*/ 00132 UINT4 paramssrate; /*sampling rate of the time serie in Hz*/ 00133 UINT4 paramsseed; /*random generator seed*/ 00134 REAL8 paramsfref; /*reference frequency if normalization, -1 otherwise*/ 00135 } SimPopcornParamsStruc; 00136 /*\end{verbatim}*/ 00137 /*</lalLaTeX>*/ 00138 /*<lalLaTeX> 00139 00140 The following structure contains the simulated pair time series and $\Omega$ spectrum 00141 \begin{verbatim}*/ 00142 typedef struct tagSimPopcornOutputStruc { 00143 REAL4TimeSeries *SimPopcorn0; 00144 REAL4TimeSeries *SimPopcorn1; 00145 REAL4FrequencySeries *omega0; 00146 REAL4FrequencySeries *omega1; 00147 } SimPopcornOutputStruc; 00148 /*\end{verbatim}*/ 00149 /*</lalLaTeX>*/ 00150 00151 void 00152 LALSimPopcornTimeSeries (LALStatus *status,SimPopcornOutputStruc *output, 00153 SimPopcornInputStruc *input,SimPopcornParamsStruc *params); 00154 #ifdef __cplusplus 00155 } 00156 #endif 00157 #endif
1.5.2