Changeset 441


Ignore:
Timestamp:
02/15/05 11:21:48 (19 years ago)
Author:
kil064
Message:

add stokesConversion to function rowAsMaskedArray

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/SDMemTable.cc

    r439 r441  
    712712                                                Bool toStokes) const
    713713{
     714
     715// Get flags
     716
     717  Array<uChar> farr;
     718  flagsCol_.get(whichRow, farr);
     719
     720// Get data and convert mask
     721
    714722  Array<Float> arr;
    715   Array<uChar> farr;
     723  Array<Bool> mask;
     724  uInt polSel = polSel_;
    716725  if (toStokes) {
    717726     stokesCol_.get(whichRow, arr);
     727//
     728     Array<Bool> tMask(farr.shape());
     729     convertArray(tMask, farr);
     730     mask = SDPolUtil::stokesMask (tMask, True);
     731//
     732     IPosition shape = arr.shape();
     733     uInt nPol = shape(asap::PolAxis);
     734     if (nPol<=2) polSel = 0;             // XX and XX,YY -> I
    718735  } else {
    719736     specCol_.get(whichRow, arr);
    720   }
    721   flagsCol_.get(whichRow, farr);
    722   Array<Bool> barr(farr.shape());
    723   convertArray(barr, farr);
     737     mask.resize(farr.shape());
     738     convertArray(mask, farr);
     739  }
     740//
    724741  MaskedArray<Float> marr;
    725742  if (useSelection) {
     
    729746    aa1.reset(aa1.begin(uInt(IFSel_)));// go to IF
    730747    ArrayAccessor<Float, Axis<asap::PolAxis> > aa2(aa1);
    731     aa2.reset(aa2.begin(uInt(polSel_)));// go to pol
    732 
    733     ArrayAccessor<Bool, Axis<asap::BeamAxis> > baa0(barr);
     748    aa2.reset(aa2.begin(uInt(polSel)));// go to pol
     749
     750    ArrayAccessor<Bool, Axis<asap::BeamAxis> > baa0(mask);
    734751    baa0.reset(baa0.begin(uInt(beamSel_)));//go to beam
    735752    ArrayAccessor<Bool, Axis<asap::IFAxis> > baa1(baa0);
    736753    baa1.reset(baa1.begin(uInt(IFSel_)));// go to IF
    737754    ArrayAccessor<Bool, Axis<asap::PolAxis> > baa2(baa1);
    738     baa2.reset(baa2.begin(uInt(polSel_)));// go to pol
     755    baa2.reset(baa2.begin(uInt(polSel)));// go to pol
    739756
    740757    Vector<Float> a(arr.shape()(3));
    741     Vector<Bool> b(barr.shape()(3));
     758    Vector<Bool> b(mask.shape()(3));
    742759    ArrayAccessor<Float, Axis<asap::BeamAxis> > a0(a);
    743760    ArrayAccessor<Bool, Axis<asap::BeamAxis> > b0(b);
     
    754771    marr.setData(a,b);
    755772  } else {
    756     marr.setData(arr,!barr);
     773    marr.setData(arr,!mask);
    757774  }
    758775  return marr;
  • trunk/src/SDMemTable.h

    r439 r441  
    111111                                               casa::Float paOffset=0.0) const;
    112112
    113   // Get RR or LL at cursor location (not polSel_)
     113  // Get RR or LL at cursor location (except not polSel_)
    114114  virtual std::vector<float> getCircularSpectrum(casa::Int whichRow=0,
    115115                                                 casa::Bool rr=casa::True) const;
Note: See TracChangeset for help on using the changeset viewer.