Changeset 2969 for trunk/src


Ignore:
Timestamp:
07/04/14 17:25:35 (10 years ago)
Author:
Kana Sugimoto
Message:

New Development: No

JIRA Issue: Yes (CAS-6109)

Ready for Test: Yes

Interface Changes: No

What Interface Changed:

Test Programs: runUnitTest.main(test_sdlist)

Put in Release Notes: No

Module(s): scantable, sdlist

Description: Fixed a bug in time range calculation in scantable.summary (sdlist).

Also enhanced precision of time and direction listed in the method.
Added a parameter, prec, in a private funtion, Scantable::formatDirection to allow setting precision.


Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/Scantable.cpp

    r2968 r2969  
    483483};
    484484
    485 std::string Scantable::formatDirection(const MDirection& md) const
     485  std::string Scantable::formatDirection(const MDirection& md, Int prec) const
    486486{
    487487  Vector<Double> t = md.getAngle(Unit(String("rad"))).getValue();
    488   Int prec = 7;
     488  if (prec<0)
     489    prec = 7;
    489490
    490491  String ref = md.getRefString();
     
    11741175    meanIntTim = sum(intervalCol.getColumn()) / (double) snrow;
    11751176    minMax(btime, etime, mjdCol.getColumn());
    1176     etime += meanIntTim/C::day;
     1177    double shiftInDay(0.5*meanIntTim/C::day);
     1178    btime -= shiftInDay;
     1179    etime += shiftInDay;
    11771180
    11781181    // MOLECULE_ID and FREQ_ID
     
    12791282        << std::left << setw(1) << ""
    12801283        << setw(15) << rec.asString("SRCNAME")
    1281         << setw(21) << MVTime(btime).string(MVTime::YMD,7)
    1282         << setw(3) << " - " << MVTime(etime).string(MVTime::TIME,7)
     1284        << setw(21) << MVTime(btime).string(MVTime::YMD,8)
     1285        << setw(3) << " - " << MVTime(etime).string(MVTime::TIME,8)
    12831286        << setw(3) << "" << setw(6) << meanIntTim << setw(1) << ""
    12841287        << std::right << setw(5) << snrow << setw(2) << ""
     
    12891292    for (uInt j=0; j < nbeam; j++) {
    12901293      oss << setw(7) << "" << setw(6) << beamids(j) << setw(1) << ""
    1291           << formatDirection(beamDirs(j)) << endl;
     1294          << formatDirection(beamDirs(j),9) << endl;
    12921295    }
    12931296    // Flush summary every scan and clear up the string
  • trunk/src/Scantable.h

    r2888 r2969  
    692692   *  Turns a casa::MDirection into a nicely formatted string
    693693   * @param md an casa::MDirection
     694   * @param prec output precision of direction
    694695   * @return
    695696   */
    696   std::string formatDirection(const casa::MDirection& md) const;
     697  std::string formatDirection(const casa::MDirection& md, casa::Int prec=7) const;
    697698
    698699  /**
Note: See TracChangeset for help on using the changeset viewer.