Changeset 1439 in Sophya for trunk/ArchTOIPipe/Kernel


Ignore:
Timestamp:
Mar 13, 2001, 7:23:14 PM (25 years ago)
Author:
ansari
Message:

Correction bugs, protections, ameliorations - Reza 13/3/2001

Location:
trunk/ArchTOIPipe/Kernel
Files:
3 edited

Legend:

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

    r1437 r1439  
    3232}
    3333
    34 
    35 void FITSTOIWriter::run() {
    36   cout << "fitstoiwriter running" << endl;
    37   // init done here
    38   delete[] inTOIs;
     34void FITSTOIWriter::afterinit()
     35{
     36  if (inTOIs) delete[] inTOIs;
    3937  inTOIs = new (TOI*[fwinputs.size()]);
    4038
     
    4240    inTOIs[i] = fwinputs[i];
    4341  }
     42 
     43}
     44
     45void FITSTOIWriter::run() {
     46  cout << "fitstoiwriter running" << endl;
     47  // init done here
     48  afterinit();
     49  inited=true;
    4450
    4551  int ndata = inIx.size();
     
    5460  colunits[0] = "integer";
    5561
     62  cout << " FITSTOIWriter::run() - Creating output FITS file: "
     63       << name << endl;
     64
     65  vector<string> coln;
     66  int ck=0;
    5667  for (map<string, int>::iterator ii = inIx.begin(); ii != inIx.end(); ii++) {
    5768    int j = (*ii).second;
    58     string n = (*ii).first;
     69    coln.push_back((*ii).first);
    5970    if (outFlags) j += j;
    60     colnames[j+1] = const_cast<char*>(n.c_str());
     71    colnames[j+1] = const_cast<char*>(coln[ck].c_str()); 
     72    cout << " Column[" << j+1 << "] Name=" << coln[ck] << endl;
     73    ck++;
    6174    coltypes[j+1] = "1D";
    62     colunits[j+1] = "?";
     75    colunits[j+1] = "double";
    6376    if (outFlags) {
    64       colnames[j+2] = const_cast<char*>((n+"_flg").c_str());
     77      coln.push_back("fg_" + coln[ck-1]);
     78      colnames[j+2] = const_cast<char*>(coln[ck].c_str()); 
     79      cout << " Column[" << j+1 << "] -Flag- Name=" << coln[ck] << endl;
     80      ck++;
    6581      coltypes[j+2] = "1D";
    66       colunits[j+2] = "?";
     82      colunits[j+2] = "IntFlag";
    6783    }
    6884  }
  • trunk/ArchTOIPipe/Kernel/fitstoiwtr.h

    r1370 r1439  
    1616  ~FITSTOIWriter();
    1717 
     18  virtual void afterinit();
     19
    1820  virtual void  addInput(string name, TOI* toi);
    1921
  • trunk/ArchTOIPipe/Kernel/toiprocessor.cc

    r1437 r1439  
    4747  inTOIs = new (TOI*[inIx.size()]);
    4848  for(i=0; i<inIx.size(); i++)
    49     inTOIs[i] = NULL;
     49    inTOIs[i] = NULL;     // Protection-Initialisation - Reza  11/3/2001
    5050  outTOIs = new (TOI*[outIx.size()]);
    5151  for(i=0; i<outIx.size(); i++)
    52     outTOIs[i] = NULL;
     52    outTOIs[i] = NULL;    // Protection-Initialisation - Reza  11/3/2001
    5353}
    5454
     
    8080  for (int i=0; i<nIn; i++) {
    8181    TOI* toi = inTOIs[i];
     82    if (toi == NULL) continue;  // Protection - Reza  13/3/2001
    8283    int x = toi->getMinSn();
    8384    if (x > minIn) minIn = x;
     
    9192  for (int i=0; i<nIn; i++) {
    9293    TOI* toi = inTOIs[i];
     94    if (toi == NULL) continue;  // Protection - Reza  13/3/2001
    9395    int x = toi->getMaxSn();
    9496    if (x < maxIn) maxIn = x;
     
    163165void TOIProcessor::PrintStatus(ostream & os)
    164166{
     167  chkinit();
    165168  os << " TOIProcessor::PrintStatus() - Name= " << name
    166169     << " MinIn=" << getMinIn() << " MaxIn=" << getMaxIn() << endl;
     
    191194  if (i == inIx.end()) throw NotFoundExc("TOIProcessor::addInput "+
    192195                                         name+" not declared");
    193   inTOIs[(*i).second] = toi;
     196  inTOIs[(*i).second] = toi;
     197  toi->addConsumer(this);   // $CHECK$  Reza 13/3/2001
    194198}
    195199
Note: See TracChangeset for help on using the changeset viewer.