Changeset 125 for trunk/src/SDMemTable.h
- Timestamp:
- 12/10/04 14:54:54 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/SDMemTable.h
r105 r125 3 3 //#--------------------------------------------------------------------------- 4 4 //# Copyright (C) 2004 5 //# Malte Marquarding,ATNF5 //# ATNF 6 6 //# 7 7 //# This program is free software; you can redistribute it and/or modify it … … 29 29 //# $Id: 30 30 //#--------------------------------------------------------------------------- 31 #ifndef _SDMEMTABLE_H32 #define _SDMEMTABLE_H31 #ifndef SDMEMTABLE_H 32 #define SDMEMTABLE_H 33 33 34 34 // STL … … 59 59 // Copy Construct a SDMemTable, if clear==True only header and 60 60 // 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); 62 62 63 63 // Copy Construct a SDMemTable, give a scanid constraint 64 64 // see also getScan() 65 SDMemTable(const Table& tab, const std::string& expr);65 SDMemTable(const casa::Table& tab, const std::string& expr); 66 66 67 67 virtual ~SDMemTable(); … … 73 73 74 74 //get the dat wrapped up in a meta container 75 SDContainer getSDContainer( uInt whichRow=0) const;75 SDContainer getSDContainer(casa::uInt whichRow=0) const; 76 76 SDHeader getSDHeader() const; 77 77 SDFrequencyTable getSDFreqTable() const; 78 78 // get spectrum,mask and tsys for the given row, at the selected 79 79 // 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; 82 82 83 virtual Float getTsys(Int whichRow=0) const;83 virtual casa::Float getTsys(casa::Int whichRow=0) const; 84 84 // 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); 86 87 87 88 //virtual void getMask(Vector<Bool>& mask,Int whichRow=0) const; 88 89 89 90 // 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; 93 94 94 95 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); 96 98 virtual void setCoordInfo(std::vector<string> theinfo); 97 99 // 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); 101 103 102 104 //sets the user mask applied to all spectra … … 106 108 107 109 // 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_; } 111 113 virtual std::vector<string> getCoordInfo() const; 112 114 113 115 // number of scans in table 114 virtual Int nScan() const;116 virtual casa::Int nScan() const; 115 117 116 118 // print a summary to stdout … … 121 123 122 124 // get a new SDMemTable containing all rows with the same give SCANID 123 SDMemTable getScan( Int scanID);125 SDMemTable getScan(casa::Int scanID); 124 126 SDMemTable getSource(const std::string& source); 125 127 126 const TableRecord& getHeader() const {return table_.keywordSet();}128 const casa::TableRecord& getHeader() const {return table_.keywordSet();} 127 129 // get a handle to the "raw" aips++ table 128 const Table& table() { return table_; }130 const casa::Table& table() { return table_; } 129 131 130 132 // 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; 135 137 136 138 // return the number of rows (integrations) in the table 137 Int nRow() const { return table_.nrow(); }139 casa::Int nRow() const { return table_.nrow(); } 138 140 139 141 // return a row as a Masked array, internally converting uChar flags 140 142 // 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); 143 145 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); 146 149 147 Int nCoordinates() const;150 casa::Int nCoordinates() const; 148 151 149 152 std::vector<double> getAbscissa(int whichRow=0); 150 std::string getAbscissaString( Int whichRow=0);153 std::string getAbscissaString(casa::Int whichRow=0); 151 154 152 155 private: 153 156 // utility func for nice printout 154 String formatSec(Double x);157 casa::String formatSec(casa::Double x); 155 158 void setup(); 156 159 // the current cursor into the array 157 Int IFSel_,beamSel_,polSel_;160 casa::Int IFSel_,beamSel_,polSel_; 158 161 std::vector<bool> chanMask_; 159 162 // the underlying memory table 160 Table table_;163 casa::Table table_; 161 164 }; 162 165
Note: See TracChangeset
for help on using the changeset viewer.