Changeset 358 in Sophya


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

auxilliary GPS

Location:
trunk/Poubelle/archTOI.old
Files:
5 added
5 edited

Legend:

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

    r356 r358  
    1111#include "toisvr.h"
    1212#include "archtoi.h"
     13#include "asigps.h"
    1314
    1415using namespace std;
     
    159160    sscanf(arg.c_str(), "%lg", &t0);
    160161    svr.SetPerEch(t0);
     162  } else if (key == "#ASIGPS") {
     163    ASIGPS* gps = new ASIGPS(arg);
     164    gps->FitsDump("GPSDump.fits");
     165    svr.UseAuxGPS(gps);
    161166  } else if (key == "#END") {
    162167    return false;
  • 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
  • trunk/Poubelle/archTOI.old/toiiter.h

    r350 r358  
    1111#include <string>
    1212#include "archeopsfile.h"
     13#include "auxgps.h"
    1314
    1415enum TOIKind {
     
    6162   int    getBlockSampleIndex();        // numero d''echantillon dans dernier bloc bolo
    6263   int    getSampleIndex();             // numero d''echantillon
     64   double getMJD();           
    6365
    6466   block_type_param*         lastParam(); 
     
    125127   bool fetchAhead(); // avance d''une TOI en nourrissant les interpolateurs
    126128   
     129   AuxGPS* auxGPS;
     130   
    127131   private:
    128132};
  • trunk/Poubelle/archTOI.old/toisvr.cc

    r350 r358  
    1515  iter.files.insert(f);
    1616}
     17
     18void TOISvr::UseAuxGPS(AuxGPS* gps) {
     19  if (iter.auxGPS) delete iter.auxGPS;
     20  iter.auxGPS = gps;
     21}
     22
    1723
    1824void TOISvr::SetMJD0(double t0) {
  • trunk/Poubelle/archTOI.old/toisvr.h

    r350 r358  
    77
    88#include "toiiter.h"
     9
     10class AuxGPS;
    911
    1012class TOISvr {
     
    1719  void SetMJD0(double);
    1820  void SetPerEch(double);
     21  void UseAuxGPS(AuxGPS* gps);
    1922 
    2023  void SetTimeInterval(double tStart, double tEnd);
Note: See TracChangeset for help on using the changeset viewer.