Ignore:
Timestamp:
06/09/10 19:03:06 (14 years ago)
Author:
Kana Sugimoto
Message:

New Development: Yes

JIRA Issue: Yes (CAS-2211)

Ready for Test: Yes

Interface Changes: Yes

What Interface Changed: ASAP 3.0.0 interface changes

Test Programs:

Put in Release Notes: Yes

Module(s): all the CASA sd tools and tasks are affected.

Description: Merged ATNF-ASAP 3.0.0 developments to CASA (alma) branch.

Note you also need to update casa/code/atnf.


Location:
branches/alma
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/alma

  • branches/alma/src/Scantable.cpp

    r1707 r1757  
    261261  td.addColumn(ScalarColumnDesc<Float>("AZIMUTH"));
    262262  td.addColumn(ScalarColumnDesc<Float>("ELEVATION"));
    263   td.addColumn(ScalarColumnDesc<Float>("PARANGLE"));
    264263  td.addColumn(ScalarColumnDesc<Float>("OPACITY"));
    265264
     
    303302  elCol_.attach(table_, "ELEVATION");
    304303  dirCol_.attach(table_, "DIRECTION");
    305   paraCol_.attach(table_, "PARANGLE");
    306304  fldnCol_.attach(table_, "FIELDNAME");
    307305  rbeamCol_.attach(table_, "REFBEAMNO");
    308306
     307  mweatheridCol_.attach(table_,"WEATHER_ID");
    309308  mfitidCol_.attach(table_,"FIT_ID");
    310309  mfreqidCol_.attach(table_, "FREQ_ID");
     
    501500}
    502501
    503 MPosition Scantable::getAntennaPosition () const
     502MPosition Scantable::getAntennaPosition() const
    504503{
    505504  Vector<Double> antpos;
     
    515514  /// @todo reindex SCANNO, recompute nbeam, nif, npol
    516515  inname = path.expandedName();
    517   table_.deepCopy(inname, Table::New);
     516  // WORKAROUND !!! for Table bug
     517  // Remove when fixed in casacore
     518  if ( table_.tableType() == Table::Memory  && !selector_.empty() ) {
     519    Table tab = table_.copyToMemoryTable(generateName());
     520    tab.deepCopy(inname, Table::New);
     521    tab.markForDelete();
     522
     523  } else {
     524    table_.deepCopy(inname, Table::New);
     525  }
    518526}
    519527
     
    646654}
    647655
    648 std::vector<uint> Scantable::getNumbers(ScalarColumn<uInt>& col)
     656std::vector<uint> Scantable::getNumbers(const ScalarColumn<uInt>& col) const
    649657{
    650658  Vector<uInt> nos(col.getColumn());
     
    840848    specCol_.get(whichrow, arr);
    841849  } else {
    842     CountedPtr<STPol> stpol(STPol::getPolClass(Scantable::factories_, basetype));
     850    CountedPtr<STPol> stpol(STPol::getPolClass(Scantable::factories_,
     851                                               basetype));
    843852    uInt row = uInt(whichrow);
    844853    stpol->setSpectra(getPolMatrix(row));
    845854    Float fang,fhand,parang;
    846     fang = focusTable_.getTotalFeedAngle(mfocusidCol_(row));
     855    fang = focusTable_.getTotalAngle(mfocusidCol_(row));
    847856    fhand = focusTable_.getFeedHand(mfocusidCol_(row));
    848     parang = paraCol_(row);
    849     /// @todo re-enable this
    850     // disable total feed angle to support paralactifying Caswell style
    851     stpol->setPhaseCorrections(parang, -parang, fhand);
     857    stpol->setPhaseCorrections(fang, fhand);
    852858    arr = stpol->getSpectrum(requestedpol, ptype);
    853859  }
     
    921927      << setw(15) << "Polarisations:" << setw(4) << npol()
    922928      << "(" << getPolType() << ")" << endl
    923       << setw(15) << "Channels:"  << setw(4) << nchan() << endl;
    924   oss << endl;
     929      << setw(15) << "Channels:" << nchan() << endl;
    925930  String tmp;
    926931  oss << setw(15) << "Observer:"
     
    967972      << setw(10) << "Time" << setw(18) << "Integration" << endl;
    968973  oss << setw(5) << "" << setw(5) << "Beam" << setw(3) << "" << dirtype << endl;
    969   oss << setw(10) << "" << setw(3) << "IF" << setw(6) << ""
     974  oss << setw(10) << "" << setw(3) << "IF" << setw(3) << ""
    970975      << setw(8) << "Frame" << setw(16)
    971       << "RefVal" << setw(10) << "RefPix" << setw(12) << "Increment" <<endl;
     976      << "RefVal" << setw(10) << "RefPix" << setw(12) << "Increment"
     977      << setw(7) << "Channels"
     978      << endl;
    972979  oss << asap::SEPERATOR << endl;
    973980  TableIterator iter(table_, "SCANNO");
     
    10041011        ROTableRow irow(isubt);
    10051012        const TableRecord& irec = irow.get(0);
    1006         oss << setw(10) << "";
     1013        oss << setw(9) << "";
    10071014        oss << setw(3) << std::right << irec.asuInt("IFNO") << std::left
    1008             << setw(2) << "" << frequencies().print(irec.asuInt("FREQ_ID"))
     1015            << setw(1) << "" << frequencies().print(irec.asuInt("FREQ_ID"))
     1016            << setw(3) << "" << nchan(irec.asuInt("IFNO"))
    10091017            << endl;
    10101018
     
    10401048    Double tm;
    10411049    table_.keywordSet().get("UTC",tm);
    1042     return MEpoch(MVEpoch(tm)); 
     1050    return MEpoch(MVEpoch(tm));
    10431051  }
    10441052}
     
    10471055{
    10481056  return formatDirection(getDirection(uInt(whichrow)));
     1057}
     1058
     1059
     1060SpectralCoordinate Scantable::getSpectralCoordinate(int whichrow) const {
     1061  const MPosition& mp = getAntennaPosition();
     1062  const MDirection& md = getDirection(whichrow);
     1063  const MEpoch& me = timeCol_(whichrow);
     1064  //Double rf = moleculeTable_.getRestFrequency(mmolidCol_(whichrow));
     1065  Vector<Double> rf = moleculeTable_.getRestFrequency(mmolidCol_(whichrow));
     1066  return freqTable_.getSpectralCoordinate(md, mp, me, rf,
     1067                                          mfreqidCol_(whichrow));
    10491068}
    10501069
     
    10611080    return stlout;
    10621081  }
    1063 
    1064   const MPosition& mp = getAntennaPosition();
    1065   const MDirection& md = getDirection(whichrow);
    1066   const MEpoch& me = timeCol_(whichrow);
    1067   //Double rf = moleculeTable_.getRestFrequency(mmolidCol_(whichrow));
    1068   Vector<Double> rf = moleculeTable_.getRestFrequency(mmolidCol_(whichrow));
    1069   SpectralCoordinate spc =
    1070     freqTable_.getSpectralCoordinate(md, mp, me, rf, mfreqidCol_(whichrow));
     1082  SpectralCoordinate spc = getSpectralCoordinate(whichrow);
    10711083  Vector<Double> pixel(nchan);
    10721084  Vector<Double> world;
     
    12251237           Sort::QuickSort|Sort::NoDuplicates );
    12261238  for (uInt i=0; i<fids.nelements(); ++i) {
    1227     frequencies().shiftRefPix(npix, i);
    1228   }
    1229 }
    1230 
    1231 std::string asap::Scantable::getAntennaName() const
     1239    frequencies().shiftRefPix(npix, fids[i]);
     1240  }
     1241}
     1242
     1243std::string Scantable::getAntennaName() const
    12321244{
    12331245  String out;
     
    12361248}
    12371249
    1238 int asap::Scantable::checkScanInfo(const std::vector<int>& scanlist) const
     1250int Scantable::checkScanInfo(const std::vector<int>& scanlist) const
    12391251{
    12401252  String tbpath;
     
    13211333}
    13221334
    1323 std::vector<double>  asap::Scantable::getDirectionVector(int whichrow) const
     1335std::vector<double> Scantable::getDirectionVector(int whichrow) const
    13241336{
    13251337  Vector<Double> Dir = dirCol_(whichrow).getAngle("rad").getValue();
     
    16811693}
    16821694
     1695std::vector<float> Scantable::getWeather(int whichrow) const
     1696{
     1697  std::vector<float> out(5);
     1698  //Float temperature, pressure, humidity, windspeed, windaz;
     1699  weatherTable_.getEntry(out[0], out[1], out[2], out[3], out[4],
     1700                         mweatheridCol_(uInt(whichrow)));
     1701
     1702
     1703  return out;
     1704}
     1705
    16831706}
    16841707//namespace asap
Note: See TracChangeset for help on using the changeset viewer.