Changeset 432 in Sophya for trunk/Poubelle


Ignore:
Timestamp:
Sep 24, 1999, 4:06:09 PM (26 years ago)
Author:
ansari
Message:

en cours

Location:
trunk/Poubelle/archTOI.old
Files:
11 edited

Legend:

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

    r429 r432  
    900900  int expo = data[iExp] & 0xf;
    901901  int noise = 1 << expo;
    902   return (noise << 1)/double(nb_coups);
     902  return (noise << 1)/double(nb_coups)/2.;
    903903}
    904904
     
    10391039  int expo = data[iExp] & 0xf;
    10401040  int noise = 1 << expo;
    1041   return noise;
     1041  return noise/2.;
    10421042}
    10431043
  • trunk/Poubelle/archTOI.old/archparam.cc

    r394 r432  
    1212ArchParam::AcqParam::AcqParam()
    1313: tBlock0   (1376.8358818),
    14   perEch    (0.005836818076)
     14  perEch    (0.005836818076),
     15  utcOrigin (1376.5)
    1516{}
    1617
     
    3031  cout << "   tBlock0      " << acq.tBlock0    << "\n";
    3132  cout << "   perEch       " << acq.perEch     << "\n";
     33  cout << "   utcOrigin    " << acq.utcOrigin  << "\n";
    3234  cout << " **GEOM\n";
    3335  cout << " **SST\n";
  • trunk/Poubelle/archTOI.old/archparam.h

    r394 r432  
    99    double tBlock0;  // MJD du bloc numero zero...
    1010    double perEch;   // periode d''echantillonage en secondes
     11    double utcOrigin;
    1112    AcqParam();
    1213  };
  • trunk/Poubelle/archTOI.old/archtoi.cc

    r426 r432  
    5454  format = ascii_fmt;
    5555  undef  = "#";
     56  undefV = -99999;
    5657  allBolos = false;
    5758  fptr = NULL;
     
    9293  } else if (key == "#UNDEF") {
    9394    undef=arg;
     95    if (undef[0] >= '0' && undef[0] <= '9')
     96      undefV = atoi(undef.c_str());
    9497  } else if (key == "#ALLBOLOS") {
    9598    allBolos=true;
     
    316319
    317320void ArchTOI::outValue_F(int icolumn, double value, bool notdef) {
     321  if (notdef && undef != "#") {
     322    notdef = false;
     323    value = undefV;
     324  }
    318325  if (notdef) {
    319326    fits_write_col_null(fptr, icolumn+1, fitsLine, 1, 1, &fitsStatus);
  • trunk/Poubelle/archTOI.old/archtoi.h

    r416 r432  
    3838  fmt format;
    3939  string undef;
     40  double undefV;
    4041  bool allBolos; // tous les bolos dans le header. Sinon seulement bolos transmis.
    4142 
  • trunk/Poubelle/archTOI.old/templocator.cc

    r426 r432  
    172172}
    173173
     174double TempLocator::getAlphaCenter(int sampleNum) {
     175  return getAlphaBolo(sampleNum, 11);
     176}
     177
     178double TempLocator::getDeltaCenter(int sampleNum) {
     179  return getDeltaBolo(sampleNum, 11);
     180}
     181
     182
    174183
    175184
  • trunk/Poubelle/archTOI.old/templocator.h

    r426 r432  
    1919  double getAlphaBolo(int sampleNum, int ibolo);
    2020  double getDeltaBolo(int sampleNum, int ibolo);
     21  double getAlphaCenter(int sampleNum);
     22  double getDeltaCenter(int sampleNum);
    2123 
    2224  void getAltAzBolo(int sampleNum, int ibolo, double& elv, double& az);
  • trunk/Poubelle/archTOI.old/toiiter.cc

    r426 r432  
    3636 tStart = -9.e99;
    3737 tEnd   = 9.e99;
     38 utcStart = -9.e99;
     39 utcEnd   = 9.e99;
     40 
     41 sStart = -999999999;
     42 sEnd   =  999999999;
    3843 
    3944 //tBlock0 = -1;
     
    6166  if (x.initDone && x.curFile != x.files.end()) curFile = files.find(*(x.curFile));
    6267  isOnBoardRecorder = x.isOnBoardRecorder;
    63   imes = x.imes;
    64   tStart = x.tStart;
    65   tEnd = x.tEnd;
     68  imes   = x.imes;
     69 
     70  tStart   = x.tStart;
     71  tEnd     = x.tEnd;
     72  utcStart = x.utcStart;
     73  utcEnd   = x.utcEnd;
     74  sStart   = x.sStart;
     75  sEnd     = x.sEnd;
     76 
    6677  trigMask = x.trigMask;
    6778  infos = x.infos;   
     
    108119 if (initDone) return;
    109120 initDone = true;
     121 if (utcStart > 0) {
     122   double t = (utcStart/24.) + archParam.acq.utcOrigin;
     123   if (t > tStart) tStart=t;
     124 }
     125 if (utcEnd > 0) {
     126   double t = (utcEnd/24.) + archParam.acq.utcOrigin;
     127   if (t < tEnd) tEnd=t;
     128 }
    110129 // On a soit un repertoire, soit une liste de fichiers....
    111130  if (directory == "") {
     
    215234    if ((*i).triggering) {
    216235      switch ((*i).kind) {
    217       case boloTens:
    218       case boloTens2:
    219       case boloRaw:
    220       case boloRawCN:
    221       case boloTensCN:
     236      case boloMuV:
     237      case boloMuV2:
     238      case boloRawMuV:
     239      case boloRawMuVCN:
    222240        trigMask |= block_bolo_mask;
    223241        break;
    224       case boloTens2T:
     242      case boloMuV2T:
    225243      case boloRes:
    226244      case boloTemp:
    227245         trigMask |= block_bolo_mask | block_reglage_mask;
    228246        break;
    229      case dilDAC:
     247      case dilDAC:
    230248      case dilSwitch:
    231249        trigMask |= block_dilution_mask;
     
    241259        trigMask |= block_gps_mask;
    242260        break;
    243       case azimutBolo:
     261      case azimuthBolo:
    244262        trigMask |= block_bolo_mask;
    245263        //file->needSSTProcessMask(SSTHandler::findPeriod);
     
    263281        break;
    264282      case gyroRaw:
    265       case gyroTens:
     283      case gyroV:
    266284        trigMask |= block_gyro_mask;
    267285        break;
     
    269287        trigMask |= block_gyro_mask; // $CHECK$ + info to calibrate gyros
    270288        break;
    271       case alphaAxis:
    272       case deltaAxis:
     289      case alphaRotAxis:
     290      case deltaRotAxis:
    273291      case alphaSst:
    274292      case deltaSst:
     293      case alphaFPAxis:
     294      case deltaFPAxis:
    275295      case alphaBolo:
    276296      case deltaBolo:
     
    278298        //file->needSSTProcessMask(SSTHandler::findAxis);
    279299        //trigMask |= block_sst_mask;
     300        break;
     301      case alphaZenith:
     302      case deltaZenith:
     303        trigMask |= block_gps_mask;
    280304        break;
    281305      }
     
    323347    double smp = file1stSamp[*i];
    324348    double t   = archParam.acq.tBlock0 + smp * archParam.acq.perEch/86400.;
    325     if (t>tEnd) {  // premier echantillon apres tEnd
     349    if (t>tEnd || smp>sEnd) {  // premier echantillon apres tEnd
    326350     files.erase(*i);
    327351     prev = "";
    328352     continue;
    329353    }
    330     if (t<tStart) { // premier echantillon avant tStart -> on vire le precedent si existe
     354    if (t<tStart || smp<sStart) { // premier echantillon avant tStart -> on vire le precedent si existe
    331355      if (prev != "") {
    332356        files.erase(prev);
     
    436460   TOIKind kind = infos[column].kind;
    437461   if (auxGPS &&
    438        (kind == longitude || kind == latitude || kind == altitude || kind == tsid)) {
     462       (kind == longitude || kind == latitude || kind == altitude || kind == tsid ||
     463        kind == alphaZenith || kind == deltaZenith)) {
    439464         double dummy;
    440465         return auxGPS->getLocation(getMJD(), dummy, dummy, dummy) == 0;
     
    448473   case internalTime:
    449474   case mjd:
     475   case mutc:
    450476     return true;
    451    case boloTens:
    452    case boloTens2:
    453    case boloTens2T:
     477   case boloMuV:
     478   case boloMuV2:
     479   case boloMuV2T:
    454480   case boloRes:
    455    case boloRawCN:
     481   case boloRawMuVCN:
    456482     if (imes==0 && file->llastBolo()==NULL) return false;
    457483     return file->lastBolo() != NULL;
    458    case boloTensCN:
    459    case boloRaw:
     484   case boloRawMuV:
    460485     return file->lastBolo() != NULL;
    461486   case boloGainAmpli:
     
    480505   }
    481506   case gyroRaw:
    482    case gyroTens:
     507   case gyroV:
    483508   case gyroSpeed:
    484509     return (file->lastGyro() != NULL);
     
    487512   case longitude:
    488513   case latitude:
     514   case alphaZenith:
     515   case deltaZenith:
    489516     return file->hasGPSPos();
    490517   case altitude:
     
    492519   case tsid:
    493520     return file->hasGPSPos();
    494    case azimutBolo:
    495    case alphaAxis:
    496    case deltaAxis:
     521   case azimuthBolo:
     522   case alphaRotAxis:
     523   case deltaRotAxis:
     524   case alphaFPAxis:
     525   case deltaFPAxis:
    497526   case alphaBolo:
    498527   case deltaBolo:
     
    525554           return tSid.getLST(getMJD());
    526555         }
     556         
    527557   }
    528558   if (rawIter) {
     
    540570   case mjd:
    541571     return getMJD();
    542    case boloTens:
     572   case mutc:
     573     return (getMJD()-archParam.acq.utcOrigin)*24.;
     574   case boloMuV:
    543575     return file->getMuVBolo(index, imes);
    544    case boloTens2:
     576   case boloMuV2:
    545577     return file->getMuVBolo2(index, imes);
    546    case boloRaw:
     578   case boloRawMuV:
    547579     return file->getRawBolo(index, imes);
    548    case boloRawCN:
    549      return file->getRawBoloCN(index, imes);
    550    case boloTensCN:
     580   case boloRawMuVCN:
    551581     return file->getMuVBoloCN(index, imes);
    552582   case boloGainAmpli:
     
    556586   case boloDACI:
    557587     return file->getDACI(index);
    558    case boloTens2T:
     588   case boloMuV2T:
    559589     return file->getMuVBolo2T(index, imes);
    560590   case boloRes:
     
    582612   case gyroRaw:
    583613     return file->getGyroRaw(index, imes);
    584    case gyroTens:
     614   case gyroV:
    585615     return file->getGyroTens(index, imes);
    586616   case gyroSpeed:
     
    597627     tSid.setLongitude(file->getGPSLong());
    598628     return tSid.getLST(getMJD());
    599    case azimutBolo:
    600    case alphaAxis:
    601    case deltaAxis:
     629   case azimuthBolo:
     630   case alphaRotAxis:
     631   case deltaRotAxis:
     632   case alphaFPAxis:
     633   case deltaFPAxis:
     634   case alphaZenith:
     635   case deltaZenith:
    602636   case alphaBolo:
    603637   case deltaBolo: {
     
    614648        tempLocator.setEarthPos(lon, lat);
    615649        tempLocator.setTSid(ts);
    616         if ((kind) == alphaAxis) return tempLocator.getAlphaZenith();
    617         if ((kind) == deltaAxis) return tempLocator.getDeltaZenith();
    618         if ((kind) == azimutBolo) return tempLocator.getAzimutBolo(getSampleIndex(),index);
     650        if ((kind) == alphaRotAxis) return tempLocator.getAlphaZenith();
     651        if ((kind) == deltaRotAxis) return tempLocator.getDeltaZenith();
     652        if ((kind) == alphaZenith) return tempLocator.getAlphaZenith();
     653        if ((kind) == deltaZenith) return tempLocator.getDeltaZenith();
     654        if ((kind) == azimuthBolo) return tempLocator.getAzimutBolo(getSampleIndex(),index);
    619655        if ((kind) == alphaBolo) return tempLocator.getAlphaBolo(getSampleIndex(),index);
    620656        if ((kind) == deltaBolo) return tempLocator.getDeltaBolo(getSampleIndex(),index);
     657        if ((kind) == alphaFPAxis) return tempLocator.getAlphaCenter(getSampleIndex());
     658        if ((kind) == deltaFPAxis) return tempLocator.getDeltaCenter(getSampleIndex());
    621659        return 0;
    622660     }
     
    640678     case internalTime:
    641679     case mjd:
     680     case mutc:
    642681     case tsid:
    643682       return true;
    644      case boloTens:
    645      case boloTens2:
    646      case boloTens2T:
     683     case boloMuV:
     684     case boloMuV2:
     685     case boloMuV2T:
    647686     case boloRes:
    648687       return file->blockNum() == file->getBoloBlockNum();
    649      case boloRaw:
    650      case boloRawCN:
    651      case boloTensCN:
     688     case boloRawMuV:
     689     case boloRawMuVCN:
    652690       return file->blockNum() == file->getBoloBlockNum();
    653691     case boloGainAmpli:
     
    670708       return file->blockNum() == file->getSSTCompBlockNum();
    671709     case gyroRaw:
    672      case gyroTens:
     710     case gyroV:
    673711     case gyroSpeed:
    674712       return file->blockNum() == file->getGyroBlockNum();
     
    681719     case altitude:
    682720       return file->blockNum() == file->getGPSBlockNum() && imes==0;
    683      case azimutBolo:
     721     case azimuthBolo:
    684722     case alphaBolo:
    685723     case deltaBolo:
     724     case alphaZenith:
     725     case deltaZenith:
     726     case alphaFPAxis:
     727     case deltaFPAxis:
    686728       return true; // $CHECK$ with SSTHandler
    687      case alphaAxis:
     729     case alphaRotAxis:
    688730       return true; // $CHECK$ with SSTHandler
    689      case deltaAxis:
     731     case deltaRotAxis:
    690732       return true; // $CHECK$ with SSTHandler
    691733   }
  • trunk/Poubelle/archTOI.old/toiiter.h

    r426 r432  
    1717  sampleNum,     // Numero d''echantillon (timer interne transputer)
    1818  internalTime,  // temps transputer depuis debut manip, en secondes.
    19   mjd,           // UTC (en jours, MJD = JD - 2450000). index=0 : premier bloc GPS. 1: + sioux.
    20   boloTens,      // tension en microVolts, filtree avec filtre carre indexe par bolometre
    21   boloTens2,     // tension en microVolts, avec soustraction offset filtre
    22   boloRaw,       // tension brute en microVolts, non filtree indexe par bolometre, sans chgt signe
     19  mjd,           // UTC (en jours, MJD = JD - 2450000).
     20  mutc,          // UTC en heure, avec soustraction d'origine
     21  boloMuV,       // tension en microVolts, filtree avec filtre carre indexe par bolometre
     22  boloMuV2,      // tension en microVolts, avec soustraction offset filtre
     23  boloRawMuV,    // tension brute en microVolts, non filtree indexe par bolometre, sans chgt signe
    2324  boloTemp,      // Kelvins, need R(T) -> N/A
    24   boloGainAmpli, // gain de l'ampli du bolo
    2525  boloDACV,      // tension de reference du DAC (microVolts)
    2626  boloDACI,      // courant (microAmps)
    27   boloRawCN,     // compression noise on bolo raw
    28   boloTensCN,    // compression noise on bolo (microVolts), no filter
    29   boloTens2T,    // total, microVolts, avec consigne DAC
     27  boloRawMuVCN,  // compression noise on bolo (microVolts), no filter
     28  boloMuV2T,     // total, microVolts, avec consigne DAC
    3029  boloRes,       // Resistance, ohms
     30  boloGainAmpli, //
    3131  dilDAC,        // dilution DAC, index = 0-47
    3232  dilSwitch,     // dilution, mot de 32 bits
     33  serviceTemp,   // service temperature, K
    3334  sstDiode,      // signal brut SST, indice = diode, 0-45
    3435  sstChannel,    // signal brut SST, indice = canal, 0-47
     
    4041  sstStarT,      // temps d''une eventuelle etoile,            <0 si moins de i+1 etoiles
    4142  gyroRaw,       // valeur brute du gyro, index = 0,1,2
    42   gyroTens,      // tension gyro, V, index = 0,1,2
     43  gyroV,         // tension gyro, V, index = 0,1,2
    4344  gyroSpeed,     // vitesse gyro, deg/s, index = 0,1,2, calibree...
    4445  gpsTime,       // temps fourni par GPS
     
    4748  altitude,      // position ballon, m
    4849  tsid,          // temps sideral en secondes
    49   azimutBolo,    // azimut
    50   alphaAxis,     //
    51   deltaAxis,     //
     50  azimuthBolo,   // azimut
     51  alphaRotAxis,  //
     52  deltaRotAxis,  //
     53  alphaZenith,   //
     54  deltaZenith,   //
    5255  alphaSst,      //
    5356  deltaSst,      //
     57  alphaFPAxis,   //
     58  deltaFPAxis,   //
    5459  alphaBolo,     // sur le ciel, indexe par bolometre
    5560  deltaBolo      // sur le ciel, indexe par bolometre
     
    117122   int imes;
    118123   
    119    double tStart, tEnd;
     124   double tStart, tEnd;      // MJD
     125   double utcStart, utcEnd;  // UTC, will be converted towards tStart tEnd at init
     126   long   sStart, sEnd;      // samplenum
    120127   
    121128   //double tBlock0;  // MJD du bloc numero zero...
  • trunk/Poubelle/archTOI.old/toisvr.cc

    r426 r432  
    3636
    3737 
    38 void TOISvr::setTimeInterval(double tStart, double tEnd) {
     38void TOISvr::setMJDInterval(double tStart, double tEnd) {
    3939  if (tStart>0) iter.tStart = tStart;
    4040  if (tEnd>0)   iter.tEnd = tEnd;
    4141}
     42
     43void TOISvr::setUTCInterval(double tStart, double tEnd) {
     44  if (tStart>0) iter.utcStart = tStart;
     45  if (tEnd>0)   iter.utcEnd = tEnd;
     46}
     47
     48void TOISvr::setSNInterval(long tStart, long tEnd) {
     49  if (tStart>0) iter.sStart = tStart;
     50  if (tEnd>0)   iter.sEnd = tEnd;
     51}
     52
    4253
    4354void TOISvr::setUnderSample(int n) {
     
    110121    else tsttoi(internalTime)
    111122    else tsttoi(mjd)
    112     else tsttoi(boloTens)
    113     else tsttoi(boloTens2)
    114     else tsttoi(boloRaw)
     123    else tsttoi(mutc)
     124    else tsttoi(boloMuV)
     125    else tsttoi(boloMuV2)
     126    else tsttoi(boloRawMuV)
    115127    else tsttoi(boloRes)
    116128    else tsttoi(boloTemp)
     
    118130    else tsttoi(boloDACV)
    119131    else tsttoi(boloDACI)
    120     else tsttoi(boloTens2T)
    121     else tsttoi(boloRawCN)
    122     else tsttoi(boloTensCN)
     132    else tsttoi(boloMuV2T)
     133    else tsttoi(boloRawMuVCN)
    123134    else tsttoi(dilDAC)
    124135    else tsttoi(dilSwitch)
     136    else tsttoi(serviceTemp)
    125137    else tsttoi(sstDiode)
    126138    else tsttoi(sstChannel)
     
    132144    else tsttoi(sstStarT)
    133145    else tsttoi(gyroRaw)
    134     else tsttoi(gyroTens)
     146    else tsttoi(gyroV)
    135147    else tsttoi(gyroSpeed)
    136148    else tsttoi(gpsTime)
     
    139151    else tsttoi(altitude)
    140152    else tsttoi(tsid)
    141     else tsttoi(azimutBolo)
    142     else tsttoi(alphaAxis)
    143     else tsttoi(deltaAxis)
     153    else tsttoi(azimuthBolo)
     154    else tsttoi(alphaRotAxis)
     155    else tsttoi(deltaRotAxis)
    144156    else tsttoi(alphaSst)
    145157    else tsttoi(deltaSst)
     158    else tsttoi(alphaZenith)
     159    else tsttoi(deltaZenith)
     160    else tsttoi(alphaFPAxis)
     161    else tsttoi(deltaFPAxis)
    146162    else tsttoi(alphaBolo)
    147163    else tsttoi(deltaBolo)
     
    150166      return false;
    151167    }
    152     if (kind  == sampleNum || kind == mjd) notrig = true;
     168    if (kind  == sampleNum || kind == mjd || kind == mutc) notrig = true;
    153169    string toiname = keyw.substr(1);
    154170    while (args != "") {
    155171      if (args[0] == ' ') {
    156         args = args.substr(args.find_first_not_of(' '));
     172        x = args.find_first_not_of(' ');
     173        if (x==string::npos) break;
     174        args = args.substr(x);
    157175        if (args == "") break;
    158176      }
     
    196214    arg = arg.substr(arg.find_first_not_of(' '));
    197215  }
    198   if (key == "#TRANGE") {
     216  if (key == "#MJDRANGE") {
    199217    double tmin, tmax;
    200218    sscanf(arg.c_str(), "%lg %lg", &tmin, &tmax);
    201     setTimeInterval(tmin, tmax);
     219    setMJDInterval(tmin, tmax);
     220  } else if (key == "#UTCRANGE") {
     221    double tmin, tmax;
     222    sscanf(arg.c_str(), "%lg %lg", &tmin, &tmax);
     223    setUTCInterval(tmin, tmax);
     224  } else if (key == "#SNRANGE") {
     225    long tmin, tmax;
     226    sscanf(arg.c_str(), "%ld %ld", &tmin, &tmax);
     227    setSNInterval(tmin, tmax);
    202228  } else if (key == "#PATH") {
    203229    setDirectory(arg);
     
    212238    sscanf(arg.c_str(), "%lg", &t0);
    213239    archParam.acq.tBlock0 = t0;
     240  } else if (key == "#UTCORIGIN") {
     241    double t0;
     242    sscanf(arg.c_str(), "%lg", &t0);
     243    archParam.acq.utcOrigin = t0;
    214244  } else if (key == "#PERECH") {
    215245    double t0;
     
    235265  processRequest("#MJD0 1376.8358818");
    236266  processRequest("#PERECH 0.005836818076");
     267  processRequest("#UTCORIGIN 1376.5");
    237268  processRequest("#ASIGPS ASI_GPS_archeops1999.ascii");
    238269  processRequest("#COMMENT Archtoi -- 23 september 1999 -- Eric Aubourg CEA/DAPNIA");
  • trunk/Poubelle/archTOI.old/toisvr.h

    r426 r432  
    2727  void useAuxGPS(AuxGPS* gps);
    2828 
    29   void setTimeInterval(double tStart, double tEnd);
     29  void setMJDInterval(double tStart, double tEnd);
     30  void setUTCInterval(double tStart, double tEnd);
     31  void setSNInterval(long sStart, long sEnd);
    3032  void setUnderSample(int n);
    3133 
Note: See TracChangeset for help on using the changeset viewer.