Changeset 80


Ignore:
Timestamp:
09/07/04 10:56:27 (20 years ago)
Author:
mar637
Message:

a) Changed interface to "taql" to allow for source name seraches.
b) updated to use CASA include paths

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/SDMemTable.cc

    r78 r80  
    3131
    3232
    33 #include <aips/iostream.h>
    34 #include <aips/iomanip.h>
    35 #include <aips/Arrays/Array.h>
    36 #include <aips/Arrays/ArrayMath.h>
    37 #include <aips/Arrays/MaskArrMath.h>
    38 #include <aips/Arrays/ArrayLogical.h>
    39 #include <aips/Arrays/ArrayAccessor.h>
    40 
    41 #include <aips/Tables/TableParse.h>
    42 #include <aips/Tables/TableDesc.h>
    43 #include <aips/Tables/SetupNewTab.h>
    44 #include <aips/Tables/ScaColDesc.h>
    45 #include <aips/Tables/ArrColDesc.h>
    46 
    47 #include <aips/Tables/ExprNode.h>
    48 #include <aips/Tables/ScalarColumn.h>
    49 #include <aips/Tables/ArrayColumn.h>
    50 #include <aips/Tables/TableRecord.h>
    51 #include <aips/Measures/MFrequency.h>
    52 #include <aips/Measures/MeasTable.h>
    53 #include <aips/Quanta/MVTime.h>
     33#include <casa/iostream.h>
     34#include <casa/iomanip.h>
     35#include <casa/Arrays/Array.h>
     36#include <casa/Arrays/ArrayMath.h>
     37#include <casa/Arrays/MaskArrMath.h>
     38#include <casa/Arrays/ArrayLogical.h>
     39#include <casa/Arrays/ArrayAccessor.h>
     40
     41#include <tables/Tables/TableParse.h>
     42#include <tables/Tables/TableDesc.h>
     43#include <tables/Tables/SetupNewTab.h>
     44#include <tables/Tables/ScaColDesc.h>
     45#include <tables/Tables/ArrColDesc.h>
     46
     47#include <tables/Tables/ExprNode.h>
     48#include <tables/Tables/ScalarColumn.h>
     49#include <tables/Tables/ArrayColumn.h>
     50#include <tables/Tables/TableRecord.h>
     51#include <measures/Measures/MFrequency.h>
     52#include <measures/Measures/MeasTable.h>
     53#include <casa/Quanta/MVTime.h>
    5454
    5555#include "SDMemTable.h"
     
    8888}
    8989
    90 SDMemTable::SDMemTable(const Table& tab, Int scanID) :
     90SDMemTable::SDMemTable(const Table& tab, const std::string& exprs) :
    9191  IFSel_(0),
    9292  beamSel_(0),
    9393  polSel_(0) {
    94   String exprs = String("select * from $1 where SCANID == ")
    95     +String::toString(scanID);
    9694  //cerr << exprs << endl;
    9795  Table t = tableCommand(exprs,tab);
     
    104102
    105103SDMemTable SDMemTable::getScan(Int scanID) {
    106   return SDMemTable(table_, scanID);
     104  String cond("SELECT * from $1 WHERE SCANID == ");
     105  cond += String::toString(scanID);
     106  return SDMemTable(table_, cond);
     107}
     108
     109SDMemTable SDMemTable::getSource(const std::string& source) {
     110  String cond("SELECT * from $1 WHERE SRCNAME == ");
     111  cond += source;
     112  return SDMemTable(table_, cond);
    107113}
    108114
  • trunk/src/SDMemTable.h

    r78 r80  
    2929//# $Id:
    3030//#---------------------------------------------------------------------------
    31 #ifndef _SDMEMTABLE_H_
    32 #define _SDMEMTABLE_H_
     31#ifndef _SDMEMTABLE_H
     32#define _SDMEMTABLE_H
    3333
    3434// STL
     
    3636#include <vector>
    3737// AIPS++
    38 #include <aips/aips.h>
    39 #include <aips/Utilities/String.h>
    40 #include <aips/Tables/Table.h>
    41 #include <aips/Arrays/MaskedArray.h>
     38#include <casa/aips.h>
     39#include <casa/BasicSL/String.h>
     40#include <tables/Tables/Table.h>
     41#include <casa/Arrays/MaskedArray.h>
    4242
    43 #include <trial/Coordinates/SpectralCoordinate.h>
     43#include <coordinates/Coordinates/SpectralCoordinate.h>
    4444
    4545namespace atnf_sd {
     
    6363  // Copy Construct a SDMemTable, give a scanid constraint
    6464  // see also getScan()
    65   SDMemTable(const Table& tab, Int scanID);
     65  SDMemTable(const Table& tab, const std::string& expr);
    6666
    6767  virtual ~SDMemTable();
     
    114114  // get a new SDMemTable containg all rows with the same give SCANID
    115115  SDMemTable getScan(Int scanID);
     116  SDMemTable getSource(const std::string& source);
    116117
    117118  const TableRecord& getHeader() const {return table_.keywordSet();}
  • trunk/src/SDMemTableWrapper.h

    r79 r80  
    2929//# $Id:
    3030//#---------------------------------------------------------------------------
    31 #ifndef _SDMEMTABLEWRAPPER_H_
    32 #define _SDMEMTABLEWRAPPER_H_
     31#ifndef _SDMEMTABLEWRAPPER_H
     32#define _SDMEMTABLEWRAPPER_H
    3333
    3434#include <vector>
     
    5050  SDMemTableWrapper(SDMemTable* sdmt) : table_(sdmt) {;}
    5151 
    52   SDMemTableWrapper(const SDMemTableWrapper& mt, int scan) :
    53     table_(new SDMemTable(mt.getCP()->table(), scan)) {;}
     52  SDMemTableWrapper(const SDMemTableWrapper& mt, const std::string& expr) :
     53    table_(new SDMemTable(mt.getCP()->table(), expr)) {;}
    5454 
    5555  SDMemTableWrapper getScan(int scan) {
    56     return SDMemTableWrapper(*this, scan);
     56    String cond("SELECT * from $1 WHERE SCANID == ");
     57    cond += String::toString(scan);
     58    return SDMemTableWrapper(*this, cond);
    5759  }
     60
     61  SDMemTableWrapper getSource(const std::string& source) {
     62    String cond("SELECT * from $1 WHERE SRCNAME == '");
     63    cond += source;cond += "'";
     64    return SDMemTableWrapper(*this, cond);
     65  }
     66
    5867  std::vector<float> getSpectrum(int whichRow=0) const {
    5968    return table_->getSpectrum(whichRow);
  • trunk/src/python_SDMemTable.cc

    r79 r80  
    4444    .def( init <> () )
    4545    .def( init < std::string > () )
    46     .def( init < SDMemTableWrapper, int > () )
     46    .def( init < SDMemTableWrapper, std::string > () )
    4747    .def("getscan", &SDMemTableWrapper::getScan)
     48    .def("getsource", &SDMemTableWrapper::getSource)
    4849    .def("getspectrum", &SDMemTableWrapper::getSpectrum,
    4950         (boost::python::arg("whichRow")=0) )
Note: See TracChangeset for help on using the changeset viewer.