Changeset 358 in Sophya
- Timestamp:
- Aug 6, 1999, 3:46:37 PM (26 years ago)
- Location:
- trunk/Poubelle/archTOI.old
- Files:
-
- 5 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Poubelle/archTOI.old/archtoi.cc
r356 r358 11 11 #include "toisvr.h" 12 12 #include "archtoi.h" 13 #include "asigps.h" 13 14 14 15 using namespace std; … … 159 160 sscanf(arg.c_str(), "%lg", &t0); 160 161 svr.SetPerEch(t0); 162 } else if (key == "#ASIGPS") { 163 ASIGPS* gps = new ASIGPS(arg); 164 gps->FitsDump("GPSDump.fits"); 165 svr.UseAuxGPS(gps); 161 166 } else if (key == "#END") { 162 167 return false; -
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 -
trunk/Poubelle/archTOI.old/toiiter.h
r350 r358 11 11 #include <string> 12 12 #include "archeopsfile.h" 13 #include "auxgps.h" 13 14 14 15 enum TOIKind { … … 61 62 int getBlockSampleIndex(); // numero d''echantillon dans dernier bloc bolo 62 63 int getSampleIndex(); // numero d''echantillon 64 double getMJD(); 63 65 64 66 block_type_param* lastParam(); … … 125 127 bool fetchAhead(); // avance d''une TOI en nourrissant les interpolateurs 126 128 129 AuxGPS* auxGPS; 130 127 131 private: 128 132 }; -
trunk/Poubelle/archTOI.old/toisvr.cc
r350 r358 15 15 iter.files.insert(f); 16 16 } 17 18 void TOISvr::UseAuxGPS(AuxGPS* gps) { 19 if (iter.auxGPS) delete iter.auxGPS; 20 iter.auxGPS = gps; 21 } 22 17 23 18 24 void TOISvr::SetMJD0(double t0) { -
trunk/Poubelle/archTOI.old/toisvr.h
r350 r358 7 7 8 8 #include "toiiter.h" 9 10 class AuxGPS; 9 11 10 12 class TOISvr { … … 17 19 void SetMJD0(double); 18 20 void SetPerEch(double); 21 void UseAuxGPS(AuxGPS* gps); 19 22 20 23 void SetTimeInterval(double tStart, double tEnd);
Note:
See TracChangeset
for help on using the changeset viewer.