SideBand.h

Go to the documentation of this file.
00001 /*
00002 *  Copyright (C) 2007 Chris Messenger
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 #ifndef _SIDEBAND_H
00021 #define _SIDEBAND_H
00022 
00023 #include <lal/LALDatatypes.h>
00024 #include <lal/DetectorSite.h>
00025 #include <lal/LALBarycenter.h>
00026 #include <lal/LALDemod.h>
00027 #include <lal/Date.h>
00028 
00029 /* C++ protection. */
00030 #ifdef  __cplusplus
00031 extern "C" {
00032 #endif
00033  
00034 #define NPARAMS 9
00035 #define NPARAMS_IL 3
00036 
00037   /** A structure designed to store all the information required to describe a binary orbit 
00038    */
00039   typedef struct {
00040     REAL8 OrbitalSemiMajorAxis; /**< */
00041     REAL8 OrbitalPeriod;
00042     REAL8 OrbitalEccentricity;
00043     REAL8 ArgumentofPeriapse;
00044     LIGOTimeGPS TimeofSSBPeriapsePassage;
00045     REAL8 alpha;
00046     REAL8 delta;
00047     REAL8 f0;
00048     REAL8 phi0;
00049     REAL8 psi;
00050     REAL8 cosi;
00051     REAL8 h0;
00052   } BinarySourceParams;
00053   
00054   /** A structure for storing ABCcoeffients */
00055   typedef struct {
00056     REAL8 omega0;
00057     REAL8 aco[3];
00058     REAL8 bco[3];
00059     REAL8 uco[5];
00060     REAL8 vco[5];
00061     REAL8 wco[5];
00062     REAL8 apco[3];
00063     REAL8 bpco[3];
00064     REAL8 upco[5];
00065     REAL8 vpco[5];
00066     REAL8 wpco[5];
00067   } ABCcoefficients;
00068   
00069   /** A structure designed to store general input template parameters */
00070   typedef struct {
00071     INT4 Mmax;
00072     INT4 Mmin;
00073     LIGOTimeGPS tstartSSB;
00074     LIGOTimeGPS tstart;
00075     LIGOTimeGPS reftime;
00076     ABCcoefficients *ABCco;
00077     REAL8 T;
00078     REAL8 Tobs;
00079     REAL8 sqrtSh;
00080     REAL8 alpha;
00081     REAL8 delta;
00082     REAL8 w0;
00083     REAL8Vector *freqsamples;
00084     BOOLEAN local;
00085     INT4 pmax;
00086     COMPLEX16Vector *wa;
00087     COMPLEX16Vector *wb;
00088     REAL8 dfwindow;
00089     INT4 windowrange;
00090     INT4Vector *timestamps;
00091     INT4Vector *gapvectorstart;
00092     INT4Vector *gapvectorend;
00093     INT4 mmin;
00094     INT4 mmax;
00095     INT4 nsft;
00096   } SideBandTemplateParams;
00097   
00098   /** A structure for storing a frequency domain signal template */
00099   typedef struct {
00100     REAL8 minfreq;
00101     REAL8 deltaf;
00102     UINT4 length;
00103     LIGOTimeGPS epoch;
00104     COMPLEX16Vector *fourier;
00105   } SideBandTemplate;
00106 
00107  
00108   /** A structure for storing ABCcoeffient parameters */
00109   typedef struct {
00110     LIGOTimeGPS tstart;
00111     REAL8 alpha;
00112     REAL8 delta;
00113   } ABCcoParams;
00114 
00115   /** A structure for storing an MCMC signal parameter vector */
00116   typedef struct {
00117     REAL8 f0;
00118     REAL8 period;
00119     REAL8 a;
00120     LIGOTimeGPS tp;
00121     REAL8 argp;
00122     REAL8 e;
00123     REAL8 psi;
00124     REAL8 cosi;
00125     REAL8 phi0;
00126     REAL8 h0;
00127     REAL8 logL;
00128     REAL8 logWt;
00129     BOOLEAN accepted;
00130   } SideBandMCMCVector;
00131 
00132   /** A structure for storing a fourier dataset  */
00133   typedef struct {
00134     COMPLEX16Vector *fourier;
00135     REAL8Vector *freq;
00136   } SideBandDataSet;
00137 
00138   /** A structure for storing the MCMCM parameter ranges  */
00139   typedef struct {
00140     REAL8 f0min;
00141     REAL8 f0max;
00142     REAL8 periodmin;
00143     REAL8 periodmax;
00144     REAL8 amin;
00145     REAL8 amax;
00146     LIGOTimeGPS tpmin;
00147     LIGOTimeGPS tpmax;
00148     REAL8 argpmin;
00149     REAL8 argpmax;
00150     REAL8 emin;
00151     REAL8 emax;
00152     REAL8 h0min;
00153     REAL8 h0max;
00154     REAL8 psimin;
00155     REAL8 psimax;
00156     REAL8 cosimin;
00157     REAL8 cosimax;
00158     REAL8 phi0min;
00159     REAL8 phi0max;
00160   } SideBandMCMCRanges;
00161 
00162   /** A structure for storing the MCMCM parameter jump sizes  */
00163   typedef struct {
00164     REAL8 jump[3];
00165     REAL8 prob[3];
00166   } SideBandMCMCJumpProb;
00167 
00168   /** A structure for storing the MCMCM parameter jump sizes  */
00169   typedef struct {
00170     SideBandMCMCJumpProb f0;
00171     SideBandMCMCJumpProb period;
00172     SideBandMCMCJumpProb a;
00173     SideBandMCMCJumpProb x;
00174     SideBandMCMCJumpProb y;
00175     SideBandMCMCJumpProb e;
00176     SideBandMCMCJumpProb h0;
00177     SideBandMCMCJumpProb psi;
00178     SideBandMCMCJumpProb cosi;
00179     SideBandMCMCJumpProb phi0;
00180   } SideBandMCMCJumpProbs;
00181   
00182 
00183 
00184   /* A structure to store parameters required for selecting frequencies for use in the MCMC */
00185   typedef struct {
00186     SideBandMCMCRanges ranges;
00187     INT4 mmax;
00188     INT4 mmin;
00189     REAL8Vector *minf;
00190     REAL8Vector *maxf;
00191     BOOLEAN am;
00192     REAL8 df;
00193   } SelectSideBandFrequencyParams;
00194 
00195   /* A structure to store parameters required for reading fourier data */
00196   typedef struct {
00197     CHAR file[256];
00198     REAL8 minf;
00199     REAL8 maxf;
00200     REAL8 Tobs;
00201     REAL8 df;
00202     INT4 nsft;
00203   } ReadSideBandDataParams;
00204 
00205   /* A structure to store parameters required for reading fourier data */
00206   typedef struct {
00207     REAL8 minfreq;
00208     REAL8 maxfreq;
00209     REAL8Vector *minf;
00210     REAL8Vector *maxf;
00211     INT4 Nthresh;
00212     REAL8 sqrtSh;
00213     REAL8 safedf;
00214   } EstimateSideBandNoiseParams;
00215 
00216   /* LALDemod functions now put into CFSLALDemod.c */
00217   void GenerateSideBandTemplate(LALStatus *,BinarySourceParams *,SideBandTemplateParams *,SideBandTemplate **);
00218   void ComputeABCcoefficients (LALStatus *,ABCcoParams *,LALDetector *,ABCcoefficients **);
00219   void ReadTimeStamps(LALStatus *,CHAR *,INT4, SideBandTemplateParams **);
00220   void ComputeSideBandWindow(LALStatus *,ABCcoefficients *, CHAR *,SideBandTemplateParams **);
00221   void ComputeSideBandLikelihood(LALStatus *,SideBandMCMCVector *,SideBandDataSet *,SideBandTemplate **,SideBandTemplateParams *);
00222   void InitEphemeris(LALStatus *,EphemerisData *,const CHAR *,const CHAR *,LIGOTimeGPS);
00223   void ReadSideBandPriors(LALStatus *status,CHAR *,SideBandMCMCRanges *,SideBandMCMCJumpProbs *,SideBandTemplateParams *);
00224   void SelectSideBandFrequencies (LALStatus *,SideBandDataSet **,SelectSideBandFrequencyParams *,SideBandDataSet **);
00225   void ReadSideBandData (LALStatus *,ReadSideBandDataParams *,SideBandDataSet **);
00226   void EstimateSideBandNoise (LALStatus *, SideBandDataSet **,EstimateSideBandNoiseParams *);
00227   REAL4 bessj(INT4, REAL4);
00228   REAL4 bessj1(REAL4);
00229   REAL4 bessj0(REAL4);
00230       
00231 
00232 #ifdef  __cplusplus
00233 }
00234 #endif  
00235 /* C++ protection. */
00236 
00237 #endif  /* Double-include protection. */

Generated on Sat Sep 6 03:07:30 2008 for LAL by  doxygen 1.5.2