Ignore:
Timestamp:
Oct 29, 2001, 11:42:20 PM (24 years ago)
Author:
aubourg
Message:

fits reader pour fichers sans samplenum, level s planck

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ArchTOIPipe/Kernel/fitstoirdr.cc

    r1721 r1725  
    1313  fptr = NULL;
    1414  totnscount = 0;
     15
     16  implicitSN = false;
     17  implicitSNStart = 0;
    1518}
    1619
    1720FITSTOIReader::~FITSTOIReader() {
     21}
     22
     23void FITSTOIReader::setImplicitSN(int snStart) {
     24  implicitSN = true;
     25  implicitSNStart = snStart;
    1826}
    1927
     
    6169
    6270  cout << "FITSTOIReader cols = " << ncols << " rows=" << nrows << endl;
    63   int anyNul;
    64   double y;
    65   fits_read_col_dbl(fptr,1,1,1,1,0,&y,&anyNul,&fstatus);
    66   firstSn = (int) (y+.1);
     71  if (implicitSN) {
     72    firstSn = implicitSNStart;
     73  } else {
     74    int anyNul;
     75    double y;
     76    fits_read_col_dbl(fptr,1,1,1,1,0,&y,&anyNul,&fstatus);
     77    firstSn = (int) (y+.1);
     78  }
    6779  fits_unlock(); 
    6880}
     
    7284
    7385  fits_lock();
    74   // Dans cette version, on s'attend a ce que la premiere colonne soit le samplenum
     86  // si pas implicitSN, la premiere colonne est le sampleNum.
     87  // Sinon, le samplenum est la fitsline + offset.
    7588  int itoi=-1;
    76   for (int i=1; i<ncols; i++) {
     89  int col1 = implicitSN ? 0 : 1;
     90  for (int i=col1; i<ncols; i++) {
    7791    char templt[10];
    7892    sprintf(templt, "%d", i+1);
     
    122136}
    123137
     138// run 1 : deprecated. NON MAINTENU. Incompatible avec implicit SN.
    124139void FITSTOIReader::run1() {
    125140  // Il faudrait optimiser en fonction de ce qui a ete demande comme samplenum,
     
    206221     int anyNul;
    207222     fits_lock();
    208      fits_read_col_dbl(fptr,1,ideb+1,1,n,0,samplenum,&anyNul,&fstatus);
     223     if (implicitSN) {
     224       for (long j=0; j<Buff_Sz; j++) {
     225         samplenum[j] = j+ideb+implicitSNStart;
     226       }
     227     } else {
     228       fits_read_col_dbl(fptr,1,ideb+1,1,n,0,samplenum,&anyNul,&fstatus);
     229     }
    209230     for(int k=0; k<getNOut(); k++) {
    210231       if(colval[k]==NULL)  continue;
Note: See TracChangeset for help on using the changeset viewer.