FoldAmplitudes.h

Go to the documentation of this file.
00001 /*
00002 *  Copyright (C) 2007 Jolien Creighton
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="FoldAmplitudesHV">
00021 Author: Mendell, Greg A.
00022 $Id: FoldAmplitudes.h,v 1.3 2007/06/08 14:41:50 bema Exp $
00023 ********************************** </lalVerbatim> */
00024 
00025 /********************************* <lalLaTeX>
00026 
00027 \section{Header \texttt{FoldAmplitudes.h}}
00028 
00029 \subsection*{Synopsis}
00030 
00031 \begin{verbatim}
00032 #include <lal/FoldAmplitudes.h>
00033 \end{verbatim}
00034 
00035 \noindent Contains prototypes for:
00036 
00037 \noindent struct FoldAmplitudesInput
00038 
00039 \noindent struct FoldAmplitudesParams
00040 
00041 \noindent function LALFoldAmplitudes
00042 
00043 %[Generic documentation on the header; this is the main place to
00044 %document any stuff not specific to the module]
00045 
00046 \subsection*{Error conditions}
00047 \input{FoldAmplitudesHE}
00048 
00049 \subsection*{Structures}
00050 
00051 %[Document here any structures defined in the header.
00052 %Also include any of them in the index; e.g.:]
00053 \begin{verbatim}
00054 
00055 typedef struct tagFoldAmplitudesInput
00056 {
00057 
00058   REAL4Vector   *amplitudeVec;  input vector of amplitudes
00059   REAL4Vector   *phaseVec;      input vector of phases
00060 
00061 } FoldAmplitudesInput;
00062 
00063 typedef struct tagFoldAmplitudesParams
00064 {
00065 
00066   INT4          numBins;      number of bins
00067   REAL4         binMin;       minimum phase to bin
00068   REAL4         binMax;       maximum phase to bin
00069 
00070 } FoldAmplitudesParams;
00071 
00072 \end{verbatim}
00073 
00074 \idx[Type]{FoldAmplitudesInput}
00075 \idx[Type]{FoldAmplitudesParams}
00076 
00077 \vfill{\footnotesize\input{FoldAmplitudesHV}}
00078 \newpage\input{FoldAmplitudesC}
00079 \newpage\input{FoldAmplitudesTestC}
00080 
00081 ********************************** </lalLaTeX> */
00082 
00083 #ifndef _FOLDAMPLITUDES_H
00084 #define _FOLDAMPLITUDES_H
00085 
00086 #include <lal/LALStdlib.h>
00087 /******* INCLUDE ANY OTHER LAL HEADERS needed for header (NOT module) ****/
00088 
00089 #ifdef  __cplusplus
00090 extern "C" {
00091 #endif
00092 
00093 NRCSID (FOLDAMPLITUDESH, "$Id: FoldAmplitudes.h,v 1.3 2007/06/08 14:41:50 bema Exp $");
00094 
00095 /******************************** <lalErrTable file="FoldAmplitudesHE"> */
00096 
00097 #define FOLDAMPLITUDESH_ENULLP          1
00098 #define FOLDAMPLITUDESH_EVECSIZE        2
00099 #define FOLDAMPLITUDESH_ENUMBINS        3
00100 #define FOLDAMPLITUDESH_EBINSIZE        4
00101 #define FOLDAMPLITUDESH_EBINMIN         5
00102 
00103 #define FOLDAMPLITUDESH_MSGENULLP       "Null pointer!"
00104 #define FOLDAMPLITUDESH_MSGEVECSIZE     "Input vectors were not the same length!"
00105 #define FOLDAMPLITUDESH_MSGENUMBINS     "Number of bins was less than 1!"
00106 #define FOLDAMPLITUDESH_MSGEBINSIZE     "Bin max was less than bin min!"
00107 #define FOLDAMPLITUDESH_MSGEBINMIN      "Bin min was not zero; nonzero bin min has not yet been implemented!"
00108 
00109 /************************************ </lalErrTable> */
00110 
00111 /****** DEFINE OTHER GLOBAL CONSTANTS OR MACROS ************/
00112 
00113 /****** DEFINE NEW STRUCTURES AND TYPES ************/
00114 
00115 typedef struct tagFoldAmplitudesInput
00116 {
00117 
00118   REAL4Vector   *amplitudeVec;  /* input vector of amplitudes */
00119   REAL4Vector   *phaseVec;      /* input vector of phases */
00120 
00121 } FoldAmplitudesInput;
00122 
00123 typedef struct tagFoldAmplitudesParams
00124 {
00125 
00126   INT4          numBins;       /* number of bins */
00127   REAL4         binMin;        /* minimum phase to bin */
00128   REAL4         binMax;        /* maximum phase to bin */
00129 
00130 } FoldAmplitudesParams;
00131 
00132 /****** INCLUDE EXTERNAL GLOBAL VARIABLES ************/
00133 
00134 /*
00135 LALFoldAmplitudes:
00136 inputs: a vector of amplitudes and a vector of phases.
00137 params: number of phase bins,  the minimum phase to bin, and the maximum phase to bin.
00138 action: for each phase, the phase is first reduced by modulo arithmetic to a value
00139         between binMin and binMax.  The corresponding amplitudes is then added to
00140         the corresponding phase bins.  The width of each bin is (binMax - binMin)/numBins.
00141 output: a vector of folded amplitudes; component i is the folded amplitude for phase bin i.
00142 */
00143 
00144 void
00145 LALFoldAmplitudes( LALStatus                      *status,
00146                      REAL4Vector                  *output,
00147                      const FoldAmplitudesInput    *input,
00148                      const FoldAmplitudesParams   *params );
00149 
00150 #ifdef  __cplusplus
00151 }
00152 #endif
00153 
00154 #endif /* _FOLDAMPLITUDES_H */

Generated on Sun Sep 7 03:06:41 2008 for LAL by  doxygen 1.5.2