Changeset 358 in Sophya for trunk/Poubelle/archTOI.old/toiiter.cc
- Timestamp:
- Aug 6, 1999, 3:46:37 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Poubelle/archTOI.old/toiiter.cc
r350 r358 38 38 lastSample = -1; 39 39 maxLookAhead = 10000; 40 41 auxGPS = NULL; 40 42 41 43 } … … 72 74 lastSample = x.lastSample; 73 75 maxLookAhead = x.maxLookAhead; 76 77 auxGPS = x.auxGPS; 78 if (auxGPS) auxGPS = auxGPS->clone(); 74 79 } 75 80 … … 78 83 delete rawIter; 79 84 delete[] interp; 85 delete auxGPS; 80 86 } 81 87 … … 311 317 while (1) { 312 318 if (!NextSample()) return false; // end of files 313 double t = tBlock0+(file->blockNum() * file->nEchBlock() + imes) * perEch/86400.;319 double t = getMJD(); 314 320 if (t < tStart) continue; 315 321 if (t > tEnd) return false; … … 378 384 bool TOIIter::canGetValue(int column) { 379 385 if (column < 0 || column >= infos.size()) return false; 386 TOIKind kind = infos[column].kind; 387 if (auxGPS && 388 (kind == longitude || kind == latitude || kind == altitude)) { 389 double dummy; 390 return auxGPS->getLocation(getMJD(), dummy, dummy, dummy) == 0; 391 } 380 392 if (rawIter) { 381 393 return interp[column].canGet(lastSample); 382 394 } 383 TOIKind kind = infos[column].kind;384 395 int index = infos[column].index; 385 396 switch (kind) { … … 418 429 double TOIIter::getValue(int column) { 419 430 if (column < 0 || column >= infos.size()) return -1; 431 TOIKind kind = infos[column].kind; 432 if (auxGPS && 433 (kind == longitude || kind == latitude || kind == altitude)) { 434 double lat,lon,alt; 435 if (auxGPS->getLocation(getMJD(), lat, lon, alt)) return -99999; 436 if (kind == longitude) return lon; 437 if (kind == latitude) return lat; 438 if (kind == altitude) return alt; 439 } 420 440 if (rawIter) { 421 441 if (infos[column].interpolated) … … 424 444 return interp[column].getEValue(lastSample); 425 445 } 426 TOIKind kind = infos[column].kind;427 446 int index = infos[column].index; 428 447 switch (kind) { 429 448 case sampleNum: 430 return file->blockNum() * file->nEchBlock() + imes;449 return getSampleIndex(); 431 450 case internalTime: 432 //return (file->blockNum() * file->nEchBlock() + imes) * file->perEchant(); 433 return (file->blockNum() * file->nEchBlock() + imes) * perEch; 451 return getSampleIndex() * perEch; 434 452 case mjd: 435 /* printf("mjd: %d %d %g %g %g\n",file->blockNum(), 436 (file->blockNum() * file->nEchBlock() + imes), 437 file->perEchant(), 438 (file->blockNum() * file->nEchBlock() + imes) * file->perEchant()/86400., 439 tBlock0+(file->blockNum() * file->nEchBlock() + imes) * file->perEchant()/86400.); */ 440 //return tBlock0+(file->blockNum() * file->nEchBlock() + imes) * file->perEchant()/86400.; 441 return tBlock0+(file->blockNum() * file->nEchBlock() + imes) * perEch/86400.; 453 return getMJD(); 442 454 case boloTens: 443 455 return file->getMuVBolo(index, imes); … … 474 486 bool TOIIter::newValue(int column) { 475 487 if (column < 0 || column >= infos.size()) return false; 488 TOIKind kind = infos[column].kind; 489 if (auxGPS && 490 (kind == longitude || kind == latitude || kind == altitude)) { 491 return true; 492 } 476 493 if (rawIter) { 477 494 return interp[column].isNewValue(lastSample); 478 495 } 479 TOIKind kind = infos[column].kind;480 496 switch (kind) { 481 497 case sampleNum: … … 567 583 } 568 584 } 585 586 double TOIIter::getMJD() { 587 int sample = getSampleIndex(); 588 return tBlock0 + sample*perEch/86400.; 589 } 569 590 570 591 bool TOIIter::fetchAhead() { // Seulement si delegation
Note:
See TracChangeset
for help on using the changeset viewer.