Changeset 457 for trunk/src/SDMath.cc


Ignore:
Timestamp:
02/16/05 12:40:39 (19 years ago)
Author:
kil064
Message:

move SDMemTable::rotateXYPhase to SDMath

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/SDMath.cc

    r448 r457  
    8383
    8484#include "SDMath.h"
     85#include "SDPol.h"
    8586
    8687using namespace casa;
     
    12141215
    12151216
     1217void SDMath::rotateXYPhase (SDMemTable& in, Float value, Bool doAll)
     1218//
     1219// phase in degrees
     1220// Applies to all Beams and IFs
     1221// Might want to optionally select on Beam/IF
     1222//
     1223{
     1224   if (in.nPol() != 4) {
     1225      throw(AipsError("You must have 4 polarizations to run this function"));
     1226   }
     1227//   
     1228   const Table& tabIn = in.table();
     1229   ArrayColumn<Float> specCol(tabIn,"SPECTRA"); 
     1230   IPosition start(asap::nAxes,0);
     1231   IPosition end(asap::nAxes);
     1232
     1233// Set cursor slice. Assumes shape the same for all rows
     1234 
     1235   setCursorSlice (start, end, doAll, in);
     1236   IPosition start3(start);
     1237   start3(asap::PolAxis) = 2;                 // Real(XY)
     1238   IPosition end3(end);
     1239   end3(asap::PolAxis) = 2;   
     1240//
     1241   IPosition start4(start);
     1242   start4(asap::PolAxis) = 3;                 // Imag (XY)
     1243   IPosition end4(end);
     1244   end4(asap::PolAxis) = 3;
     1245// 
     1246   uInt nRow = in.nRow();
     1247   Array<Float> data;
     1248   for (uInt i=0; i<nRow;++i) {
     1249      specCol.get(i,data);
     1250      IPosition shape = data.shape();
     1251 
     1252// Get polarization slice references
     1253 
     1254      Array<Float> C3 = data(start3,end3);
     1255      Array<Float> C4 = data(start4,end4);
     1256   
     1257// Rotate
     1258 
     1259      SDPolUtil::rotateXYPhase(C3, C4, value);
     1260   
     1261// Put
     1262   
     1263      specCol.put(i,data);
     1264   }
     1265}     
     1266
    12161267
    12171268
Note: See TracChangeset for help on using the changeset viewer.