Changeset 125 for trunk/src/SDMemTable.h


Ignore:
Timestamp:
12/10/04 14:54:54 (20 years ago)
Author:
mar637
Message:

Moved to casa namespace.
Adjusted the copyright to be ATNF.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/SDMemTable.h

    r105 r125  
    33//#---------------------------------------------------------------------------
    44//# Copyright (C) 2004
    5 //# Malte Marquarding, ATNF
     5//# ATNF
    66//#
    77//# This program is free software; you can redistribute it and/or modify it
     
    2929//# $Id:
    3030//#---------------------------------------------------------------------------
    31 #ifndef _SDMEMTABLE_H
    32 #define _SDMEMTABLE_H
     31#ifndef SDMEMTABLE_H
     32#define SDMEMTABLE_H
    3333
    3434// STL
     
    5959  // Copy Construct a SDMemTable, if clear==True only header and
    6060  // skeleton are copied, otherwise the whole table is copied.
    61   SDMemTable(const SDMemTable& other, Bool clear=False);
     61  SDMemTable(const SDMemTable& other, casa::Bool clear);
    6262
    6363  // Copy Construct a SDMemTable, give a scanid constraint
    6464  // see also getScan()
    65   SDMemTable(const Table& tab, const std::string& expr);
     65  SDMemTable(const casa::Table& tab, const std::string& expr);
    6666
    6767  virtual ~SDMemTable();
     
    7373
    7474  //get the dat wrapped up in a meta container
    75   SDContainer getSDContainer(uInt whichRow=0) const;
     75  SDContainer getSDContainer(casa::uInt whichRow=0) const;
    7676  SDHeader getSDHeader() const;
    7777  SDFrequencyTable getSDFreqTable() const;
    7878  // get spectrum,mask and tsys for the given row, at the selected
    7979  // cursor - all as stl vectors
    80   virtual std::vector<float> getSpectrum(Int whichRow=0) const;
    81   virtual std::vector<bool> getMask(Int whichRow=0) const;
     80  virtual std::vector<float> getSpectrum(casa::Int whichRow=0) const;
     81  virtual std::vector<bool> getMask(casa::Int whichRow=0) const;
    8282
    83   virtual Float getTsys(Int whichRow=0) const;
     83  virtual casa::Float getTsys(casa::Int whichRow=0) const;
    8484  // get all as aips++ Vectors
    85   virtual void getSpectrum(Vector<Float>& spectrum, Int whichRow=0);
     85  virtual void getSpectrum(casa::Vector<casa::Float>& spectrum,
     86                           casa::Int whichRow=0);
    8687
    8788  //virtual void getMask(Vector<Bool>& mask,Int whichRow=0) const;
    8889
    8990  // get info for current row
    90   std::string getTime(Int whichRow=0) const ;
    91   std::string getSourceName(Int whichRow=0) const;
    92   double getInterval(Int whichRow=0) const;
     91  std::string getTime(casa::Int whichRow=0) const ;
     92  std::string getSourceName(casa::Int whichRow=0) const;
     93  double getInterval(casa::Int whichRow=0) const;
    9394
    9495  virtual void setSpectrum(std::vector<float> spectrum, int whichRow=0);
    95   virtual void setRestFreqs(std::vector<double> freqs, const std::string& theunit);
     96  virtual void setRestFreqs(std::vector<double> freqs,
     97                            const std::string& theunit);
    9698  virtual void setCoordInfo(std::vector<string> theinfo);
    9799  // set the current value
    98   virtual bool setIF(Int whichIF=0);
    99   virtual bool setBeam(Int whichBeam=0);
    100   virtual bool setPol(Int whichPol=0);
     100  virtual bool setIF(casa::Int whichIF=0);
     101  virtual bool setBeam(casa::Int whichBeam=0);
     102  virtual bool setPol(casa::Int whichPol=0);
    101103
    102104  //sets the user mask applied to all spectra
     
    106108
    107109  // return the currently selected values
    108   virtual Int getIF() { return IFSel_; }
    109   virtual Int getBeam() { return beamSel_; }
    110   virtual Int getPol() { return polSel_; }
     110  virtual casa::Int getIF() { return IFSel_; }
     111  virtual casa::Int getBeam() { return beamSel_; }
     112  virtual casa::Int getPol() { return polSel_; }
    111113  virtual std::vector<string> getCoordInfo() const;
    112114
    113115  // number of scans in table
    114   virtual Int nScan() const;
     116  virtual casa::Int nScan() const;
    115117
    116118  // print a summary to stdout
     
    121123
    122124  // get a new SDMemTable containing all rows with the same give SCANID
    123   SDMemTable getScan(Int scanID);
     125  SDMemTable getScan(casa::Int scanID);
    124126  SDMemTable getSource(const std::string& source);
    125127
    126   const TableRecord& getHeader() const {return table_.keywordSet();}
     128  const casa::TableRecord& getHeader() const {return table_.keywordSet();}
    127129  // get a handle to the "raw" aips++ table
    128   const Table& table() { return table_; }
     130  const casa::Table& table() { return table_; }
    129131
    130132  // return the number of values
    131   Int nBeam() const;
    132   Int nIF() const;
    133   Int nPol() const;
    134   Int nChan() const;
     133  casa::Int nBeam() const;
     134  casa::Int nIF() const;
     135  casa::Int nPol() const;
     136  casa::Int nChan() const;
    135137
    136138  // return the number of rows (integrations) in the table
    137   Int nRow() const { return table_.nrow(); }
     139  casa::Int nRow() const { return table_.nrow(); }
    138140
    139141  // return a row as a Masked array, internally converting uChar flags
    140142  // to bool mask
    141   MaskedArray<Float> rowAsMaskedArray(uInt whichRow,
    142                                       Bool useSelection = False);
     143  casa::MaskedArray<casa::Float> rowAsMaskedArray(casa::uInt whichRow,
     144                                                  casa::Bool useSelection = casa::False);
    143145
    144   SpectralCoordinate getCoordinate(uInt whichIdx) const;
    145   Bool setCoordinate(const SpectralCoordinate& speccord, uInt whichIdx);
     146  casa::SpectralCoordinate getCoordinate(casa::uInt whichIdx) const;
     147  casa::Bool setCoordinate(const casa::SpectralCoordinate& speccord,
     148                           casa::uInt whichIdx);
    146149
    147   Int nCoordinates() const;
     150  casa::Int nCoordinates() const;
    148151
    149152  std::vector<double> getAbscissa(int whichRow=0);
    150   std::string getAbscissaString(Int whichRow=0);
     153  std::string getAbscissaString(casa::Int whichRow=0);
    151154
    152155private:
    153156  // utility func for nice printout
    154   String formatSec(Double x);
     157  casa::String formatSec(casa::Double x);
    155158  void setup();
    156159  // the current cursor into the array
    157   Int IFSel_,beamSel_,polSel_;
     160  casa::Int IFSel_,beamSel_,polSel_;
    158161  std::vector<bool> chanMask_;
    159162  // the underlying memory table
    160   Table table_;
     163  casa::Table table_;
    161164};
    162165
Note: See TracChangeset for help on using the changeset viewer.