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

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

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