Changeset 79 for trunk


Ignore:
Timestamp:
08/10/04 16:26:33 (20 years ago)
Author:
mar637
Message:

Added support of source direction.

Location:
trunk/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/SDContainer.cc

    r67 r79  
    6666    flags_(IPosition(4,nBeam,nIF,nPol,nChan)),
    6767    tsys_(IPosition(4,nBeam,nIF,nPol,nChan)),
    68     freqidx_(nIF) {
     68    freqidx_(nIF),
     69    direction_(IPosition(2,nBeam,2)) {
    6970  uChar x = 0;
    7071  flags_ = ~x;
     
    7980    flags_(shp),
    8081    tsys_(shp),
    81     freqidx_(shp(1)){
     82    freqidx_(shp(1)) {
     83  IPosition ip(2,shp(0),2);
     84  direction_.resize(ip);
    8285  uChar x = 0;
    8386  flags_ = ~x;
     
    9699  tsys_.resize(shp);
    97100  freqidx_.resize(shp(1));
     101  IPosition ip(2,shp(0),2);
     102  direction_.resize(ip);
    98103}
    99104
     
    284289}
    285290
     291Array<Double> SDContainer::getDirection(uInt whichBeam) const {
     292  Vector<Double> direct(2);
     293  ArrayAccessor<Double, Axis<0> > i0(direction_);
     294  i0.reset(i0.begin(whichBeam));
     295  ArrayAccessor<Double, Axis<0> > o0(direct);
     296  ArrayAccessor<Double, Axis<1> > i1(i0);
     297  while (i1 != i1.end()) {
     298    *o0 = *i1;
     299    i1++;
     300    o0++;
     301  } 
     302  return direct.copy();
     303}
     304
     305
    286306Bool SDContainer::setFrequencyMap(uInt freqslot, uInt whichIF) {
    287307  freqidx_[whichIF] = freqslot;
     
    292312  freqidx_.resize();
    293313  freqidx_ = freqs;
     314  return True;
     315}
     316
     317Bool SDContainer::setDirection(const Vector<Double>& point, uInt whichBeam) {
     318  if (point.nelements() != 2) return False;
     319  ArrayAccessor<Double, Axis<0> > aa0(direction_);
     320  aa0.reset(aa0.begin(whichBeam));
     321  ArrayAccessor<Double, Axis<0> > jj(point);
     322  for (ArrayAccessor<Double, Axis<1> > i(aa0);i != i.end(); ++i) {
     323   
     324    (*i) = (*jj);
     325    jj++;
     326  }
     327  return True;
     328}
     329
     330Bool SDContainer::putDirection(const Array<Double>& dir) {
     331  direction_.resize();
     332  direction_ = dir;
    294333  return True;
    295334}
  • trunk/src/SDContainer.h

    r67 r79  
    115115  Bool putTsys(const Array<Float>& spec);
    116116
    117   Bool setPointing(const Vector<Double>& point, uInt whichBeam) {;}
     117  Bool setDirection(const Vector<Double>& point, uInt whichBeam);
     118  Bool putDirection(const Array<Double>& dir);
    118119
    119120  Bool setFrequencyMap(uInt freqslot, uInt whichIF);
     
    123124  Array<uChar> getFlags(uInt whichBeam, uInt whichIF) const;
    124125  Array<Float> getTsys(uInt whichBeam, uInt whichIF) const;
     126  Array<Double> getDirection(uInt whichBeam) const;
    125127
    126128  const Array<Float>& getSpectrum() const { return spectrum_; }
    127129  const Array<uChar>& getFlags() const { return flags_; }
    128130  const Array<Float>& getTsys() const { return tsys_; }
     131  const Array<Double>& getDirection() const { return direction_; }
    129132
    130133  const Vector<uInt>& getFreqMap() const { return freqidx_; }
    131 
     134 
    132135  Double timestamp;
    133136  String sourcename;
     
    147150  Array<Float>    tcal_;
    148151
    149   //(nBeam) maybe use Measures here...
    150   //*** Vector<Vector<Double>>  pointing_;
    151152  //(nIF) indx into "global" frequency table
    152153  Vector<uInt>            freqidx_;
     154  //(nBeam,2) maybe use Measures here...
     155  Array<Double>  direction_;
    153156
    154157};
  • trunk/src/SDMemTableWrapper.h

    r51 r79  
    6262  std::vector<double> getAbscissa(int whichRow,
    6363                                  const std::string& unit = "GHz",
     64                                  const std::string& frame = "TOPO",
    6465                                  double restfreq=0.0) const {
    65     return table_->getAbscissa(whichRow,unit,restfreq);
     66    return table_->getAbscissa(whichRow,unit,frame,restfreq);
    6667  }
    6768
  • trunk/src/SDReader.cc

    r73 r79  
    193193        sc.setFlags(flagtra,  beamNo-1, IFno-1);
    194194        sc.setTsys(tsys, beamNo-1, IFno-1);
    195         //sc.addPointing(direction, beamNo-1);
     195        sc.setDirection(direction, beamNo-1);
    196196      }
    197197    }
  • trunk/src/SDWriter.cc

    r75 r79  
    139139        // None of these are stored in SDMemTable by SDReader.
    140140        String          fieldName = "";
    141         Vector<Double>  srcDir(2, 0.0);
     141        //Vector<Double>  srcDir(2, 0.0);
    142142        Vector<Double>  srcPM(2, 0.0);
    143143        Double          srcVel = 0.0;
     
    158158        Float           windAz = 0.0f;
    159159        Int             refBeam = 0;
    160         Vector<Double>  direction(2, 0.0);
     160        //Vector<Double>  direction(2, 0.0);
    161161        Vector<Double>  scanRate(2, 0.0);
    162162        Vector<Float>   sigma(nPol, 0.0f);
     
    166166        Complex         xCalFctr;
    167167        Vector<Complex> xPol;
    168 
    169168        if (status = cWriter->write(sd.scanid, cycleNo, sd.timestamp,
    170169                                    sd.interval, fieldName, sd.sourcename,
    171                                     srcDir, srcPM, srcVel, iIF+1, hdr.reffreq,
     170                                    sd.getDirection(iBeam),
     171                                    srcPM, srcVel, iIF+1, hdr.reffreq,
    172172                                    hdr.bandwidth, freqInc, restFreq, tcal,
    173173                                    tcalTime, azimuth, elevation, parAngle,
    174174                                    focusAxi, focusTan, focusRot, temperature,
    175175                                    pressure, humidity, windSpeed, windAz,
    176                                     refBeam, iBeam+1, direction, scanRate,
     176                                    refBeam, iBeam+1,
     177                                    sd.getDirection(iBeam),
     178                                    scanRate,
    177179                                    sd.getTsys(iBeam, iIF), sigma, calFctr,
    178180                                    baseLin, baseSub,
  • trunk/src/python_SDMemTable.cc

    r56 r79  
    5151         (boost::python::arg("whichRow")=0,
    5252          boost::python::arg("unit")=std::string("GHz"),
     53          boost::python::arg("frame")=std::string("TOPO"),
    5354          boost::python::arg("restFrequency")=0.0) )
    5455    .def("getmask", &SDMemTableWrapper::getMask,
Note: See TracChangeset for help on using the changeset viewer.