Changeset 420


Ignore:
Timestamp:
02/14/05 12:36:38 (20 years ago)
Author:
kil064
Message:

handle cross polarization

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/SDReader.cc

    r414 r420  
    4848  header_(0),
    4949  frequencies_(0),
    50   table_(new SDMemTable()) {
     50  table_(new SDMemTable()),
     51  haveXPol_(False)
     52{
    5153  cursor_ = 0;
    5254}
     
    5658  header_(0),
    5759  frequencies_(0),
    58   table_(new SDMemTable()) {
     60  table_(new SDMemTable()),
     61  haveXPol_(False)
     62{
    5963  cursor_ = 0;
    6064  open(filename, whichIF, whichBeam);
     
    6468  reader_(0),
    6569  header_(0),
    66   table_(tbl) {
     70  table_(tbl),
     71  haveXPol_(False)
     72{
    6773  cursor_ = 0;
    6874}
     
    8894                    int whichIF, int whichBeam) {
    8995  if (reader_) delete reader_; reader_ = 0;
    90   Bool   haveBase, haveSpectra, haveXPol;
     96  Bool   haveBase, haveSpectra;
    9197
    9298  String inName(filename);
     
    105111  if ((reader_ = getPKSreader(inName, 0, False, format, beams, nIF_,
    106112                              nChan_, nPol_, haveBase, haveSpectra,
    107                               haveXPol)) == 0)  {
     113                              haveXPol_)) == 0)  {
    108114    throw(AipsError("Creation of PKSreader failed"));
    109115  }
     
    117123  nBeam_ = beams.nelements();
    118124  // Get basic parameters.
    119   if (haveXPol) {
    120     cout << "Warning. Ignoring cross polarisation." << endl;
    121     nPol_--;   
    122   }
     125  if (haveXPol_) {
     126    cout << "Cross polarization present" << endl;
     127    nPol_ += 2;                          // Convert Complex -> 2 Floats
     128  }
     129
    123130  if (header_) delete header_;
    124131  header_ = new SDHeader();
     
    193200  Vector<Int> start(nIF_, 1);
    194201  Vector<Int> end(nIF_, 0);
    195   reader_->select(beamSel, IFsel, start, end, ref, True, haveXPol);
     202  reader_->select(beamSel, IFsel, start, end, ref, True, haveXPol_);
    196203  table_->putSDHeader(*header_);
    197204
     
    288295        sc.refbeam = refBeam-1;//make it 0-based; -1 if nbeams == 1
    289296        sc.scanid = scanNo-1;//make it 0-based
    290         sc.setSpectrum(spectra, beamNo, IFno);
    291         sc.setFlags(flagtra,  beamNo, IFno);
    292         sc.setTsys(tsys, beamNo, IFno);
     297        if (haveXPol_) {
     298           sc.setSpectrum(spectra, xPol, beamNo, IFno);
     299           sc.setFlags(flagtra,  beamNo, IFno, True);
     300        } else {
     301           sc.setSpectrum(spectra, beamNo, IFno);
     302           sc.setFlags(flagtra,  beamNo, IFno, False);
     303        }
     304        sc.setTsys(tsys, beamNo, IFno, haveXPol_);
    293305        sc.setDirection(direction, beamNo);
    294306      }
  • trunk/src/SDReader.h

    r405 r420  
    8585  casa::Double timestamp_;
    8686  casa::uInt beamOffset_, ifOffset_;
     87  casa::Bool haveXPol_;
    8788};
    8889
Note: See TracChangeset for help on using the changeset viewer.