source: branches/OptimisedGrowerTesting/src/Outputs/CatalogueSpecification.hh @ 1441

Last change on this file since 1441 was 1153, checked in by MatthewWhiting, 11 years ago

Ticket #173 - Doing the same for the error on the total flux. Also fixing the interface with the VOTable output, and improving the way the catalogue specification handles deleted columns.

File size: 3.1 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      bool hasColumn(std::string type);
55      void setMap();
56      size_t size(){return itsColumnList.size();};
57     
58      void outputTableHeader(std::ostream &stream, Catalogues::DESTINATION tableType, bool flagWCS);
59
60      /// @brief Set the comment characters
61      void setCommentString(std::string comment){itsCommentString = comment;};
62      std::string commentString(){return itsCommentString;};
63
64    protected:
65      std::vector<Column> itsColumnList;
66      std::map<std::string, int> itsTypeMap;
67      std::string itsCommentString; ///< Any comment characters etc that need to be prepended to the table header
68
69    };
70
71
72    /// @brief Returns a vector of Col for results file output.
73    CatalogueSpecification getFullColSet(std::vector<Detection> &objectList, FitsHeader &head);
74   
75    /// @brief Returns a vector of Col for logfile output.
76    CatalogueSpecification getLogColSet(std::vector<Detection> &objectList, FitsHeader &head);
77
78  }
79
80}
81#endif
Note: See TracBrowser for help on using the repository browser.