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
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304
00305 #include <math.h>
00306 #include <string.h>
00307 #include <stdio.h>
00308 #ifdef HAVE_UNISTD_H
00309 #include <unistd.h>
00310 #endif
00311 #ifdef HAVE_GETOPT_H
00312 #include <getopt.h>
00313 #endif
00314 #include <lal/LALStdio.h>
00315 #include <lal/LALStdlib.h>
00316 #include <lal/AVFactories.h>
00317 #include <lal/Calibration.h>
00318 #include <lal/LALConstants.h>
00319 #include <lal/LALStatusMacros.h>
00320 #include <lal/StochasticCrossCorrelation.h>
00321 #include <lal/RealFFT.h>
00322 #include <lal/ComplexFFT.h>
00323 #include <lal/Units.h>
00324 #include <lal/Random.h>
00325 #include <lal/SimulateSB.h>
00326 #include <lal/StochasticMC.h>
00327
00328
00329 NRCSID(STOCHASTICMCC, "$Id: StochasticMC.c,v 3.24 2007/06/08 14:41:47 bema Exp $");
00330
00331 static int verbose = 0;
00332
00333 static void SinusoidalSplice(REAL4Vector **longData, REAL4Vector **shortData, REAL4Vector *output, UINT4 nSpliceSegs, UINT4 offset);
00334
00335 void LALStochasticMCDso (LALStatus *status,
00336 SSSimStochBGOutput *MCoutput,
00337 StochasticMCInput *MCinput,
00338 StochasticMCParams *MCparams)
00339 {
00340
00341
00342 StochasticOmegaGWParameters parametersOmega;
00343
00344
00345 SSSimStochBGParams SBParams;
00346 SSSimStochBGInput SBInput;
00347 SSSimStochBGOutput SBOutput;
00348 REAL4TimeSeries whitenedSSimStochBG1;
00349 REAL4TimeSeries whitenedSSimStochBG2;
00350
00351 REAL4FrequencySeries omegaGW;
00352 COMPLEX8FrequencySeries wFilter1;
00353 COMPLEX8FrequencySeries wFilter2;
00354
00355
00356
00357 COMPLEX8Vector *response[2]={NULL,NULL};
00358
00359
00360 INT4 i,loop;
00361 INT4 seed;
00362 REAL8 totnorm;
00363 REAL8 totnorm2;
00364
00365
00366 INT4 caltime;
00367 UINT4 starttime;
00368 UINT4 length;
00369 INT4 lengthseg;
00370 INT4 numseg;
00371 UINT4 caliboffset;
00372 UINT4 freqlen;
00373 REAL8 deltaF, deltaT, sRate;
00374 INT4 site1, site2;
00375 REAL8 omegaRef, f0, fRef, alpha;
00376
00377
00378 CalibrationFunctions calfuncs1,calfuncs2 ;
00379 CalibrationUpdateParams calfacts1,calfacts2 ;
00380
00381 const LALUnit countPerStrain = {0,{0,0,0,0,0,-1,1},{0,0,0,0,0,0,0}};
00382
00383
00384 INITSTATUS(status, "LALStochasticMC", STOCHASTICMCC);
00385 ATTATCHSTATUSPTR(status);
00386
00387
00388
00389
00390
00391
00392
00393 ASSERT(MCoutput !=NULL,status,
00394 STOCHASTICMCH_ENULLP,STOCHASTICMCH_MSGENULLP);
00395 ASSERT(MCoutput->SSimStochBG1->data !=NULL,status,
00396 STOCHASTICMCH_ENULLP,STOCHASTICMCH_MSGENULLP);
00397 ASSERT(MCoutput->SSimStochBG2->data !=NULL,status,
00398 STOCHASTICMCH_ENULLP,STOCHASTICMCH_MSGENULLP);
00399 ASSERT(MCoutput->SSimStochBG1->data->data !=NULL,status,
00400 STOCHASTICMCH_ENULLP,STOCHASTICMCH_MSGENULLP);
00401 ASSERT(MCoutput->SSimStochBG2->data->data !=NULL,status,
00402 STOCHASTICMCH_ENULLP,STOCHASTICMCH_MSGENULLP);
00403
00404
00405 ASSERT(MCinput != NULL, status,
00406 STOCHASTICMCH_ENULLP,STOCHASTICMCH_MSGENULLP);
00407
00408 ASSERT(MCinput->calfuncs1.responseFunction->data !=NULL,status,
00409 STOCHASTICMCH_ENULLP,STOCHASTICMCH_MSGENULLP);
00410 ASSERT(MCinput->calfuncs2.responseFunction->data !=NULL,status,
00411 STOCHASTICMCH_ENULLP,STOCHASTICMCH_MSGENULLP);
00412 ASSERT(MCinput->calfuncs1.responseFunction->data->data !=NULL,
00413 status,STOCHASTICMCH_ENULLP,STOCHASTICMCH_MSGENULLP);
00414 ASSERT(MCinput->calfuncs2.responseFunction->data->data !=NULL,
00415 status,STOCHASTICMCH_ENULLP,STOCHASTICMCH_MSGENULLP);
00416
00417 ASSERT(MCinput->calfuncs1.sensingFunction->data !=NULL,status,
00418 STOCHASTICMCH_ENULLP,STOCHASTICMCH_MSGENULLP);
00419 ASSERT(MCinput->calfuncs2.sensingFunction->data !=NULL,status,
00420 STOCHASTICMCH_ENULLP,STOCHASTICMCH_MSGENULLP);
00421 ASSERT(MCinput->calfuncs1.sensingFunction->data->data !=NULL,
00422 status, STOCHASTICMCH_ENULLP,STOCHASTICMCH_MSGENULLP);
00423 ASSERT(MCinput->calfuncs2.sensingFunction->data->data !=NULL,
00424 status,STOCHASTICMCH_ENULLP,STOCHASTICMCH_MSGENULLP);
00425
00426 ASSERT(MCinput->calfacts1.openLoopFactor->data !=NULL,status,
00427 STOCHASTICMCH_ENULLP,STOCHASTICMCH_MSGENULLP);
00428 ASSERT(MCinput->calfacts2.openLoopFactor->data !=NULL,status,
00429 STOCHASTICMCH_ENULLP,STOCHASTICMCH_MSGENULLP);
00430 ASSERT(MCinput->calfacts1.openLoopFactor->data->data !=NULL,
00431 status,STOCHASTICMCH_ENULLP,STOCHASTICMCH_MSGENULLP);
00432 ASSERT(MCinput->calfacts2.openLoopFactor->data->data !=NULL,
00433 status,STOCHASTICMCH_ENULLP,STOCHASTICMCH_MSGENULLP);
00434
00435 ASSERT(MCinput->calfacts1.sensingFactor->data !=NULL,status,
00436 STOCHASTICMCH_ENULLP,STOCHASTICMCH_MSGENULLP);
00437 ASSERT(MCinput->calfacts2.sensingFactor->data !=NULL,status,
00438 STOCHASTICMCH_ENULLP,STOCHASTICMCH_MSGENULLP);
00439 ASSERT(MCinput->calfacts1.sensingFactor->data->data !=NULL,
00440 status,STOCHASTICMCH_ENULLP,STOCHASTICMCH_MSGENULLP);
00441 ASSERT(MCinput->calfacts2.sensingFactor->data->data !=NULL,
00442 status,STOCHASTICMCH_ENULLP,STOCHASTICMCH_MSGENULLP);
00443
00444
00445
00446
00447
00448 ASSERT(MCparams->lengthseg > 0, status,
00449 STOCHASTICMCH_ENULLLEN,STOCHASTICMCH_MSGENULLLEN);
00450
00451
00452 ASSERT(MCparams->numseg > 0, status,
00453 STOCHASTICMCH_ENULLSEG,STOCHASTICMCH_MSGENULLSEG);
00454
00455
00456 ASSERT(MCparams->sRate > 0, status,
00457 STOCHASTICMCH_ENULLSRATE,STOCHASTICMCH_MSGENULLSRATE);
00458
00459
00460
00461
00462
00463
00464
00465
00466 if (MCparams->f0 < 0)
00467 {
00468 ABORT(status,STOCHASTICMCH_ENEGFMIN,STOCHASTICMCH_MSGENEGFMIN );
00469 }
00470
00471
00472
00473
00474 calfuncs1 = MCinput->calfuncs1;
00475 calfuncs2 = MCinput->calfuncs2;
00476 calfacts1 = MCinput->calfacts1;
00477 calfacts2 = MCinput->calfacts2;
00478
00479
00480
00481 fRef = MCparams->fRef;f0 = MCparams->f0;
00482 omegaRef = MCparams->omegaRef; alpha = MCparams->alpha;
00483 site1 = MCparams->site1; site2 = MCparams->site2;
00484 starttime = MCparams->starttime;
00485 lengthseg = MCparams->lengthseg; numseg = MCparams->numseg;
00486 sRate = MCparams->sRate;
00487 seed = MCparams->seed;
00488
00489
00490
00491 length = lengthseg * numseg;
00492 freqlen = lengthseg / 2 + 1;
00493 caliboffset = lengthseg / (2 * sRate);
00494 deltaT = 1.0 / sRate;
00495 deltaF = 1.0/(deltaT*lengthseg);
00496 caltime = starttime + caliboffset;
00497
00498
00499
00500
00501
00502 if (calfacts1.epoch.gpsSeconds != caltime)
00503 {
00504 ABORT(status,STOCHASTICMCH_EMMEPOCH,STOCHASTICMCH_MSGEMMEPOCH);
00505 }
00506 if (calfacts2.epoch.gpsSeconds != caltime)
00507 {
00508 ABORT(status,STOCHASTICMCH_EMMEPOCH,STOCHASTICMCH_MSGEMMEPOCH);
00509 }
00510 if (calfacts1.epoch.gpsNanoSeconds != 0)
00511 {
00512 ABORT(status,STOCHASTICMCH_EMMEPOCH,STOCHASTICMCH_MSGEMMEPOCH);
00513 }
00514 if (calfacts2.epoch.gpsNanoSeconds != 0)
00515 {
00516 ABORT(status,STOCHASTICMCH_EMMEPOCH,STOCHASTICMCH_MSGEMMEPOCH);
00517 }
00518
00519
00520
00521
00522 omegaGW.data = NULL;
00523 LALSCreateVector(status->statusPtr, &(omegaGW.data), freqlen);
00524
00525 whitenedSSimStochBG1.data = NULL;
00526 LALSCreateVector(status->statusPtr, &(whitenedSSimStochBG1.data), lengthseg);
00527 whitenedSSimStochBG2.data = NULL;
00528 LALSCreateVector(status->statusPtr, &(whitenedSSimStochBG2.data), lengthseg);
00529
00530
00531
00532 SBParams.length = lengthseg;
00533 SBParams.deltaT = 1.0/sRate;
00534 SBParams.detectorOne = lalCachedDetectors[site1];
00535 SBParams.detectorTwo = lalCachedDetectors[site2];
00536 SBParams.SSimStochBGTimeSeries1Unit = lalADCCountUnit;
00537 SBParams.SSimStochBGTimeSeries2Unit = lalADCCountUnit;
00538
00539
00540
00541 parametersOmega.length = freqlen;
00542 parametersOmega.f0 = f0;
00543 parametersOmega.deltaF = deltaF;
00544 parametersOmega.alpha = alpha;
00545 parametersOmega.fRef = fRef;
00546 parametersOmega.omegaRef = omegaRef;
00547 LALStochasticOmegaGW(status->statusPtr, &omegaGW, ¶metersOmega);
00548
00549 memset( &wFilter1, 0, sizeof(COMPLEX8FrequencySeries) );
00550 memset( &wFilter2, 0, sizeof(COMPLEX8FrequencySeries) );
00551
00552 for (i=0;i<2;i++)
00553 {
00554 LALCCreateVector(status->statusPtr, &response[i],freqlen);
00555 }
00556
00557 wFilter1.epoch.gpsNanoSeconds = 0;
00558 wFilter1.deltaF = deltaF ;
00559 wFilter1.f0 = f0;
00560 wFilter1.sampleUnits = countPerStrain;
00561 wFilter1.data = response[0];
00562
00563
00564 wFilter2.epoch.gpsNanoSeconds = 0;
00565 wFilter2.deltaF = deltaF ;
00566 wFilter2.f0 = f0;
00567 wFilter2.sampleUnits = countPerStrain;
00568 wFilter2.data = response[1];
00569
00570
00571 for (loop = 0; loop < numseg; loop ++)
00572
00573 {
00574 seed = seed + loop*2;
00575 SBParams.seed = seed;
00576
00577 wFilter1.epoch.gpsSeconds = caltime;
00578 wFilter2.epoch.gpsSeconds = caltime;
00579
00580 calfacts1.epoch.gpsSeconds = caltime;
00581 calfacts2.epoch.gpsSeconds = caltime;
00582
00583
00584 LALUpdateCalibration(status->statusPtr,&calfuncs1,&calfuncs1,&calfacts1);
00585 LALUpdateCalibration(status->statusPtr,&calfuncs2,&calfuncs2,&calfacts2);
00586 LALResponseConvert(status->statusPtr,&wFilter1,calfuncs1.responseFunction);
00587 LALResponseConvert(status->statusPtr,&wFilter2,calfuncs2.responseFunction);
00588
00589
00590
00591 response[0]->data[0].re = 0.0;
00592 response[0]->data[0].im = 0.0;
00593 response[1]->data[0].re = 0.0;
00594 response[1]->data[0].im = 0.0;
00595 response[0]->data[freqlen-1].im = 0;
00596 response[1]->data[freqlen-1].im = 0;
00597
00598
00599
00600 SBInput.omegaGW = &omegaGW;
00601 SBInput.whiteningFilter1 = &wFilter1;
00602 SBInput.whiteningFilter2 = &wFilter2;
00603
00604 SBOutput.SSimStochBG1 = &whitenedSSimStochBG1;
00605 SBOutput.SSimStochBG2 = &whitenedSSimStochBG2;
00606
00607
00608 LALSSSimStochBGTimeSeries(status->statusPtr, &SBOutput, &SBInput, &SBParams);
00609 if ( verbose )
00610 {
00611
00612
00613 totnorm2=0.0;
00614 for (i=0;i<lengthseg;i++)
00615 totnorm2+=((whitenedSSimStochBG1.data->data[i])*(whitenedSSimStochBG1.data->data[i]));
00616
00617 totnorm2/=lengthseg;
00618 printf("Mean square of whitened output is: %e\n",totnorm2);
00619
00620
00621 totnorm=0.0;
00622 for (i=1;(UINT4)i<freqlen;i++){
00623 REAL8 freq=i*sRate/lengthseg;
00624 REAL8 resp = response[0]->data[i].re;
00625 totnorm+=resp*resp*(omegaGW.data->data[i])/(freq*freq*freq);
00626 }
00627 totnorm*=0.3*LAL_H0FAC_SI*LAL_H0FAC_SI*sRate/(LAL_PI*LAL_PI*lengthseg);
00628 printf("Mean square of whitened output should be: %e. Ratio is %e\n",totnorm,totnorm/totnorm2);
00629 }
00630
00631 for (i = 0; i < lengthseg; i ++)
00632 {
00633 MCoutput->SSimStochBG1->data->data[i + loop * lengthseg] = whitenedSSimStochBG1.data->data[i];
00634 MCoutput->SSimStochBG2->data->data[i + loop * lengthseg] = whitenedSSimStochBG2.data->data[i];
00635 }
00636 caltime = caltime + caliboffset;
00637 }
00638
00639
00640
00641 MCoutput->SSimStochBG1->f0 = f0;
00642 MCoutput->SSimStochBG1->deltaT = deltaT;
00643 MCoutput->SSimStochBG1->epoch.gpsSeconds = starttime;
00644 MCoutput->SSimStochBG1->epoch.gpsNanoSeconds = 0;
00645 MCoutput->SSimStochBG1->sampleUnits = lalADCCountUnit;
00646 strncpy( MCoutput->SSimStochBG1->name,
00647 "Whitened-SimulatedSBOne", LALNameLength );
00648
00649 MCoutput->SSimStochBG2->f0 = f0;
00650 MCoutput->SSimStochBG2->deltaT = deltaT;
00651 MCoutput->SSimStochBG2->epoch.gpsSeconds = starttime;
00652 MCoutput->SSimStochBG2->epoch.gpsNanoSeconds = 0;
00653 MCoutput->SSimStochBG2->sampleUnits =lalADCCountUnit;
00654 strncpy( MCoutput->SSimStochBG2->name,
00655 "Whitened-SimulatedSBTwo", LALNameLength );
00656
00657
00658
00659
00660
00661
00662 LALSDestroyVector(status->statusPtr, &(omegaGW.data));
00663 for (i=0;i<2;i++){
00664 LALCDestroyVector(status->statusPtr, &response[i]);
00665 }
00666
00667 LALSDestroyVector(status->statusPtr, &(whitenedSSimStochBG1.data));
00668 LALSDestroyVector(status->statusPtr, &(whitenedSSimStochBG2.data));
00669
00670
00671 DETATCHSTATUSPTR(status);
00672 RETURN(status);
00673 }
00674
00675
00676
00677 void LALStochasticMCDsoSplice (LALStatus *status,
00678 SSSimStochBGOutput *MCoutput,
00679 StochasticMCInput *MCinput,
00680 StochasticMCParams *MCparams)
00681 {
00682
00683
00684 StochasticOmegaGWParameters parametersOmega;
00685
00686
00687 SSSimStochBGParams SBParams;
00688 SSSimStochBGInput SBInput;
00689 SSSimStochBGOutput SBOutput;
00690 REAL4TimeSeries whitenedSSimStochBG1;
00691 REAL4TimeSeries whitenedSSimStochBG2;
00692
00693 REAL4FrequencySeries omegaGW;
00694 COMPLEX8FrequencySeries wFilter1;
00695 COMPLEX8FrequencySeries wFilter2;
00696
00697 REAL4Vector **longTrain1 = NULL, **shortTrain1 = NULL, **longTrain2 = NULL, **shortTrain2 = NULL;
00698
00699 COMPLEX8Vector *response[2]={NULL,NULL};
00700
00701
00702 INT4 i,m,k,loop;
00703 INT4 seed;
00704
00705
00706 INT4 caltime;
00707 UINT4 starttime;
00708 INT4 lengthseg;
00709 UINT4 length;
00710 INT4 numseg;
00711 INT4 numsegsplice;
00712 INT4 numsegtot;
00713 UINT4 spliceoffset;
00714 UINT4 freqlen;
00715 REAL8 deltaF, deltaT, sRate;
00716 INT4 site1, site2;
00717 REAL8 omegaRef, f0, fRef, alpha;
00718
00719
00720 CalibrationFunctions calfuncs1,calfuncs2 ;
00721 CalibrationUpdateParams calfacts1,calfacts2 ;
00722
00723 const LALUnit countPerStrain = {0,{0,0,0,0,0,-1,1},{0,0,0,0,0,0,0}};
00724
00725
00726 INITSTATUS(status, "LALStochasticMC", STOCHASTICMCC);
00727 ATTATCHSTATUSPTR(status);
00728
00729
00730
00731
00732
00733
00734
00735 ASSERT(MCoutput !=NULL,status,
00736 STOCHASTICMCH_ENULLP,STOCHASTICMCH_MSGENULLP);
00737 ASSERT(MCoutput->SSimStochBG1->data !=NULL,status,
00738 STOCHASTICMCH_ENULLP,STOCHASTICMCH_MSGENULLP);
00739 ASSERT(MCoutput->SSimStochBG2->data !=NULL,status,
00740 STOCHASTICMCH_ENULLP,STOCHASTICMCH_MSGENULLP);
00741 ASSERT(MCoutput->SSimStochBG1->data->data !=NULL,status,
00742 STOCHASTICMCH_ENULLP,STOCHASTICMCH_MSGENULLP);
00743 ASSERT(MCoutput->SSimStochBG2->data->data !=NULL,status,
00744 STOCHASTICMCH_ENULLP,STOCHASTICMCH_MSGENULLP);
00745
00746
00747 ASSERT(MCinput != NULL, status,
00748 STOCHASTICMCH_ENULLP,STOCHASTICMCH_MSGENULLP);
00749
00750 ASSERT(MCinput->calfuncs1.responseFunction->data !=NULL,status,
00751 STOCHASTICMCH_ENULLP,STOCHASTICMCH_MSGENULLP);
00752 ASSERT(MCinput->calfuncs2.responseFunction->data !=NULL,status,
00753 STOCHASTICMCH_ENULLP,STOCHASTICMCH_MSGENULLP);
00754 ASSERT(MCinput->calfuncs1.responseFunction->data->data !=NULL,
00755 status,STOCHASTICMCH_ENULLP,STOCHASTICMCH_MSGENULLP);
00756 ASSERT(MCinput->calfuncs2.responseFunction->data->data !=NULL,
00757 status,STOCHASTICMCH_ENULLP,STOCHASTICMCH_MSGENULLP);
00758
00759 ASSERT(MCinput->calfuncs1.sensingFunction->data !=NULL,status,
00760 STOCHASTICMCH_ENULLP,STOCHASTICMCH_MSGENULLP);
00761 ASSERT(MCinput->calfuncs2.sensingFunction->data !=NULL,status,
00762 STOCHASTICMCH_ENULLP,STOCHASTICMCH_MSGENULLP);
00763 ASSERT(MCinput->calfuncs1.sensingFunction->data->data !=NULL,
00764 status, STOCHASTICMCH_ENULLP,STOCHASTICMCH_MSGENULLP);
00765 ASSERT(MCinput->calfuncs2.sensingFunction->data->data !=NULL,
00766 status,STOCHASTICMCH_ENULLP,STOCHASTICMCH_MSGENULLP);
00767
00768 ASSERT(MCinput->calfacts1.openLoopFactor->data !=NULL,status,
00769 STOCHASTICMCH_ENULLP,STOCHASTICMCH_MSGENULLP);
00770 ASSERT(MCinput->calfacts2.openLoopFactor->data !=NULL,status,
00771 STOCHASTICMCH_ENULLP,STOCHASTICMCH_MSGENULLP);
00772 ASSERT(MCinput->calfacts1.openLoopFactor->data->data !=NULL,
00773 status,STOCHASTICMCH_ENULLP,STOCHASTICMCH_MSGENULLP);
00774 ASSERT(MCinput->calfacts2.openLoopFactor->data->data !=NULL,
00775 status,STOCHASTICMCH_ENULLP,STOCHASTICMCH_MSGENULLP);
00776
00777 ASSERT(MCinput->calfacts1.sensingFactor->data !=NULL,status,
00778 STOCHASTICMCH_ENULLP,STOCHASTICMCH_MSGENULLP);
00779 ASSERT(MCinput->calfacts2.sensingFactor->data !=NULL,status,
00780 STOCHASTICMCH_ENULLP,STOCHASTICMCH_MSGENULLP);
00781 ASSERT(MCinput->calfacts1.sensingFactor->data->data !=NULL,
00782 status,STOCHASTICMCH_ENULLP,STOCHASTICMCH_MSGENULLP);
00783 ASSERT(MCinput->calfacts2.sensingFactor->data->data !=NULL,
00784 status,STOCHASTICMCH_ENULLP,STOCHASTICMCH_MSGENULLP);
00785
00786
00787
00788
00789
00790 ASSERT(MCparams->lengthseg > 0, status,
00791 STOCHASTICMCH_ENULLLEN,STOCHASTICMCH_MSGENULLLEN);
00792
00793
00794 ASSERT(MCparams->numseg > 0, status,
00795 STOCHASTICMCH_ENULLSEG,STOCHASTICMCH_MSGENULLSEG);
00796
00797
00798 ASSERT(MCparams->sRate > 0, status,
00799 STOCHASTICMCH_ENULLSRATE,STOCHASTICMCH_MSGENULLSRATE);
00800
00801
00802
00803
00804
00805
00806
00807
00808 if (MCparams->f0 < 0)
00809 {
00810 ABORT(status,STOCHASTICMCH_ENEGFMIN,STOCHASTICMCH_MSGENEGFMIN );
00811 }
00812
00813
00814
00815
00816 calfuncs1 = MCinput->calfuncs1;
00817 calfuncs2 = MCinput->calfuncs2;
00818 calfacts1 = MCinput->calfacts1;
00819 calfacts2 = MCinput->calfacts2;
00820
00821
00822
00823 fRef = MCparams->fRef;f0 = MCparams->f0;
00824 omegaRef = MCparams->omegaRef; alpha = MCparams->alpha;
00825 site1 = MCparams->site1; site2 = MCparams->site2;
00826 starttime = MCparams->starttime;
00827 lengthseg = MCparams->