Changeset 275


Ignore:
Timestamp:
01/24/05 12:31:27 (20 years ago)
Author:
kil064
Message:

finalize implement DOPPLER setting and using. Before it was
just set to RADIO and never changed. Now you can set it

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/SDMemTable.cc

    r263 r275  
    335335  }
    336336  t.rwKeywordSet().define("UNIT", un);
    337 
     337//
    338338  MFrequency::Types mdr;
    339339  if (!MFrequency::getType(mdr, rfrm)) {
     
    346346    t.rwKeywordSet().define("REFFRAME",rfrm);
    347347  }
    348 
     348//
     349  MDoppler::Types dtype;
     350  dpl.upcase();
     351  if (!MDoppler::getType(dtype, dpl)) {
     352    throw(AipsError("Doppler type unknown"));
     353  } else {
     354    t.rwKeywordSet().define("DOPPLER",dpl);
     355  }
    349356}
    350357
     
    386393  MFrequency::Types mtype;
    387394  if (!MFrequency::getType(mtype, frm)) {
    388     cout << "Frequency type unknown assuming TOPO" << endl;
     395    cout << "Frequency type unknown assuming TOPO" << endl;       // SHould never happen
    389396    mtype = MFrequency::TOPO;
     397  }
     398  MDoppler::Types dtype;
     399  if (!MDoppler::getType(dtype, dpl)) {
     400    cout << "Doppler type unknown assuming RADIO" << endl;        // SHould never happen
     401    dtype = MDoppler::RADIO;
    390402  }
    391403 
     
    400412      if (rstf.nelements() >= nIF())
    401413        spc.selectRestFrequency(uInt(IFSel_));
    402       spc.setVelocity(u.getName());
     414      spc.setVelocity(u.getName(),dtype);
    403415      Vector<Double> wrld;
    404416      spc.pixelToVelocity(wrld,absc1);
     
    447459  String frm;
    448460  t.keywordSet().get("REFFRAME",frm);
     461//
    449462  MFrequency::Types mtype;
    450463  if (!MFrequency::getType(mtype, frm)) {
     
    453466  }
    454467  spc.setFrequencySystem(mtype);
     468//
     469  String dpl;
     470  t.keywordSet().get("DOPPLER",dpl);
     471  MDoppler::Types dtype;
     472  MDoppler::getType(dtype, dpl);         // Can't fail
     473//
    455474  String s = "Channel";
    456475  if (u == Unit("km/s")) {
    457     spc.setVelocity(u.getName());
     476    spc.setVelocity(u.getName(), dtype);
    458477    s = CoordinateUtil::axisLabel(spc,0,True,True,True);
    459478  } else if (u == Unit("Hz")) {
     
    921940}
    922941
     942
    923943void SDMemTable::setInstrument(const std::string& name)
    924944{
Note: See TracChangeset for help on using the changeset viewer.