Changeset 1060
- Timestamp:
- 06/07/06 16:24:27 (19 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/STFiller.cpp
r999 r1060 18 18 #include <casa/Quanta/Unit.h> 19 19 #include <casa/Arrays/ArrayMath.h> 20 #include <casa/Arrays/ArrayLogical.h> 20 21 #include <casa/Utilities/Regex.h> 21 22 … … 83 84 // Create reader and fill in values for arguments 84 85 String format; 85 Vector<Bool> beams; 86 if ( (reader_ = getPKSreader(inName, 0, 0, format, beams, nIF_, 87 nChan_, nPol_, haveBase, haveSpectra, 88 haveXPol_)) == 0 ) { 86 Vector<Bool> beams, ifs; 87 Vector<uInt> nchans,npols; 88 if ( (reader_ = getPKSreader(inName, 0, 0, format, beams, ifs, 89 nchans, npols, haveXPol_,haveBase, haveSpectra 90 )) == 0 ) { 89 91 throw(AipsError("Creation of PKSreader failed")); 90 92 } … … 95 97 return; 96 98 } 97 98 99 nBeam_ = beams.nelements(); 100 nIF_ = ifs.nelements(); 99 101 // Get basic parameters. 100 if ( haveXPol_) {102 if ( anyEQ(haveXPol_, True) ) { 101 103 pushLog("Cross polarization present"); 102 nPol_ += 2; // Convert Complex -> 2 Floats 104 for (uInt i=0; i< npols.nelements();++i) { 105 if (npols[i] < 3) npols[i] += 2;// Convert Complex -> 2 Floats 106 } 103 107 } 104 108 if (header_) delete header_; 105 109 header_ = new STHeader(); 106 header_->nchan = nChan_;107 header_->npol = nPol_;110 header_->nchan = max(nchans); 111 header_->npol = max(npols); 108 112 header_->nbeam = nBeam_; 109 113 … … 133 137 header_->obstype = String("fswitch"); 134 138 } 135 136 139 // Determine Telescope and set brightness unit 137 140 … … 147 150 // *** header_->frequnit = "Hz" 148 151 // Apply selection criteria. 149 150 152 Vector<Int> ref; 151 Vector<Bool> beamSel(nBeam_,True);152 Vector<Bool> IFsel(nIF_,True);153 154 153 ifOffset_ = 0; 155 154 if (whichIF>=0) { 156 155 if (whichIF>=0 && whichIF<nIF_) { 157 IFsel= False;158 IFsel(whichIF) = True;156 ifs = False; 157 ifs(whichIF) = True; 159 158 header_->nif = 1; 160 159 nIF_ = 1; … … 172 171 if (whichBeam>=0) { 173 172 if (whichBeam>=0 && whichBeam<nBeam_) { 174 beam Sel= False;175 beam Sel(whichBeam) = True;173 beams = False; 174 beams(whichBeam) = True; 176 175 header_->nbeam = 1; 177 176 nBeam_ = 1; … … 187 186 Vector<Int> start(nIF_, 1); 188 187 Vector<Int> end(nIF_, 0); 189 reader_->select(beam Sel, IFsel, start, end, ref, True, haveXPol_);188 reader_->select(beams, ifs, start, end, ref, True, haveXPol_[0], False); 190 189 table_->setHeader(*header_); 191 190 } … … 319 318 row.put(table_->table().nrow()-1, rec); 320 319 } 321 if ( haveXPol_ ) {320 if ( haveXPol_[0] ) { 322 321 // no tsys given for xpol, so emulate it 323 322 tsysvec = sqrt(tsys[0]*tsys[1]); -
trunk/src/STFiller.h
r996 r1060 101 101 casa::Int nIF_, nBeam_, nPol_, nChan_; 102 102 casa::uInt ifOffset_, beamOffset_; 103 casa:: BoolhaveXPol_;103 casa::Vector<casa::Bool> haveXPol_; 104 104 }; 105 105 -
trunk/src/STWriter.cpp
r999 r1060 131 131 // Extract the header from the table. 132 132 STHeader hdr = in->getHeader(); 133 const Int nPol = hdr.npol; 134 const Int nChan = hdr.nchan; 133 //const Int nPol = hdr.npol; 134 //const Int nChan = hdr.nchan; 135 int nIF = in->nif(); 136 Vector<uInt> nPol(nIF),nChan(nIF); 137 Vector<Bool> havexpol(nIF); 138 for (int i=0;i<nIF;++i) { 139 nPol(i) = in->npol(); 140 nChan(i) = in->nchan(i); 141 havexpol(i) = nPol(i) > 2; 142 } 135 143 136 144 const Table table = in->table(); … … 140 148 // Create the output file and write static data. 141 149 Int status; 142 Bool havexpol = Bool(in->npol() > 2);143 status = writer_->create( filename, hdr.observer, hdr.project,150 //Bool havexpol = Bool(in->npol() > 2); 151 status = writer_->create(String(filename), hdr.observer, hdr.project, 144 152 hdr.antennaname, hdr.antennaposition, 145 153 hdr.obstype, hdr.equinox, hdr.freqref, 146 nChan, nPol, False, havexpol);154 nChan, nPol, havexpol, False); 147 155 if ( status ) { 148 156 throw(AipsError("Failed to create output file"));
Note:
See TracChangeset
for help on using the changeset viewer.