source: trunk/src/Outputs/CatalogueSpecification.hh @ 1144

Last change on this file since 1144 was 1137, checked in by MatthewWhiting, 12 years ago

Just about solving #180 - all ascii output now has comments in the right places, with only the table data uncommented. The table written to the screen is unaffected. The log file summary stuff is also untouched, but it needs a rethink anyway...

File size: 3.0 KB
Line 
1// -----------------------------------------------------------------------
2// CatalogueSpecification.hh: Define the specification of a catalogue,
3//                            being a set of Columns
4// -----------------------------------------------------------------------
5// Copyright (C) 2006, Matthew Whiting, 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
9// Free Software Foundation; either version 2 of the License, or (at your
10// option) any later version.
11//
12// Duchamp is distributed in the hope that it will be useful, but WITHOUT
13// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15// for more details.
16//
17// You should have received a copy of the GNU General Public License
18// along with Duchamp; if not, write to the Free Software Foundation,
19// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
20//
21// Correspondence concerning Duchamp may be directed to:
22//    Internet email: Matthew.Whiting [at] atnf.csiro.au
23//    Postal address: Dr. Matthew Whiting
24//                    Australia Telescope National Facility, CSIRO
25//                    PO Box 76
26//                    Epping NSW 1710
27//                    AUSTRALIA
28// -----------------------------------------------------------------------
29#ifndef DUCHAMP_CATALOGUE_SPEC_H
30#define DUCHAMP_CATALOGUE_SPEC_H
31
32#include <duchamp/duchamp.hh>
33#include <duchamp/Outputs/columns.hh>
34#include <vector>
35#include <map>
36
37namespace duchamp {
38
39  namespace Catalogues {
40
41    class CatalogueSpecification
42    {
43    public:
44      CatalogueSpecification(){};
45      CatalogueSpecification(const CatalogueSpecification& other);
46      CatalogueSpecification& operator= (const CatalogueSpecification& other);
47      virtual ~CatalogueSpecification(){};
48
49      void addColumn(Column col);
50      Column &column(std::string type){return itsColumnList[itsTypeMap[type]];};
51      Column &column(int i){return itsColumnList[i];};
52      Column *pCol(int i){return &(itsColumnList[i]);};
53      void removeColumn(std::string type);
54      size_t size(){return itsColumnList.size();};
55     
56      void outputTableHeader(std::ostream &stream, Catalogues::DESTINATION tableType, bool flagWCS);
57
58      /// @brief Set the comment characters
59      void setCommentString(std::string comment){itsCommentString = comment;};
60      std::string commentString(){return itsCommentString;};
61
62    protected:
63      std::vector<Column> itsColumnList;
64      std::map<std::string, int> itsTypeMap;
65      std::string itsCommentString; ///< Any comment characters etc that need to be prepended to the table header
66
67    };
68
69
70    /// @brief Returns a vector of Col for results file output.
71    CatalogueSpecification getFullColSet(std::vector<Detection> &objectList, FitsHeader &head);
72   
73    /// @brief Returns a vector of Col for logfile output.
74    CatalogueSpecification getLogColSet(std::vector<Detection> &objectList, FitsHeader &head);
75
76  }
77
78}
79#endif
Note: See TracBrowser for help on using the repository browser.