Changeset 33 for trunk/src


Ignore:
Timestamp:
07/07/04 18:03:50 (20 years ago)
Author:
mmarquar
Message:

Added reading of frequency information. Also added the getAll flag to get all integrations in the file.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/SDReader.cc

    r25 r33  
    6262  if (reader_) delete reader_; reader_ = 0;
    6363  Bool   haveBase, haveSpectra, haveXPol;
    64   //Int    nChan, nIF, nPol;
    6564  String inName(filename);
    6665  String format;
     
    7776    return;
    7877  }
    79 
    8078  nBeam_ = beams.nelements();
    8179  // Get basic parameters.
     
    113111  reader_->select(beamSel, IFsel, start, end, ref, True, haveXPol);
    114112  table_->putSDHeader(header_);
     113  frequencies_.setRefFrame(header_.freqref);
     114  frequencies_.setEquinox(header_.equinox);
    115115}
    116116
     
    133133
    134134  uInt stepsize = header_.nif*header_.nbeam;
    135   cerr << "SDReader stepsize = " << stepsize << endl;
     135  //cerr << "SDReader stepsize = " << stepsize << endl;
    136136  uInt seqi = 0;
    137   //SDFrequencyTable sdft();
    138137  Bool getAll = False;
    139138  if (seq[n-1] == -1) getAll = True;
     
    161160          if (row < stepsize-1) cerr << "incomplete integration data." << endl;
    162161          cerr << "EOF" << endl;
     162          table_->putSDFreqTable(frequencies_);
    163163          return status;
    164164        }
    165165      }     
    166166      // if in the given list
    167       if (cursor_ == seq[seqi]) {
     167      if (cursor_ == seq[seqi] || getAll) {
    168168        // add integration cycle
    169169        if (row==0) {
     
    179179        // IFno beamNo are 1-relative
    180180        // refPix = nChan/2+1 in  Integer arith.!       
    181         //uInt refPix = header_.nchan/2+1;
    182         //uInt frqslot = sdft.addFrequency(refPix, refFreq, freqInc);
     181        Int refPix = header_.nchan/2+1;
     182        Int frqslot = frequencies_.addFrequency(refPix, refFreq, freqInc);
     183        sc.setFrequencyMap(frqslot,IFno-1);
    183184
    184185        sc.scanid = scanNo;
    185         //sc.setFrequencyMap(frqslot,IFno-1);
    186186        sc.setSpectrum(spectra, beamNo-1, IFno-1);
    187187        sc.setFlags(flagtra,  beamNo-1, IFno-1);
     
    190190      }
    191191    }
    192     if (cursor_ == seq[seqi]) {
     192    if (cursor_ == seq[seqi] || getAll) {
    193193      // insert container into table/list
    194194      table_->putSDContainer(sc);
     
    197197    cursor_++;// increment position in file
    198198  }
     199  table_->putSDFreqTable(frequencies_);
    199200  return status;
    200201}
  • trunk/src/SDReader.h

    r18 r33  
    7575  PKSreader* reader_; 
    7676  SDHeader header_;
     77  SDFrequencyTable frequencies_;
    7778  CountedPtr<SDMemTable> table_;
    7879  String filename_;
Note: See TracChangeset for help on using the changeset viewer.