Changeset 1369 in Sophya for trunk/ArchTOIPipe
- Timestamp:
- Jan 3, 2001, 5:59:25 PM (25 years ago)
- Location:
- trunk/ArchTOIPipe/Kernel
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ArchTOIPipe/Kernel/fitstoiwtr.cc
r1365 r1369 10 10 fname = fn; 11 11 fstatus = 0; 12 outFlags = false; 12 13 13 14 // Open file … … 20 21 21 22 FITSTOIWriter::~FITSTOIWriter() { 23 } 24 25 void FITSTOIWriter::setOutFlags(bool yn) { 26 outFlags = yn; 22 27 } 23 28 … … 38 43 } 39 44 40 int ncols = inIx.size(); 45 int ndata = inIx.size(); 46 int ncols = inIx.size() * (outFlags ? 2 : 1) + 1; 41 47 42 48 char** colnames = new (char*[ncols]); … … 44 50 char** colunits = new (char*[ncols]); 45 51 52 colnames[0] = "samplenum"; 53 coltypes[0] = "1D"; 54 colunits[0] = "integer"; 55 46 56 for (map<string, int>::iterator i = inIx.begin(); i != inIx.end(); i++) { 47 57 int j = (*i).second; 48 58 string n = (*i).first; 49 colnames[j] = const_cast<char*>(n.c_str()); 50 coltypes[j] = "1D"; 51 colunits[j] = "?"; 59 if (outFlags) j += j; 60 colnames[j+1] = const_cast<char*>(n.c_str()); 61 coltypes[j+1] = "1D"; 62 colunits[j+1] = "?"; 63 if (outFlags) { 64 colnames[j+2] = const_cast<char*>((n+"_flg").c_str()); 65 coltypes[j+2] = "1D"; 66 colunits[j+2] = "?"; 67 } 52 68 } 53 69 … … 66 82 67 83 int fitsLine = 1; 68 TOIManager* mgr = TOIManager::getManager();69 // int snb = mgr->getRequestedBegin();70 //int sne = mgr->getRequestedEnd();71 84 int snb = getMinIn(); 72 85 int sne = getMaxIn(); … … 74 87 for (int sn = snb; sn <= sne; sn++) { 75 88 try { 76 for (int i=0; i<ncols; i++) { 77 // cout << "wtr req " << sn << endl; 89 fits_lock(); 90 double xx = sn; 91 fits_write_col_dbl(fptr, 1, fitsLine, 1, 1, &xx, &fstatus); 92 fits_unlock(); 93 for (int i=0; i<ndata; i++) { 78 94 double x = getData(i, sn); 79 // cout << "wtr got " << sn << endl;80 95 fits_lock(); 81 fits_write_col_dbl(fptr, i+1, fitsLine, 1, 1, &x, &fstatus); 96 if (outFlags) { 97 fits_write_col_dbl(fptr, 2*i+2, fitsLine, 1, 1, &x, &fstatus); 98 x = getFlag(i, sn); 99 fits_write_col_dbl(fptr, 2*i+3, fitsLine, 1, 1, &x, &fstatus); 100 } else { 101 fits_write_col_dbl(fptr, i+2, fitsLine, 1, 1, &x, &fstatus); 102 } 82 103 if (fstatus != 0) { 83 104 cerr << "fitstoiwtr error sn = " << sn << " i = "<< i << endl; -
trunk/ArchTOIPipe/Kernel/fitstoiwtr.h
r1365 r1369 18 18 virtual void addInput(string name, TOI* toi); 19 19 20 virtual void setOutFlags(bool yn = true); 21 20 22 //virtual void init(); 21 23 virtual void run(); … … 26 28 int fstatus; 27 29 vector<TOI*> fwinputs; 28 30 bool outFlags; 29 31 }; 30 32
Note:
See TracChangeset
for help on using the changeset viewer.