Changeset 1785 in Sophya


Ignore:
Timestamp:
Nov 22, 2001, 5:54:54 PM (24 years ago)
Author:
cecile
Message:

Includes the possibility to write FITS files without SampleNum column
ex: FITSTOIWriter wtoi(outfile); wtoi.setImplicitSN();

Location:
trunk/ArchTOIPipe/Kernel
Files:
2 edited

Legend:

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

    r1738 r1785  
    33//                               Christophe Magneville
    44//                               Reza Ansari
    5 // $Id: fitstoiwtr.cc,v 1.18 2001-11-08 15:47:45 aubourg Exp $
     5// $Id: fitstoiwtr.cc,v 1.19 2001-11-22 16:54:54 cecile Exp $
    66
    77#include "fitstoiwtr.h"
     
    1616  fname = fn;
    1717  fstatus = 0;
     18  implicitSN = false;
    1819  nCols = 1;
    1920
     
    3132}
    3233
     34void FITSTOIWriter::setImplicitSN() {
     35  implicitSN = true;
     36  nCols = 0;
     37}
    3338
    3439void FITSTOIWriter::addInput(string name, TOI* toi, bool withFlag) {
     
    6671  char** colunits = new (char*[nCols]);
    6772
    68   colnames[0] = "sampleNum";
    69   coltypes[0] = "1D";
    70   colunits[0] = "integer";
    71 
     73  if (!implicitSN) {
     74    colnames[0] = "sampleNum";
     75    coltypes[0] = "1D";
     76    colunits[0] = "integer";
     77  }
     78     
    7279  cout << " FITSTOIWriter::run() - Creating output FITS file: "
    7380       << fname << endl;
     
    139146      //      if ((sn%2000 == 0) || (sn<snb+5))
    140147      //cout << " DBG-B-FitsWriter::run()" << sn << endl;
    141       double xx = sn;
     148     
     149      if (!implicitSN) {
     150        double xx = sn;
     151        fits_write_col_dbl(fptr, 1, fitsLine, 1, 1, &xx, &fstatus);
     152      }
    142153      fits_lock();
    143       fits_write_col_dbl(fptr, 1, fitsLine, 1, 1, &xx, &fstatus);
    144      
     154       
    145155      for (i=0; i<ndata; i++) {
    146156        pair<int,bool> p = colsinput[i];
  • trunk/ArchTOIPipe/Kernel/fitstoiwtr.h

    r1765 r1785  
    55//                               Christophe Magneville
    66//                               Reza Ansari
    7 // $Id: fitstoiwtr.h,v 1.10 2001-11-14 14:12:32 aubourg Exp $
     7// $Id: fitstoiwtr.h,v 1.11 2001-11-22 16:54:54 cecile Exp $
    88
    99
     
    2323  ~FITSTOIWriter();
    2424 
     25  void         setImplicitSN();
    2526  virtual void afterinit();
    2627
     
    3435 
    3536private:
     37  bool      implicitSN;
    3638  string fname;
    3739  fitsfile *fptr;
Note: See TracChangeset for help on using the changeset viewer.