casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SearchEngine.h
Go to the documentation of this file.
1 //# MSContinuumSubtractor.h: Fit & subtract continuum from spectral line data
2 //# Copyright (C) 2004
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //# $Id$
27 //#
28 #ifndef SPLAT_SEARCHENGINE_H
29 #define SPLAT_SEARCHENGINE_H
30 
31 #include <casa/aips.h>
32 
33 #include <casa/Arrays/Vector.h>
34 #include <casa/BasicSL/String.h>
35 #include <casa/Logging/LogIO.h>
37 
38 namespace casa {
39 
40 // <summary>Performs a query on a splatalogue spectral line table</summary>
41 // <use visibility=export>
42 //
43 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
44 // </reviewed>
45 //
46 
47 // <etymology>
48 // Searches a splatalogue table.
49 // </etymology>
50 //
51 // <synopsis>
52 // It is a requirement that users be able to perform searches on spectral
53 // line tables they import from Splatalogue.
54 // </synopsis>
55 //
56 // <example>
57 // <srcBlock>
58 // SearchEngine searcher(...);
59 // SplatalogueTable *resTable = searcher.search();
60 // </srcBlock>
61 // </example>
62 //
63 // <motivation>
64 // A class to for splatalogue spectral line searches.
65 // </motivation>
66 //
67 // <todo asof="">
68 // </todo>
69 
70 
72 {
73 public:
74  // <src>table</src> casacore::Input spectral line table to search.
75  // <src>list</src> casacore::List result set of search to logger (and optional logfile)?
76  // <src>logfile</src> Logfile to list results to. Only used if list=true. If empty, no logfile is created.
77  // <src>append</src> Append results to logfile (true) or overwrite logfile (false) if it exists? Only used if list=true and logfile not empty.
79  const SplatalogueTable* const table, const casacore::Bool list,
80  const casacore::String& logfile, const casacore::Bool append
81  );
82 
83  //destuctor
84  ~SearchEngine();
85 
86  // Search the table. It is the caller's responsibility to delete the returned pointer.
88  const casacore::String& resultsTableName, const casacore::Double freqLow, const casacore::Double freqHigh,
89  const casacore::Vector<casacore::String>& species, const casacore::Bool recommendedOnly,
91  const casacore::Double intensityLow, const casacore::Double intensityHigh,
92  const casacore::Double smu2Low, const casacore::Double smu2High,
93  const casacore::Double logaLow, const casacore::Double logaHigh,
94  const casacore::Double elLow, const casacore::Double elHigh,
95  const casacore::Double euLow, const casacore::Double euHigh,
96  const casacore::Bool includeRRLs, const casacore::Bool onlyRRLs
97  ) const;
98 
99  // Get the unique species in the table.
101 
102  // Get the unique chemical names in the table.
104 
105 private:
110  SearchEngine();
111 
113  const casacore::String& col, const casacore::Double low, const casacore::Double high
114  ) const;
115 
116  // If the query table is currently not on disk, this method will temporarily
117  // write a copy of it to disk and query it, and then remove the copy from disk.
118  // The method returns the query results table.
119  casacore::Table _runQuery(const casacore::String& query) const;
120 
121  void _logIt(const casacore::String& logString) const;
122 };
123 
124 
125 } //# NAMESPACE CASA - END
126 
127 #endif
casacore::Table _runQuery(const casacore::String &query) const
If the query table is currently not on disk, this method will temporarily write a copy of it to disk ...
casacore::String _logfile
Definition: SearchEngine.h:108
const casacore::Bool _append
Definition: SearchEngine.h:109
Main interface class to a read/write table.
Definition: Table.h:153
casacore::Vector< casacore::String > uniqueChemicalNames() const
Get the unique chemical names in the table.
ostream-like interface to creating log messages.
Definition: LogIO.h:167
casacore::Vector< casacore::String > uniqueSpecies() const
Get the unique species in the table.
const SplatalogueTable * _table
Definition: SearchEngine.h:107
SplatalogueTable * search(const casacore::String &resultsTableName, const casacore::Double freqLow, const casacore::Double freqHigh, const casacore::Vector< casacore::String > &species, const casacore::Bool recommendedOnly, const casacore::Vector< casacore::String > &chemNames, const casacore::Vector< casacore::String > &qns, const casacore::Double intensityLow, const casacore::Double intensityHigh, const casacore::Double smu2Low, const casacore::Double smu2High, const casacore::Double logaLow, const casacore::Double logaHigh, const casacore::Double elLow, const casacore::Double elHigh, const casacore::Double euLow, const casacore::Double euHigh, const casacore::Bool includeRRLs, const casacore::Bool onlyRRLs) const
Search the table.
double Double
Definition: aipstype.h:55
casacore::String _getBetweenClause(const casacore::String &col, const casacore::Double low, const casacore::Double high) const
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
void _logIt(const casacore::String &logString) const
Representation of a Splatalogue casacore::Table.
String: the storage and methods of handling collections of characters.
Definition: String.h:223
casacore::LogIO * _log
Definition: SearchEngine.h:106
~SearchEngine()
destuctor
Performs a query on a splatalogue spectral line table.
Definition: SearchEngine.h:71
const casacore::Bool _list
Definition: SearchEngine.h:109