Changeset 1552 for trunk/src


Ignore:
Timestamp:
03/27/09 21:25:44 (16 years ago)
Author:
Malte Marquarding
Message:

Enhancement Ticket #155; chnaged the wy output filenames are generated.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/STAsciiWriter.cpp

    r1375 r1552  
    8888
    8989   String rootName(fileName);
    90    if (rootName.length()==0) rootName = String("ascii");
    91 
     90   
    9291  Block<String> cols(4);
    9392  cols[0] = String("SCANNO");
     
    103102    String dirtype = stable.getDirectionRefString();
    104103    ostringstream onstr;
    105     onstr << "SCAN" << rec.asuInt("SCANNO")
    106     << "_CYCLE" << rec.asuInt("CYCLENO")
    107     << "_BEAM" << rec.asuInt("BEAMNO")
    108     << "_IF" << rec.asuInt("IFNO");
     104
     105    if (rootName.length()==0) {
     106      rootName = String("ascii");
     107    }
     108    if (tab.nrow() > 1) {
     109      if (stable.nscan() > 1)
     110        onstr << "_SCAN" << rec.asuInt("SCANNO");
     111      if (stable.ncycle(rec.asuInt("SCANNO")) > 1)
     112        onstr << "_CYCLE" << rec.asuInt("CYCLENO");
     113      if (stable.nbeam(rec.asuInt("SCANNO")) > 1)
     114        onstr << "_BEAM" << rec.asuInt("BEAMNO");
     115      if (stable.nif(rec.asuInt("SCANNO")) > 1)
     116        onstr << "_IF" << rec.asuInt("IFNO");
     117    }
     118
    109119    String fName = rootName + String(onstr) + String(".txt");
    110120    ofstream of(fName.chars(), ios::trunc);
  • trunk/src/STFITSImageWriter.cpp

    r1510 r1552  
    121121  TableIterator iter(tab, cols);
    122122  // Open data file
     123
    123124  while ( !iter.pastEnd() ) {
    124125    Table t = iter.table();
     
    127128    String dirtype = stable.getDirectionRefString();
    128129    ostringstream onstr;
    129     onstr << "SCAN" << rec.asuInt("SCANNO")
    130     << "_CYCLE" << rec.asuInt("CYCLENO")
    131     << "_BEAM" << rec.asuInt("BEAMNO")
    132     << "_IF" << rec.asuInt("IFNO")
    133     << "_POL" << rec.asuInt("POLNO");
     130    if (rootName.length()==0) {
     131      rootName = "fits";
     132    }
     133    if (tab.nrow() > 1) {
     134      if (stable.nscan() > 1)
     135        onstr << "_SCAN" << rec.asuInt("SCANNO");
     136      if (stable.ncycle(rec.asuInt("SCANNO")) > 1)
     137        onstr << "_CYCLE" << rec.asuInt("CYCLENO");
     138      if (stable.nbeam(rec.asuInt("SCANNO")) > 1)
     139        onstr << "_BEAM" << rec.asuInt("BEAMNO");
     140      if (stable.nif(rec.asuInt("SCANNO")) > 1)
     141        onstr << "_IF" << rec.asuInt("IFNO");
     142      if (stable.npol(rec.asuInt("SCANNO")) > 1)
     143        onstr << "_POL" << rec.asuInt("POLNO");
     144    }
    134145    String fileName = rootName + String(onstr) + String(".fits");
    135146    int row0 = t.rowNumbers(tab)[0];
     
    258269    }
    259270    fits_close_file(fptr, &status);
    260  
     271    ostringstream oss;
     272    oss << "Wrote " << fileName;
     273    pushLog(String(oss)); 
    261274    //pushLog(String(oss));
    262275    ++iter;
Note: See TracChangeset for help on using the changeset viewer.