Changeset 358 in Sophya for trunk/Poubelle/archTOI.old/toiiter.cc


Ignore:
Timestamp:
Aug 6, 1999, 3:46:37 PM (26 years ago)
Author:
ansari
Message:

auxilliary GPS

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Poubelle/archTOI.old/toiiter.cc

    r350 r358  
    3838 lastSample = -1;
    3939 maxLookAhead = 10000;
     40 
     41 auxGPS = NULL;
    4042
    4143}
     
    7274  lastSample = x.lastSample;
    7375  maxLookAhead = x.maxLookAhead;
     76 
     77  auxGPS = x.auxGPS;
     78  if (auxGPS) auxGPS = auxGPS->clone();
    7479}
    7580
     
    7883  delete rawIter;
    7984  delete[] interp;
     85  delete auxGPS;
    8086}
    8187
     
    311317  while (1) {
    312318    if (!NextSample()) return false; // end of files
    313     double t = tBlock0+(file->blockNum() * file->nEchBlock() + imes) * perEch/86400.;
     319    double t = getMJD();
    314320    if (t < tStart) continue;
    315321    if (t > tEnd) return false;
     
    378384bool TOIIter::canGetValue(int column) {
    379385   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   }
    380392   if (rawIter) {
    381393       return interp[column].canGet(lastSample);
    382394   }
    383    TOIKind kind = infos[column].kind;
    384395   int index = infos[column].index;
    385396   switch (kind) {
     
    418429double TOIIter::getValue(int column) {
    419430   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   }
    420440   if (rawIter) {
    421441     if (infos[column].interpolated)
     
    424444       return interp[column].getEValue(lastSample);
    425445   }
    426    TOIKind kind = infos[column].kind;
    427446   int index = infos[column].index;
    428447   switch (kind) {
    429448     case sampleNum:
    430        return file->blockNum() * file->nEchBlock() + imes;
     449       return getSampleIndex();
    431450     case internalTime:
    432        //return (file->blockNum() * file->nEchBlock() + imes) * file->perEchant();
    433        return (file->blockNum() * file->nEchBlock() + imes) * perEch;
     451       return getSampleIndex() * perEch;
    434452     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();
    442454     case boloTens:
    443455       return file->getMuVBolo(index, imes);
     
    474486bool   TOIIter::newValue(int column) {
    475487   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   }
    476493   if (rawIter) {
    477494       return interp[column].isNewValue(lastSample);
    478495   }
    479    TOIKind kind = infos[column].kind;
    480496   switch (kind) {
    481497     case sampleNum:
     
    567583   }
    568584}
     585
     586double TOIIter::getMJD() {
     587  int sample = getSampleIndex();
     588  return tBlock0 + sample*perEch/86400.;
     589}
    569590 
    570591bool TOIIter::fetchAhead() { // Seulement si delegation
Note: See TracChangeset for help on using the changeset viewer.