Changeset 16 for trunk/src/SDReader.cc


Ignore:
Timestamp:
06/30/04 11:00:23 (20 years ago)
Author:
mmarquar
Message:

Updated data container. Changed the axis order in the spectrum/flag arrays to [nBeam,nIF,nPol,nChan]

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/SDReader.cc

    r14 r16  
    3030//#---------------------------------------------------------------------------
    3131#include <atnf/PKSIO/PKSreader.h>
    32 
     32#include <aips/Quanta/MVTime.h>
    3333#include "SDContainer.h"
    3434#include "SDReader.h"
    3535
    3636using namespace atnf_sd;
     37
     38void SDHeader::print() const {
     39  MVTime mvt(this->utc);
     40
     41  cout << "Observer: " << this->observer << endl
     42       << "Project: " << this->project << endl
     43       << "Obstype: " << this->obstype << endl
     44       << "Antenna: " << this->antennaname << endl
     45       << "Ant. Position: " << this->antennaposition << endl
     46       << "Equinox: " << this->equinox << endl
     47       << "Freq. ref.: " << this->freqref << endl
     48       << "Ref. frequency: " << this->reffreq << endl
     49       << "Bandwidth: "  << this->bandwidth << endl
     50       << "Time (utc): "
     51       << mvt.string()
     52       << endl;
     53  //setprecision(10) << this->utc << endl;
     54}
     55
    3756
    3857SDReader::SDReader() :
     
    85104 
    86105  // Get basic parameters.
    87   Double bandwidth, refFreq;
    88106  header_ = SDHeader();
    89107  header_.nchan = nChan_;
     
    152170  while ( (cursor_ <= seq[n-1]) || getAll) {
    153171    // only needs to be create if in seq
    154     SDContainer sc(header_.nbeam,header_.nif,header_.nchan,header_.npol);
     172    SDContainer sc(header_.nbeam,header_.nif,header_.npol,header_.nchan);
    155173
    156174    // iterate over one correlator integration cycle = nBeam*nIF
    157175    for (uInt row=0; row < stepsize; row++) {
    158 
    159       //cerr << "SDReader starting reading process row = " << row << endl;
    160 
    161176      // add scanid from GROUP field -- this will remove the need for
    162177      // stepsize as well
     
    171186                             tsys, sigma, calFctr, baseLin, baseSub,
    172187                             spectra, flagtra, xCalFctr, xPol);         
    173 
    174       // cerr << "SDReader row  read"<< endl;
    175 
    176188      if (status) {
    177189        if (status == -1) {
     
    183195      }     
    184196      // if in the given list
    185       if ( cursor_ == seq[seqi]) {
    186 
    187         //cerr << "SDReader cursor == seq[i]" << endl;
    188        
     197      if (cursor_ == seq[seqi]) {
    189198        // add integration cycle
    190199        if (row==0) {
     
    193202          //focusRot, temperature, pressure, humidity, windSpeed,
    194203          //windAz  srcDir, srcPM, srcVel
     204          sc.timestamp = mjd;
     205          sc.interval = interval;         
     206          sc.sourcename = srcName;
    195207        }
    196 
    197         // cerr << "SDReader::read -  before SDContainer" << endl;
    198 
    199208        // add specific info
    200209        // IFno beamNo are 1-relative
    201         // refPix = nChan/2+1 in  Integer arith.!
    202        
    203         uInt refPix = header_.nchan/2+1;
     210        // refPix = nChan/2+1 in  Integer arith.!       
     211        //uInt refPix = header_.nchan/2+1;
    204212        //uInt frqslot = sdft.addFrequency(refPix, refFreq, freqInc);
    205213
     
    208216          prevName = srcName;//temp
    209217        }//temp
    210 
    211         sc.sourcename = srcName;
    212         sc.timestamp = mjd;
    213         sc.interval = interval;
    214218        sc.scanid = scanid;
    215219        //sc.setFrequencyMap(frqslot,IFno-1);
     
    218222        sc.setTsys(tsys, beamNo-1, IFno-1);
    219223        //sc.addPointing(direction, beamNo-1);
    220 
    221         // cerr << "SDReader::read -  after SDContainer" << endl;
    222        
    223224      }
    224225    }
     
    226227      // insert container into table/list
    227228      table_->putSDContainer(sc);
    228       //cout << "Reading integration " << seqi << endl;
    229229      seqi++;// next in list
    230230    }
    231     cursor_++;
     231    cursor_++;// increment position in file
    232232  }
    233233  return status;
Note: See TracChangeset for help on using the changeset viewer.