source: trunk/src/Utils/VOField.hh @ 1213

Last change on this file since 1213 was 1101, checked in by MatthewWhiting, 12 years ago

Ticket #168: Updating the UCDs to make them unique across the catalogue, and to make the flux UCDs conditional on there being a spectral dimension (in which case we add spect.line.intensity). VOField interface has been updated as well.

File size: 3.6 KB
Line 
1// -----------------------------------------------------------------------
2// VOField.hh: Specification of a field for output to a VOTable
3// -----------------------------------------------------------------------
4// Copyright (C) 2006, Matthew Whiting, ATNF
5//
6// This program is free software; you can redistribute it and/or modify it
7// under the terms of the GNU General Public License as published by the
8// Free Software Foundation; either version 2 of the License, or (at your
9// option) any later version.
10//
11// Duchamp is distributed in the hope that it will be useful, but WITHOUT
12// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14// for more details.
15//
16// You should have received a copy of the GNU General Public License
17// along with Duchamp; if not, write to the Free Software Foundation,
18// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
19//
20// Correspondence concerning Duchamp may be directed to:
21//    Internet email: Matthew.Whiting [at] atnf.csiro.au
22//    Postal address: Dr. Matthew Whiting
23//                    Australia Telescope National Facility, CSIRO
24//                    PO Box 76
25//                    Epping NSW 1710
26//                    AUSTRALIA
27// -----------------------------------------------------------------------
28
29#ifndef VOFIELD_HH
30#define VOFIELD_HH
31
32#include <iostream>
33#include <sstream>
34#include <fstream>
35#include <iomanip>
36#include <string>
37#include <vector>
38#include <time.h>
39#include <duchamp/param.hh>
40#include <duchamp/fitsHeader.hh>
41#include <duchamp/Cubes/cubes.hh>
42#include <duchamp/Detection/detection.hh>
43#include <duchamp/Outputs/columns.hh>
44 
45
46namespace duchamp
47{
48
49  ///  @brief A class that holds information for a <FIELD > entry in a
50  ///  VOTable.
51  ///  @details It also provides useful functions to store and print
52  ///  that information.
53
54  class VOField
55  {
56  public:
57    VOField();
58    /// @brief Define a FIELD for a particular Catalogues::Column object 
59    VOField(Catalogues::Column);
60    VOField(const VOField& other);
61    VOField& operator= (const VOField& other);
62    virtual ~VOField(){};
63
64    /// @brief Define a FIELD by individual parameters
65    void define(std::string i, std::string n, std::string U, std::string u, std::string d, std::string r, int w, int p);
66    /// @brief Define a FIELD by individual parameters, using a Catalogues::Column object
67    void define(Catalogues::Column column, std::string i, std::string U, std::string d, std::string r);
68    /// @brief Define a FIELD by individual parameters, using only a Catalogues::Column object
69    void define(Catalogues::Column column);
70
71    void setID(std::string s){itsID=s;};
72    void setName(std::string s){itsName=s;};
73    void setUCD(std::string s){itsUCD=s;};
74    void setUnits(std::string s){itsUnits=s;};
75    void setDatatype(std::string s){itsDatatype=s;};
76    void setRef(std::string s){itsRef=s;};
77    void setWidth(int i){itsWidth=i;};
78    void setPrecision(int i){itsPrecision=i;};
79
80    std::string ID(){return itsID;};
81    std::string name(){return itsName;};
82    std::string UCD(){return itsUCD;};
83    std::string units(){return itsUnits;};
84    std::string datatype(){return itsDatatype;};
85    std::string ref(){return itsRef;};
86    int width(){return itsWidth;};
87    int precision(){return itsPrecision;};
88
89    /// @brief Print the FIELD entry
90    void printField(std::ostream &stream);
91   
92  private:
93    std::string itsID;
94    std::string itsName;
95    std::string itsUCD;
96    std::string itsUnits;
97    std::string itsDatatype;
98    std::string itsRef;
99    int itsWidth;
100    int itsPrecision;
101
102  };
103
104}
105
106#endif //VOFIELD_HH
Note: See TracBrowser for help on using the repository browser.