Changeset 805 for trunk/src/STFiller.h


Ignore:
Timestamp:
02/16/06 12:02:18 (18 years ago)
Author:
mar637
Message:

Code replacemnts after the rename

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/STFiller.h

    r804 r805  
    1 //#---------------------------------------------------------------------------
    2 //# SDReader.h: A class to read single dish spectra from SDFITS, RPFITS
    3 //#---------------------------------------------------------------------------
    4 //# Copyright (C) 2004
    5 //# ATNF
    6 //#
    7 //# This program is free software; you can redistribute it and/or modify it
    8 //# under the terms of the GNU General Public License as published by the Free
    9 //# Software Foundation; either version 2 of the License, or (at your option)
    10 //# any later version.
    11 //#
    12 //# This program is distributed in the hope that it will be useful, but
    13 //# WITHOUT ANY WARRANTY; without even the implied warranty of
    14 //# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
    15 //# Public License for more details.
    16 //#
    17 //# You should have received a copy of the GNU General Public License along
    18 //# with this program; if not, write to the Free Software Foundation, Inc.,
    19 //# 675 Massachusetts Ave, Cambridge, MA 02139, USA.
    20 //#
    21 //# Correspondence concerning this software should be addressed as follows:
    22 //#        Internet email: Malte.Marquarding@csiro.au
    23 //#        Postal address: Malte Marquarding,
    24 //#                        Australia Telescope National Facility,
    25 //#                        P.O. Box 76,
    26 //#                        Epping, NSW, 2121,
    27 //#                        AUSTRALIA
    28 //#
    29 //# $Id:
    30 //#---------------------------------------------------------------------------
    31 #ifndef SDREADER_H
    32 #define SDREADER_H
     1//
     2// C++ Interface: STFiller
     3//
     4// Description:
     5//
     6//
     7// Author: Malte Marquarding <asap@atnf.csiro.au>, (C) 2006
     8//
     9// Copyright: See COPYING file that comes with this distribution
     10//
     11//
     12#ifndef STFILLER_H
     13#define STFILLER_H
    3314
    3415#include <vector>
     
    4122#include <casa/Arrays/Vector.h>
    4223
    43 #include "SDMemTable.h"
     24#include "Scantable.h"
    4425#include "SDContainer.h"
    4526#include "SDLog.h"
     
    4930namespace asap {
    5031
    51 class SDReader : public SDLog {
     32/**
     33This class fills a Scantable from external data formats using the PKSReader class.
     34
     35@author   Malte Marquarding
     36@date     2006/01/16
     37@version  2.0a
     38*/
     39class STFiller : public SDLog {
    5240public:
    53   SDReader();
    54   SDReader(const std::string& filename,
    55            int whichIF=-1, int whichBeam=-1);
    56   SDReader(casa::CountedPtr<SDMemTable> tbl);
    57   virtual ~SDReader();
    5841
    59   void open(const std::string& filename,
    60             int whichIF=-1,
    61             int whichBeam=-1);
    62   void close();
    63   int read(const std::vector<int>& seq);
     42  STFiller();
    6443
    65   casa::CountedPtr<SDMemTable> getTable() const { return table_;}
    66 
    67   void reset();
    68 
    69   std::vector<int> pseudoHeader() const {
    70     std::vector<int> v;
    71     v.push_back(nBeam_);v.push_back(nIF_);
    72     v.push_back(nPol_);v.push_back(nChan_);
    73     return v;
    74   }
     44  STFiller(casa::CountedPtr< Scantable > stbl);
    7545
    7646
    77 protected:
    78  
     47  /**
     48    * A constructor for a filler with associated input file
     49    * @param filename the input file (rpf,sdfite or ms)
     50    * @param whichIF read a specific IF only (default -1 means all IFs)
     51    * @param whichBeam read a specific beam only (default -1 means all beams)
     52    */
     53  STFiller( const std::string& filename, int whichIF=-1,
     54                  int whichBeam=-1 );
     55
     56  ~STFiller();
     57
     58  /**
     59   * associate the Filler with a file on disk
     60   * @param filename the input file (rpf,sdfite or ms)
     61   * @param whichIF read a specific IF only (default -1 means all IFs)
     62   * @param whichBeam read a specific beam only (default -1 means all beams)
     63   * @exception AipsError Creation of PKSreader failed
     64   */
     65  void open( const std::string& filename, int whichIF=-1, int whichBeam=-1 );
     66
     67  /**
     68   * detatch from file
     69   */
     70  void close( );
     71
     72  /**
     73   * Read in "rows" from the source file attached with open()
     74   * @return a status flag passed on by PKSreader
     75   */
     76  int read( );
     77
     78  casa::CountedPtr<Scantable> getTable() const { return table_;}
     79
    7980private:
    80   casa::Int nBeam_,nIF_,nPol_,nChan_;
    81   PKSreader* reader_; 
     81
     82  PKSreader* reader_;
    8283  SDHeader* header_;
    83   SDFrequencyTable* frequencies_;
    84   casa::CountedPtr<SDMemTable> table_;
    8584  casa::String filename_;
    86   casa::uInt cursor_;
    87   casa::Double timestamp_;
    88   casa::uInt beamOffset_, ifOffset_;
     85  casa::CountedPtr< Scantable > table_;
     86  casa::Int nIF_, nBeam_, nPol_, nChan_;
     87  casa::uInt ifOffset_, beamOffset_;
    8988  casa::Bool haveXPol_;
    9089};
    9190
    92 }// namespace
     91} // namespace
     92
    9393#endif
Note: See TracChangeset for help on using the changeset viewer.