Changeset 1725 in Sophya


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

fits reader pour fichers sans samplenum, level s planck

Location:
trunk/ArchTOIPipe/Kernel
Files:
3 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;
  • trunk/ArchTOIPipe/Kernel/fitstoirdr.h

    r1717 r1725  
    1515  FITSTOIReader(string fn,int buff_sz=1000);
    1616  ~FITSTOIReader();
     17
     18  void         setImplicitSN(int snStart=0);
    1719
    1820  virtual void addFile(string fn);
     
    4244  int       snBegin; // first file
    4345  int       snEnd;   // last file
     46
     47  bool      implicitSN;
     48  int       implicitSNStart;
    4449 
    4550  vector<string> allfn;
  • trunk/ArchTOIPipe/Kernel/toiprocessor.cc

    r1689 r1725  
    246246  for (int i=0; i<n; i++) {
    247247    TOI* toi = outTOIs[i];
    248     toi->putDone();
     248    if (toi) {
     249      toi->putDone();
     250    }
    249251  }
    250252}
Note: See TracChangeset for help on using the changeset viewer.