Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/PKSFiller.cpp

    r1832 r1916  
    2020#include <casa/Arrays/ArrayLogical.h>
    2121#include <casa/Utilities/Regex.h>
     22#include <casa/Utilities/DataType.h>
    2223#include <casa/Logging/LogIO.h>
    2324
     25#include <casa/Containers/Record.h>
    2426#include <measures/Measures/MDirection.h>
    2527#include <measures/Measures/MeasConvert.h>
     
    3436
    3537#include <time.h>
     38#include <sstream>
    3639
    3740#include "STDefs.h"
     
    5861}
    5962
    60 bool PKSFiller::open( const std::string& filename)
     63bool PKSFiller::open( const std::string& filename, const Record& rec)
    6164{
    6265  Bool haveBase, haveSpectra;
     
    7477  Vector<uInt> nchans,npols;
    7578
    76   String antenna("0");
     79  String antenna("");
     80  Bool getPt = False;
     81
     82  // parsing MS options
     83  if ( rec.isDefined( "ms" ) ) {
     84    Record msrec = rec.asRecord( "ms" ) ;
     85    //msrec.print( cout ) ;
     86    if ( msrec.isDefined( "getpt" ) ) {
     87      getPt = msrec.asBool( "getpt" ) ;
     88    }
     89    if ( msrec.isDefined( "antenna" ) ) {
     90      if ( msrec.type( msrec.fieldNumber( "antenna" ) ) == TpInt ) {
     91        Int antInt = msrec.asInt( "antenna" ) ;
     92        ostringstream oss ;
     93        oss << antInt ;
     94        antenna = String( oss ) ;
     95      }
     96      else {
     97        antenna = msrec.asString( "antenna" ) ;
     98      }
     99    }
     100  }
    77101
    78102  reader_ = getPKSreader(inName, antenna, 0, 0, format, beams, ifs,
     
    146170  Vector<Int> start(nIF_, 1);
    147171  Vector<Int> end(nIF_, 0);
    148   Bool getPt = False;
    149172  reader_->select(beams, ifs, start, end, ref, True, haveXPol_[0], False, getPt);
    150173  setHeader(header);
     
    263286    Int match = pksrec.srcName.matches(rx);
    264287    std::string srcname;
     288    Int srctype = Int(SrcType::NOTYPE);
    265289    if (match) {
    266290      srcname = pksrec.srcName;
     291      srctype =  Int(SrcType::PSOFF);
    267292    } else {
    268293      srcname = pksrec.srcName.before(rx2);
    269     }
    270     Int srctype = match;
    271     if ( pksrec.srcType != -1 ) {
     294      srctype =  Int(SrcType::PSON);
     295    }
     296    if ( pksrec.srcType != Int(SrcType::NOTYPE)) {
    272297      srctype = pksrec.srcType ;
    273298    }
Note: See TracChangeset for help on using the changeset viewer.