TestRandomBank.h

Go to the documentation of this file.
00001 /*
00002 *  Copyright (C) 2007 Thomas Cokelaer
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 #include <processtable.h>
00021 #include <stdio.h>
00022 #include <gsl/gsl_histogram.h>
00023 #include <lalapps.h>
00024 
00025 #include <lal/LALNoiseModels.h>
00026 #include <lal/LALInspiralBank.h>
00027 #include <lal/RealFFT.h>
00028 #include <lal/AVFactories.h>
00029 #include <lal/SeqFactories.h>
00030 #include <lal/LIGOMetadataUtils.h>
00031 #include <lal/LIGOMetadataTables.h>
00032 
00033 #include <lal/LIGOLwXMLHeaders.h>
00034 #include <lal/LALConfig.h>
00035 #include <lal/LALStdio.h>
00036 #include <lal/LALStdlib.h>
00037 #include <lal/LALError.h>
00038 #include <lal/LALDatatypes.h>
00039 #include <lal/AVFactories.h>
00040 #include <lal/FrameStream.h>
00041 #include <lal/FrameCalibration.h>
00042 #include <lal/Window.h>
00043 #include <lal/TimeFreqFFT.h>
00044 #include <lal/IIRFilter.h>
00045 #include <lal/ResampleTimeSeries.h>
00046 #include <lal/BandPassTimeSeries.h>
00047 #include <lal/LIGOMetadataTables.h>
00048 #include <lal/LIGOLwXML.h>
00049 #include <lal/LIGOLwXMLRead.h>
00050 #include <lal/LIGOLwXMLInspiralHeaders.h>
00051 #include <lal/Date.h>
00052 #include <lal/Units.h>
00053 #include <lal/FindChirp.h>
00054 #include <lal/PrintFTSeries.h>
00055 
00056 
00057 /* Here, I defined my own xml table outside the lal strcuture although
00058    it can be put  into the liXmlHeader files I guess. I dont want to
00059    use the lal definition for the  time being in order to avoid any 
00060    overlap with other users. */
00061 
00062 
00063 #define myfprintf(fp,oldmacro) PRINT_ ## oldmacro(fp)
00064 
00065 #define MAXIFO 2
00066 #define BANKEFFICIENCY_PARAMS_ROW \
00067 "         %f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%d,%d,%d"
00068 #define BANKEFFICIENCY_PARAMS_ROW_SPACE \
00069 "         %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %d %d %d "
00070 
00071 /*do not use capital here for future mysql migration */
00072 #define PRINT_LIGOLW_XML_BANKEFFICIENCY(fp) ( \
00073 fputs( "   <Table Name=\"bankefficiencygroup:bankefficiency:table\">\n", fp) == EOF || \
00074 fputs( "      <Column Name=\"bankefficiencygroup:bankefficiency:psi0\"                Type=\"real_4\"/>\n", fp) == EOF ||  \
00075 fputs( "      <Column Name=\"bankefficiencygroup:bankefficiency:psi3\"                Type=\"real_4\"/>\n", fp) == EOF ||  \
00076 fputs( "      <Column Name=\"bankefficiencygroup:bankefficiency:beta\"                Type=\"real_4\"/>\n", fp) == EOF ||  \
00077 fputs( "      <Column Name=\"bankefficiencygroup:bankefficiency:psi0_sim\"            Type=\"real_4\"/>\n", fp) == EOF ||  \
00078 fputs( "      <Column Name=\"bankefficiencygroup:bankefficiency:psi3_sim\"            Type=\"real_4\"/>\n", fp) == EOF ||  \
00079 fputs( "      <Column Name=\"bankefficiencygroup:bankefficiency:beta_sim\"            Type=\"real_4\"/>\n", fp) == EOF ||  \
00080 fputs( "      <Column Name=\"bankefficiencygroup:bankefficiency:tau0\"                Type=\"real_4\"/>\n", fp) == EOF ||  \
00081 fputs( "      <Column Name=\"bankefficiencygroup:bankefficiency:tau3\"                Type=\"real_4\"/>\n", fp) == EOF ||  \
00082 fputs( "      <Column Name=\"bankefficiencygroup:bankefficiency:tau0_sim\"            Type=\"real_4\"/>\n", fp) == EOF ||  \
00083 fputs( "      <Column Name=\"bankefficiencygroup:bankefficiency:tau3_sim\"            Type=\"real_4\"/>\n", fp) == EOF ||  \
00084 fputs( "      <Column Name=\"bankefficiencygroup:bankefficiency:spin1_x\"            Type=\"real_4\"/>\n", fp) == EOF ||  \
00085 fputs( "      <Column Name=\"bankefficiencygroup:bankefficiency:spin1_y\"            Type=\"real_4\"/>\n", fp) == EOF ||  \
00086 fputs( "      <Column Name=\"bankefficiencygroup:bankefficiency:spin1_z\"            Type=\"real_4\"/>\n", fp) == EOF ||  \
00087 fputs( "      <Column Name=\"bankefficiencygroup:bankefficiency:spin2_x\"            Type=\"real_4\"/>\n", fp) == EOF ||  \
00088 fputs( "      <Column Name=\"bankefficiencygroup:bankefficiency:spin2_y\"            Type=\"real_4\"/>\n", fp) == EOF ||  \
00089 fputs( "      <Column Name=\"bankefficiencygroup:bankefficiency:spin2_z\"            Type=\"real_4\"/>\n", fp) == EOF ||  \
00090 fputs( "      <Column Name=\"bankefficiencygroup:bankefficiency:theta0\"            Type=\"real_4\"/>\n", fp) == EOF ||  \
00091 fputs( "      <Column Name=\"bankefficiencygroup:bankefficiency:phi0\"            Type=\"real_4\"/>\n", fp) == EOF ||  \
00092 fputs( "      <Column Name=\"bankefficiencygroup:bankefficiency:ffinal\"              Type=\"real_4\"/>\n", fp) == EOF ||  \
00093 fputs( "      <Column Name=\"bankefficiencygroup:bankefficiency:ffinal_sim\"          Type=\"real_4\"/>\n", fp) == EOF ||  \
00094 fputs( "      <Column Name=\"bankefficiencygroup:bankefficiency:mass1_sim\"           Type=\"real_4\"/>\n", fp) == EOF ||  \
00095 fputs( "      <Column Name=\"bankefficiencygroup:bankefficiency:mass2_sim\"           Type=\"real_4\"/>\n", fp) == EOF ||  \
00096 fputs( "      <Column Name=\"bankefficiencygroup:bankefficiency:phase_sim\"           Type=\"real_4\"/>\n", fp) == EOF ||  \
00097 fputs( "      <Column Name=\"bankefficiencygroup:bankefficiency:snr\"                 Type=\"real_4\"/>\n", fp) == EOF ||  \
00098 fputs( "      <Column Name=\"bankefficiencygroup:bankefficiency:snr_at_ta\"           Type=\"real_4\"/>\n", fp) == EOF ||  \
00099 fputs( "      <Column Name=\"bankefficiencygroup:bankefficiency:phase\"           Type=\"real_4\"/>\n", fp) == EOF ||  \
00100 fputs( "      <Column Name=\"bankefficiencygroup:bankefficiency:alpha_f\"             Type=\"real_4\"/>\n", fp) == EOF ||  \
00101 fputs( "      <Column Name=\"bankefficiencygroup:bankefficiency:time\"                Type=\"int_4s\"/>\n", fp) == EOF ||  \
00102 fputs( "      <Column Name=\"bankefficiencygroup:bankefficiency:time_sim\"            Type=\"int_4s\"/>\n", fp) == EOF ||  \
00103 fputs( "      <Column Name=\"bankefficiencygroup:bankefficiency:nfast\"               Type=\"int_4s\"/>\n", fp) == EOF ||  \
00104 fputs( "      <Stream Name=\"bankefficiencygroup:bankefficiency:table\"               Type=\"Local\" Delimiter=\",\">\n", fp) == EOF ) 
00105 
00106 
00107 
00108 #define CVS_ID_STRING      "$Id: TestRandomBank.h,v 1.2 2007/06/08 15:29:44 bema Exp $"
00109 #define CVS_NAME_STRING    "$Name:  $"
00110 #define CVS_REVISION       "$Revision: 1.2 $"
00111 #define CVS_SOURCE         "$Source: /usr/local/cvs/lscsoft/lalapps/src/findchirp/TestRandomBank.h,v $"
00112 #define CVS_DATE           "$Date: 2007/06/08 15:29:44 $"
00113 #define PROGRAM_NAME       "BankEfficiency"
00114 
00115 
00116 /* --- Some Error messages --- */
00117 #define BANKEFFICIENCY_ENORM  0
00118 #define BANKEFFICIENCY_ESUB   1
00119 #define BANKEFFICIENCY_EARG   2
00120 #define BANKEFFICIENCY_EVAL   3
00121 #define BANKEFFICIENCY_EFILE  4
00122 #define BANKEFFICIENCY_EINPUT 5
00123 #define BANKEFFICIENCY_EMEM   6
00124 
00125 #define BANKEFFICIENCY_MSGENORM  "Normal exit"
00126 #define BANKEFFICIENCY_MSGESUB   "Subroutine failed"
00127 #define BANKEFFICIENCY_MSGEARG   "Error parsing arguments"
00128 #define BANKEFFICIENCY_MSGEVAL   "Input argument out of valid range"
00129 #define BANKEFFICIENCY_MSGEFILE  "Could not open file"
00130 #define BANKEFFICIENCY_MSGEINPUT "Error reading file"
00131 #define BANKEFFICIENCY_MSGEMEM   "Out of memory"
00132 #define BANKEFFICIENCY_MSGPARSER "Missing arguments ??  "
00133 
00134 /* --- Some constants --- 
00135  * useful to fill  InspiralTemplate, Bank and userParam structure */
00136 #define BANKEFFICIENCY_ALPHABANK                0.01
00137 #define BANKEFFICIENCY_ALPHASIGNAL              0.
00138 #define BANKEFFICIENCY_FLOWER                   40.
00139 #define BANKEFFICIENCY_HIGHGM                   6 
00140 #define BANKEFFICIENCY_IETA                     1
00141 #define BANKEFFICIENCY_IFLSO                    0.
00142 #define BANKEFFICIENCY_LOWGM                    3
00143 #define BANKEFFICIENCY_INSIDEPOLYGON            1
00144 #define BANKEFFICIENCY_MMCOARSE                 0.8
00145 #define BANKEFFICIENCY_MMFINE                   0.9
00146 #define BANKEFFICIENCY_MMIN                     5.
00147 #define BANKEFFICIENCY_MMAX                     20.
00148 #define BANKEFFICIENCY_NOISEMODEL               "LIGOI"
00149 #define BANKEFFICIENCY_NENDPAD                  0
00150 #define BANKEFFICIENCY_NFCUT                    5
00151 #define BANKEFFICIENCY_NOISEAMPLITUDE           1.
00152 #define BANKEFFICIENCY_NSTARTPAD                1000
00153 #define BANKEFFICIENCY_NTRIALS                  1
00154 #define BANKEFFICIENCY_PSI0MIN                  10.
00155 #define BANKEFFICIENCY_PSI0MAX                  250000.
00156 #define BANKEFFICIENCY_PSI3MIN                  -2200.
00157 #define BANKEFFICIENCY_PSI3MAX                  -10.
00158 #define BANKEFFICIENCY_ORDER_SIGNAL             twoPN
00159 #define BANKEFFICIENCY_ORDER_TEMPLATE           twoPN
00160 #define BANKEFFICIENCY_SIGNAL                  -1
00161 #define BANKEFFICIENCY_SIGNALAMPLITUDE          10.
00162 #define BANKEFFICIENCY_SPACE                    Psi0Psi3
00163 #define BANKEFFICIENCY_STARTTIME                0.
00164 #define BANKEFFICIENCY_STARTPHASE               0.
00165 #define BANKEFFICIENCY_TEMPLATE                -1
00166 #define BANKEFFICIENCY_TYPE                     0
00167 #define BANKEFFICIENCY_TSAMPLING                2048.
00168 #define BANKEFFICIENCY_USEED                    122888
00169 
00170 /* Other Parameters  1 = true ; 0 = false       */
00171 #define BANKEFFICIENCY_ALPHAFCONSTRAINT         1       /* alphaF between 0 and 1               */
00172 #define BANKEFFICIENCY_ALPHAFUNCONSTRAINT       0       /* alphaF between 0 and 1               */
00173 #define BANKEFFICIENCY_QUIETFLAG                0       /* silent                               */ 
00174 #define BANKEFFICIENCY_FASTSIMULATION           0       /* cheating code (dont use template far 
00175                                                            from injection; use with care        */
00176 #define BANKEFFICIENCY_PRINTOVERLAP             0       /* Print Best Overlap                   */
00177 #define BANKEFFICIENCY_PRINTBESTOVERLAP         0       /* Print Best Overlap                   */
00178 #define BANKEFFICIENCY_PRINTBESTTEMPLATE        0       /* Print Best Template                  */
00179 #define BANKEFFICIENCY_PRINTSNRHISTO            0       /* Print histogram of the n template correlation.*/
00180 #define BANKEFFICIENCY_PRINTOVERLAP_FILE        "BE_BestOverlap.dat"    /* Print Best Overlap in a file */
00181 #define BANKEFFICIENCY_PRINTFILTER              0       /* Print corresponding Filter           */
00182 #define BANKEFFICIENCY_PRINTBANK                0       /* print the template bank              */
00183 #define BANKEFFICIENCY_PRINTBANK_FILEASCII      "BE_Bank.dat"           /* print template bank in a file*/
00184 #define BANKEFFICIENCY_PRINTBANKXML             0       /* print the template bank              */
00185 #define BANKEFFICIENCY_PRINTBANK_FILEXML        "BE_Bank.xml"           /* print template bank in a file*/
00186 #define BANKEFFICIENCY_PRINTRESULT              1       /* print the result (ascii)             */
00187 #define BANKEFFICIENCY_PRINTRESULTXML           0       /* print the template bank              */
00188 #define BANKEFFICIENCY_PRINTRESULT_FILEXML      "BE_Result.xml"         /* print the result (xml file)  */
00189 #define BANKEFFICIENCY_PRINTPROTOTYPE           0       /* print the overlap of the templates   */
00190 #define BANKEFFICIENCY_PRINTBANKOVERLAP         0       /* print the overlap of the templates   */
00191 #define BANKEFFICIENCY_PRINTPSD                 0       /* print psd used in <x|x>              */
00192 #define BANKEFFICIENCY_PRINTPSD_FILE            "BE_PSD.dat"            /* Print Psd in a file  */
00193 #define BANKEFFICIENCY_PRINTTEMPLATE            0       /* print the  BCV final template        */
00194 #define BANKEFFICIENCY_FAITHFULNESS             0                               
00195 
00196 
00197 #define BANKEFFICIENCY_PRINTPROTO_FILEXML       "BE_Proto.xml"  /* print the result (xml file)  */
00198 #define BANKEFFICIENCY_READXMLBANK              "InputBank.xml" /* print the result (xml file)  */
00199 
00200 
00201 /* --- temporary flag for the sampling of real psd --- */
00202 #define None 512
00203 #define RealNoise 511
00204 
00205 
00206 #define BEASCII2XML_INPUT1 "Trigger.dat"
00207 #define BEASCII2XML_INPUT2 "BE_Proto.xml"
00208 #define BEASCII2XML_OUTPUT "Trigger.xml"
00209 #define BEASCII2XML_BANK   "BE_Bank.xml"
00210 
00211 
00212 /* ==================== local structures ==================== */
00213 /* 
00214  *  */
00215 
00216 /* used in BCV for the choice of constraint or unconstraint SNR */
00217 typedef enum {
00218   ALPHAFConstraint,
00219   ALPHAFUnconstraint,
00220   BOTHAlphaMethod
00221 } AlphaConstraint;
00222 
00223 
00224 /* what kind of injections to be performed ? */
00225 typedef enum {
00226   NoUserChoice,
00227   BBH,
00228   BNS,
00229   BHNS
00230 } BinaryInjection;
00231 
00232 /* what kind of noisemodel ?*/
00233 typedef enum{
00234     UNITY,
00235     LIGOI,
00236     LIGOA,
00237     GEO,
00238     TAMA,
00239     VIRGO,
00240     REALPSD,
00241     READPSD,
00242     EGO
00243 } DetectorName;
00244 
00245 /* what detectors (real noise only )*/
00246 typedef enum{
00247   L1,
00248   H1,
00249   H2,
00250   V1,
00251   G1
00252 }
00253 DetectorFlag;
00254 
00255 
00256 typedef enum{
00257   S1,S2,S3,S4,S5,S6
00258 }
00259 RunFlag;
00260 
00261 
00262 typedef struct{ 
00263   CHAR *calCacheName;
00264   CHAR *frInCacheName;
00265 }
00266 DataFileIn;
00267 
00268 
00269 typedef struct{ 
00270   DataFileIn S2, S3, S4, S5, S6;
00271 } 
00272 ScientificRunIn;
00273 
00274 typedef struct{
00275   CHAR *chanName;
00276   ScientificRunIn dataFile;
00277 }
00278 DetectorParamIn;
00279 
00280 typedef struct{
00281   AlphaConstraint alphaFConstraint;     /* force alpha_F to be constriant between 0 and 1 */
00282   INT4 signal;                          /* name of the random signal to inject  */      
00283   INT4 template;                        /* name of the template in the bank     */
00284   INT4 ntrials;                         /* number of simulations                */
00285   INT4 fastSimulation;                  /* target the injection in the bank --> less 
00286                                            computation but Match might be less than the
00287                                            optimal  is noise is injected or template and 
00288                                            signal are not faithful (ie: BCV against physical
00289                                            template */
00290 
00291   INT4 lengthFactor;                    /* multiply estimated length of filters by that factor */
00292   INT4 printSNRHisto;           
00293   INT4 printBank;                       /* print bank of templates              */
00294   INT4 printResultXml;
00295   INT4 printPrototype;
00296   INT4 printPsd;                        /* print the psd used in <x|x>          */
00297   INT4 realNoise;
00298   BinaryInjection binaryInjection;      /*injection will be set by the mass-range*/
00299   INT4 printBestOverlap, printBestTemplate, extraFinalPrinting ;
00300 
00301   INT4 faithfulness;
00302   INT4 snrAtCoaTime;
00303   double m1,m2, psi0,psi3, tau0, tau3, template_m1, template_m2;
00304   DetectorName noiseModel;
00305   REAL4   maxTotalMass;
00306   char *chanName;
00307   CHAR *calCacheName;
00308   CHAR *frInCacheName;
00309   INT4 startTime;
00310   DetectorParamIn L1;
00311   DetectorParamIn H1;
00312   DetectorParamIn H2;
00313   INT4 numSeconds;
00314   DetectorFlag detector;
00315   RunFlag run;
00316   REAL4 signalfFinal;
00317   INT4 startPhase;
00318   CHAR *inputPSD;
00319   INT4 useed;
00320   INT4 dataCheckPoint;
00321 }
00322 UserParametersIn;
00323 
00324 /* struct to save the results */
00325 typedef struct{
00326   REAL4  rhoMax;
00327   INT4   rhoBin;
00328   REAL4  alpha;
00329   REAL4  phase;
00330   REAL4  freq;
00331   INT4   layer;
00332   INT4   templateNumber;
00333   InspiralTemplate bestTemplate;
00334 
00335   InspiralTemplate bestUTemplate;
00336   REAL4 snrAtCoaTime;
00337 } OverlapOutputIn;
00338 
00339 /* structure to output the results */
00340 typedef struct{
00341   REAL4 tau0_inject;
00342   REAL4 tau0_trigger;
00343   REAL4 tau3_inject;
00344   REAL4 tau3_trigger;
00345   REAL4 psi0_trigger;
00346   REAL4 psi3_trigger;
00347   REAL4 beta_trigger;
00348   REAL4 beta_inject;
00349   REAL4 psi0_inject;
00350   REAL4 psi3_inject;
00351   REAL4 fend_trigger;
00352   REAL4 fend_inject;
00353   REAL4 mass1_inject;
00354   REAL4 mass2_inject;
00355   INT4 layer;
00356   REAL4 rho_final;
00357   REAL4 alphaF;
00358   INT4 bin;
00359   REAL4 phase;
00360   UINT4 ntrial;
00361   UINT4 nfast;
00362   REAL4 snrAtCoaTime;
00363 } ResultIn;
00364 
00365 
00366 /* BCV moments */
00367 typedef struct{
00368   REAL4Vector a11;
00369   REAL4Vector a21;
00370   REAL4Vector a22;
00371 } BEMoments;
00372 
00373 
00374 /* vectors for BCV storage*/
00375 typedef struct{
00376   REAL4Vector fm5_3;
00377   REAL4Vector fm2_3;
00378   REAL4Vector fm7_6;
00379   REAL4Vector fm1_2;
00380 } BEPowerVector;
00381 
00382 
00383 /* As to be cleaned
00384  * Function to store the optimal  parameters of the overlap 
00385  * lmax : number of the layer
00386  * fMax : frequency cutoff of the template
00387  * jmax: number of the best template. use if one want to use the FMaximization option 
00388  * */
00389 void
00390 KeepHighestValues(OverlapOutputIn in , 
00391                   OverlapOutputIn *out
00392                   );
00393 
00394 
00395 /* function to create the filters in the BCV overlap.
00396  * Input:       - Vectors F^(-5/3) and so on
00397  *              - Matrix of the moments for the amplitude
00398  *              - indice at which the template starts
00399  *              - psi0 and psi3 for the phase
00400  * Output       - The two orthogonal filters 
00401  * */
00402 void 
00403 LALCreateBCVFilters(REAL4Vector         *Filter1,
00404                     REAL4Vector         *Filter2,
00405                     BEPowerVector  *powerVector,
00406                     BEMoments      *moments,
00407                     UINT4               kMin,
00408                     UINT4               kMax,
00409                     REAL4               psi0,
00410                     REAL4               psi3);
00411 
00412 void 
00413 LALCreateBCVSpinFilters(REAL4Vector     *FilterBCVSpin1,
00414                         REAL4Vector     *FilterBCVSpin2,
00415                         REAL4Vector     *FilterBCVSpin3,
00416                         InspiralWaveOverlapIn   *overlapin,
00417                         BEPowerVector  *powerVector,
00418                         BEMoments      *moments,
00419                         UINT4           kMin,
00420                         UINT4           kMax);
00421                 
00422 void 
00423 LALBankPrintAscii(MetadataTable          templateBank ,
00424                   UINT4                  numCoarse,
00425                   InspiralCoarseBankIn   coarseBankIn );
00426 
00427 void
00428 LALBankPrintXML(MetadataTable templateBank,
00429                 InspiralCoarseBankIn   coarseBankIn,
00430                 RandomInspiralSignalIn randIn,
00431                 UserParametersIn           userParam);
00432 void
00433 CreateListfromTmplt(InspiralTemplate *insptmplt, 
00434                     SnglInspiralTable *tmpltCurrent);
00435 
00436 
00437 void
00438 BEGenerateInputData(LALStatus *status,
00439                     REAL4Vector * signal,
00440                     RandomInspiralSignalIn  *randIn,
00441                     UserParametersIn           userParam);
00442 
00443 void
00444 BEInitOverlapOutputIn(OverlapOutputIn *this);
00445 
00446 /* Function to compute a orthogonal vector in BCV
00447  * */
00448 void
00449 LALGetOrthogonalFilter(REAL4Vector *filter);
00450 
00451 
00452 /* Functon to compute the overlap between an injected signal 
00453  * and a set of templates based on BCV templates. 
00454  * It returns the overlap, the phase and alpha parameter. 
00455  * */
00456 void
00457 LALWaveOverlapBCV(LALStatus               *status,
00458                   REAL4Vector             *correlation,
00459                   InspiralWaveOverlapIn   *overlapin,
00460                   REAL4Vector             *Filter1, 
00461                   REAL4Vector             *Filter2,
00462                   UserParametersIn        userParam, 
00463                   OverlapOutputIn         *OverlapOutput,
00464                   BEMoments               *moments);
00465 
00466 void
00467 LALWaveOverlapBCVSpin(LALStatus                   *status,
00468                       REAL4Vector             *correlation,
00469                       InspiralWaveOverlapIn   *overlapin,
00470                       REAL4Vector             *Filter1, 
00471                       REAL4Vector             *Filter2,
00472                       REAL4Vector             *Filter3,
00473                       UserParametersIn        userParam, 
00474                       OverlapOutputIn         *OverlapOutput
00475                       );
00476 
00477 
00478 /* Function to store the moments needed by the BCV overlap process 
00479  * a11, a22, a21 are three vectors which stored the three components 
00480  * of the matrix needed in the BCV maximization process. 
00481  * */
00482 void
00483 LALCreateBCVMomentVector(BEMoments            *moments,
00484                          REAL8FrequencySeries *psd,
00485                          REAL8 sampling, REAL8 fLower,
00486                          INT4 length);
00487 
00488 /* Function to create Vectors of the form y(f)= f^(-a/b). 
00489  * where f is the frequency. 
00490  * */
00491 void 
00492 LALCreateVectorFreqPower( REAL4Vector           *vector,
00493                           InspiralTemplate      params,
00494                           int                   a,
00495                           int                   b);
00496 
00497 
00498 /* function to generate waveform (has to be tested). 
00499  * */
00500 void
00501 LALGenerateWaveform(LALStatus                   *status,
00502                     REAL4Vector                 *signal,
00503                     RandomInspiralSignalIn      *params);
00504 
00505 
00506 void 
00507 GetResult(
00508     LALStatus                   *status,
00509     InspiralTemplate            *list,
00510     InspiralTemplate            injected,
00511     OverlapOutputIn             bestOverlapout, 
00512     ResultIn                    *result,
00513     UserParametersIn            userParam );
00514 
00515 /* Init the CoarseBank structure 
00516  * */
00517 void
00518 InitInspiralCoarseBankIn(
00519     InspiralCoarseBankIn        *coarseIn);
00520 
00521 /* Init the random structure 
00522  * */
00523 void
00524 InitRandomInspiralSignalIn(
00525     RandomInspiralSignalIn      *randIn);
00526 
00527 /* Init the UserParametersIn structure
00528  * */
00529 void
00530 InitUserParametersIn(
00531     UserParametersIn    *userParam);
00532 
00533 /* Function to initialize the different strucutre */
00534 void
00535 ParametersInitialization(
00536     InspiralCoarseBankIn        *coarseIn, 
00537     RandomInspiralSignalIn      *randIn, 
00538     UserParametersIn            *userParam);
00539 /* Parsing function 
00540  * */
00541 void
00542 ParseParameters(
00543     int         *argc, 
00544     char        **argv,
00545     InspiralCoarseBankIn        *coarseIn,
00546     RandomInspiralSignalIn      *randIn,
00547     UserParametersIn            *userParam);                 
00548 
00549 /* function to check validity of some parameters
00550  * */
00551 void    
00552 UpdateParams(InspiralCoarseBankIn       *coarseIn,
00553              RandomInspiralSignalIn     *randIn,
00554              UserParametersIn           *userParam);
00555 
00556 
00557 /* Default values
00558  * */
00559 void 
00560 SetDefault(InspiralCoarseBankIn         *coarseIn, 
00561            RandomInspiralSignalIn       *randIn,
00562            UserParametersIn             *userParam);
00563 
00564 /* Help Function 
00565  * */
00566 void
00567 Help();
00568 
00569 /* Print Function for final results 
00570  * */
00571 void
00572 PrintResults(
00573     ResultIn                    result,
00574     RandomInspiralSignalIn      rand);
00575 
00576 
00577 
00578 /* Print each  template bank overlap 
00579  * */
00580 void
00581 PrintBankOverlap(InspiralTemplateList   **list,
00582                  int                    sizeBank,
00583                  float                  *overlap,
00584                  InspiralCoarseBankIn   coarseIn);
00585 
00586 /* Print the template bank coordinates in ascii format 
00587  * */
00588 void
00589 BEPrintBank(
00590     InspiralCoarseBankIn        coarse, 
00591     InspiralTemplateList        **list,
00592     UINT4                       sizeBank);
00593 
00594 /* print the template bank coordinates  in xml format 
00595  * */
00596 void 
00597 BEPrintBankXml(
00598     InspiralTemplateList        *coarseList,
00599     UINT4                       numCoarse,
00600     InspiralCoarseBankIn        coarseIn,
00601     RandomInspiralSignalIn      randIn,
00602     UserParametersIn            userParam
00603     );
00604 
00605 void 
00606 BEGetMaximumSize(
00607     LALStatus  *status,                       
00608     RandomInspiralSignalIn  randIn,
00609     InspiralCoarseBankIn    coarseBankIn, 
00610     UINT4 *length
00611     );
00612 
00613 
00614 void
00615 BECreatePsd(
00616     LALStatus                   *status, 
00617     InspiralCoarseBankIn        *coarseBankIn, 
00618     RandomInspiralSignalIn      *randIn,
00619     UserParametersIn            userParam);
00620 
00621 /* print an error  message 
00622  * */
00623 void 
00624 BEPrintError(char *chaine);
00625 
00626 void
00627 BEFillProc(
00628     ProcessParamsTable          *proc,
00629     InspiralCoarseBankIn        coarseIn,
00630     RandomInspiralSignalIn      randIn,
00631     UserParametersIn            userParam);
00632 
00633 /* xml file for the standalone code */
00634 void 
00635 BEPrintResultsXml( 
00636     InspiralCoarseBankIn         coarseBankIn,
00637     RandomInspiralSignalIn       randIn,
00638     UserParametersIn             userParam,
00639     ResultIn                     trigger
00640     );
00641 void 
00642 BEPrintResultsXml2( 
00643     InspiralCoarseBankIn         coarseBankIn,
00644     RandomInspiralSignalIn       randIn,
00645     UserParametersIn             userParam,
00646     ResultIn                     trigger
00647     );
00648 
00649 void 
00650 BEPrintProtoXml(
00651     InspiralCoarseBankIn          coarseIn,
00652     RandomInspiralSignalIn        randIn,
00653     UserParametersIn              userParam
00654     );
00655 
00656 void
00657 BEReadXmlBank(  LALStatus  *status, 
00658                 CHAR *bankFileName, 
00659                 InspiralTemplateList **list,
00660                 INT4 *sizeBank, 
00661                 InspiralCoarseBankIn coarseIn);
00662 
00663 
00664 void 
00665 LALCreateRealPsd(LALStatus *status, 
00666                  InspiralCoarseBankIn *bankIn,
00667                  RandomInspiralSignalIn randIn, 
00668                  UserParametersIn userParam);
00669 
00670 
00671 
00672 
00673 typedef struct 
00674 {  
00675   LIGOTimeGPS   gpsStartTime;
00676   LIGOTimeGPS   gpsEndTime;
00677   INT4          padData;                  
00678   INT4          numPoints;
00679   INT4          numSegments;
00680   CHAR          ifo[3];                           
00681 
00682   INT4          inputDataLength;
00683   INT4          resampFiltType;
00684   INT4          sampleRate;   
00685   INT4          highPass;     
00686   REAL4         highPassFreq; 
00687   INT4          highPassOrder;
00688   REAL4         highPassAtten;
00689   REAL4         fLow;
00690   INT4          specType;           
00691 
00692   CHAR          *calCacheName;
00693   INT4          pointCal;           
00694   REAL4         dynRangeExponent;          
00695   REAL4         geoHighPassFreq;            
00696   INT4          geoHighPassOrder;           
00697   REAL4         geoHighPassAtten; 
00698   
00699   INT4          randomSeed; 
00700   REAL4         gaussVar;   
00701   INT4          gaussianNoise;
00702  
00703   CHAR          *fqChanName;
00704   CHAR          *injectionFile;
00705   CHAR          *frInCacheName;
00706 }
00707 InspiralPipelineIn;
00708 
00709 
00710 
00711 void SetInspiralPipelineParams(InspiralPipelineIn *param,
00712                               RandomInspiralSignalIn randIn);
00713 
00714 
00715 
00716 
00717 typedef struct 
00718 {
00719   INT4 numPoints;
00720   REAL4 gaussVar;
00721   REAL4 inputDeltaT;
00722   INT4 specType;
00723 }
00724 WindowSpectrumIn;
00725 
00726 void 
00727 LALComputeWindowSpectrum(LALStatus *status, 
00728                               WindowSpectrumIn *param,
00729                               REAL4FrequencySeries  *spec,
00730                               REAL4TimeSeries *chan);
00731 
00732 
00733 void 
00734 BECreateBank(
00735     LALStatus                   *status, 
00736     InspiralCoarseBankIn        *coarseBankIn,  
00737     InspiralTemplateList        **list,
00738     INT4                        *sizeBank);
00739 
00740 
00741 
00742 void
00743 BECreatePowerVector(
00744     LALStatus              *status, 
00745     BEPowerVector          *powerVector,
00746     RandomInspiralSignalIn  randIn, 
00747     INT4                    length);
00748 
00749 
00750 void 
00751 LALInspiralOverlapBCV(
00752     LALStatus                   *status,
00753     InspiralTemplate            *list,
00754     BEPowerVector               *powerVector,
00755     UserParametersIn            *userParam, 
00756     RandomInspiralSignalIn      *randIn,
00757     REAL4Vector                 *Filter1,
00758     REAL4Vector                 *Filter2,
00759     InspiralWaveOverlapIn       *overlapin,
00760     OverlapOutputIn             *output,
00761     REAL4Vector                 *correlation,
00762     BEMoments                   *moments);
00763 
00764 void 
00765 LALInspiralOverlapBCVSpin(
00766     LALStatus                   *status,
00767     InspiralTemplate            *list,
00768     BEPowerVector               *powerVector,
00769     UserParametersIn            *userParam, 
00770     RandomInspiralSignalIn      *randIn,
00771     REAL4Vector                 *Filter1,
00772     REAL4Vector                 *Filter2,
00773     REAL4Vector                 *Filter3,
00774     InspiralWaveOverlapIn       *overlapin,
00775     OverlapOutputIn             *output,
00776     REAL4Vector                 *correlation,
00777     BEMoments                   *moments);
00778 
00779 
00780 
00781 
00782 void
00783 BEParseGetInt(  CHAR **argv, 
00784                 INT4 *index,
00785                 INT4 *data);
00786 
00787 void
00788 BEParseGetDouble(CHAR    **argv, 
00789                  INT4    *index,
00790                  REAL8    *data);
00791 
00792 void
00793 BEParseGetDouble2(CHAR    **argv, 
00794                   INT4    *index,
00795                   REAL8    *data1,                
00796                   REAL8    *data2);
00797 
00798 void
00799 BEParseGetString(  CHAR    **argv, 
00800                    INT4    *index );
00801 
00802 
00803 void
00804 PrintParameters(InspiralCoarseBankIn    coarse,
00805                 RandomInspiralSignalIn  rand,
00806                 UserParametersIn        other);
00807 
00808 CHAR* GetStringFromGridType(INT4 input);
00809 CHAR* GetStringFromSimulationType(INT4 input);
00810 CHAR* GetStringFromDetector(INT4 input);
00811 CHAR* GetStringFromTemplate(INT4 input);
00812 CHAR* GetStringFromNoiseModel(INT4 input);
00813 CHAR* GetStringFromScientificRun(INT4 input);
00814 
00815 
00816 void
00817 BEAscii2XmlHelp(void);
00818 
00819 void 
00820 BEAscii2Xml();
00821 

Generated on Sun Sep 7 03:07:24 2008 for LAL by  doxygen 1.5.2