Changeset 472 for trunk


Ignore:
Timestamp:
02/18/05 11:16:27 (20 years ago)
Author:
kil064
Message:

add a new getStokesSPectrum function (for the writer) which gets all
Stokes or a beam/IF slice

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/SDMemTable.cc

    r465 r472  
    366366std::vector<float> SDMemTable::getStokesSpectrum(Int whichRow, Bool doPol,
    367367                                                 Float paOffset) const
    368   // Gets
    369   //  doPol=False  : I,Q,U,V
    370   //  doPol=True   : I,P,PA,V   ; P = sqrt(Q**2+U**2), PA = 0.5*atan2(Q,U)
    371   //
     368//
     369// Gets one STokes parameter depending on cursor polSel location
     370//  doPol=False  : I,Q,U,V
     371//  doPol=True   : I,P,PA,V   ; P = sqrt(Q**2+U**2), PA = 0.5*atan2(Q,U)
     372//
    372373{
    373374  AlwaysAssert(asap::nAxes==4,AipsError);
     
    450451
    451452  return stlout;
     453}
     454
     455Array<Float> SDMemTable::getStokesSpectrum(Int whichRow, Int iBeam, Int iIF) const
     456{
     457
     458// Get data
     459
     460  Array<Float> arr;
     461  stokesCol_.get(whichRow, arr);
     462
     463// Set current cursor location and overwrite polarization axis
     464
     465  const IPosition& shape = arr.shape();
     466  IPosition start(shape.nelements(),0); 
     467  IPosition end(shape-1);
     468  if (iBeam!=-1) {
     469     start(asap::BeamAxis) = iBeam;
     470     end(asap::BeamAxis) = iBeam;
     471  }
     472  if (iIF!=-1) {
     473     start(asap::IFAxis) = iIF;
     474     end(asap::IFAxis) = iIF;
     475  }
     476
     477// Get slice
     478
     479  return arr(start,end);
    452480}
    453481
     
    11721200  histCol_.put(rno, sdc.getHistory());
    11731201  fitCol_.put(rno, sdc.getFitMap());
    1174 
    11751202  return true;
    11761203}
  • trunk/src/SDMemTable.h

    r465 r472  
    103103  // getCircularSpectrum is 'getCircular'
    104104
    105 
    106   // Get Stokes at cursor location. One of either I,Q,U,V or I,P,PA,V
    107   // (doPol=True) If the latter, you can add a PA offset (degrees)
     105  // Get specific Stokes at cursor location. One of either I,Q,U,V or I,P,PA,V (doPol=True)
     106  // (determined by the polSel cursor location 0->3)
     107  // If the latter, you can add a PA offset (degrees)
    108108  virtual std::vector<float> getStokesSpectrum(casa::Int whichRow=0,
    109109                                               casa::Bool doPol=casa::False,
     
    114114                                                 casa::Bool rr=casa::True) const;
    115115
     116  // Get all Stokes at the specified Beam/IF cursor location (ignoring
     117  // the internal cursor).  -1 means all on that axis.  Really, this function
     118  // should not be here, and the SDContainer should hold the stokes spectrum
     119  // as well.  However, because the Stokes column is virtual, and its shape
     120  // is not the same as nPol(), I have put it here for direct access as needed
     121  virtual casa::Array<casa::Float> getStokesSpectrum(casa::Int whichRow=0,
     122                                                     casa::Int iBeam=-1,
     123                                                     casa::Int iIF=-1) const;
     124
     125  // Get Tsys at cursor location
    116126  virtual casa::Float getTsys(casa::Int whichRow=0) const;
     127
    117128  // get all as aips++ Vectors
    118129  virtual void getSpectrum(casa::Vector<casa::Float>& spectrum,
     
    120131  //virtual void getMask(Vector<Bool>& mask,Int whichRow=0) const;
    121132
     133  // Get rest frequencies
    122134  std::vector<double> getRestFreqs() const;
    123135 
Note: See TracChangeset for help on using the changeset viewer.