Exemple #1
0
TEST(testEndToEnd,checkFit){
    pulsar _psr;
    pulsar *psr = &_psr;
    MAX_PSR=1;
    char timFile[MAX_PSR][MAX_FILELEN],parFile[MAX_PSR][MAX_FILELEN];
    char** argv=NULL;
    int npsr=1;
    initialise(psr,0); /* Initialise all */

    strcpy(parFile[0],DATDIR "/test3b.par");
    strcpy(timFile[0],DATDIR "/test3.tim");

    readParfile(psr,parFile,timFile,npsr);
    readTimfile(psr,timFile,npsr);
    preProcessSimple(psr);

    psr->noWarnings=2;
    formBatsAll(psr,npsr);
    formResiduals(psr,npsr,0);
    doFitAll(psr,npsr,"NULL");
    formBatsAll(psr,npsr);
    formResiduals(psr,npsr,0);
    doFitAll(psr,npsr,"NULL");

    formBatsAll(psr,npsr);
    formResiduals(psr,npsr,0);
    for(int iobs = 0; iobs < psr->nobs; iobs++){
        ASSERT_LT(static_cast<double>(fabsl(psr->obsn[iobs].residual)),TEST_DELTA) << "Fitting has caused error";
    }

}
Exemple #2
0
TEST(testEndToEnd,gracefulBadFit){
    pulsar _psr;
    pulsar *psr = &_psr;
    MAX_PSR=1;
    char timFile[MAX_PSR][MAX_FILELEN],parFile[MAX_PSR][MAX_FILELEN];
    char** argv=NULL;
    int npsr=1;
    initialise(psr,0); /* Initialise all */

    strcpy(parFile[0],DATDIR "/test3c.par");
    strcpy(timFile[0],DATDIR "/test3.tim");

    readParfile(psr,parFile,timFile,npsr);
    readTimfile(psr,timFile,npsr);
    preProcessSimple(psr);

    psr->noWarnings=2;
    formBatsAll(psr,npsr);
    formResiduals(psr,npsr,0);
    TK_errorCount=0;
    doFitAll(psr,npsr,"NULL");
//    ASSERT_GT(TK_errorCount,1u);
ASSERT_EQ(1,1);
    TK_errorCount=0;
    
}
Exemple #3
0
void callFit(pulsar *psr,int npsr)
{
  int iteration;
  double globalParameter = 0.0;

  for (iteration=0;iteration<2;iteration++)
    {
      formBatsAll(psr,npsr);
      formResiduals(psr,npsr,1);
      /* Do the fitting */
      if (iteration==0) doFitAll(psr,npsr,covarFuncFile2);
      else textOutput(psr,npsr,globalParameter,0,0,0,"");
    }

}