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

Added support of source direction.

File:
1 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}
Note: See TracChangeset for help on using the changeset viewer.