[440] | 1 | // ----------------------------------------------------------------------- |
---|
| 2 | // VOTable.hh: Output of the detected objects 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 VOTABLE_HH |
---|
| 30 | #define VOTABLE_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/Detection/columns.hh> |
---|
| 44 | |
---|
| 45 | |
---|
| 46 | namespace duchamp |
---|
| 47 | { |
---|
| 48 | |
---|
[528] | 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 | |
---|
[440] | 54 | class VOField |
---|
| 55 | { |
---|
| 56 | public: |
---|
[528] | 57 | /// @brief Define a FIELD by individual parameters |
---|
[440] | 58 | void define(std::string i, std::string n, std::string U, std::string u, std::string d, std::string r, int w, int p); |
---|
[528] | 59 | /// @brief Define a FIELD by individual parameters, using a Column::Col object |
---|
[440] | 60 | void define(Column::Col column, std::string i, std::string U, std::string d, std::string r); |
---|
[528] | 61 | /// @brief Define a FIELD for a particular Column::Col object |
---|
[440] | 62 | void define(Column::Col); |
---|
[484] | 63 | |
---|
[440] | 64 | void setUCD(std::string u){UCD=u;}; |
---|
| 65 | |
---|
[528] | 66 | /// @brief Print the FIELD entry |
---|
[440] | 67 | void printField(std::ostream &stream); |
---|
| 68 | |
---|
| 69 | private: |
---|
| 70 | std::string ID; |
---|
| 71 | std::string name; |
---|
| 72 | std::string UCD; |
---|
| 73 | std::string unit; |
---|
| 74 | std::string datatype; |
---|
| 75 | std::string ref; |
---|
| 76 | int width; |
---|
| 77 | int precision; |
---|
| 78 | |
---|
| 79 | }; |
---|
| 80 | |
---|
[528] | 81 | /// @brief A class that holds information for a <PARAM > entry in a |
---|
| 82 | /// VOTable. @details It also provides useful functions to store |
---|
| 83 | /// and print that information. |
---|
[440] | 84 | class VOParam |
---|
| 85 | { |
---|
| 86 | public: |
---|
[528] | 87 | /// @brief Define a PARAM by individual parameters |
---|
[512] | 88 | template <class T> void define(std::string n, std::string U, std::string d, T v, int w, std::string u); |
---|
[440] | 89 | |
---|
[528] | 90 | /// @brief Print the PARAM entry |
---|
[440] | 91 | void printParam(std::ostream &stream); |
---|
| 92 | |
---|
| 93 | private: |
---|
| 94 | std::string name; |
---|
| 95 | std::string UCD; |
---|
| 96 | std::string datatype; |
---|
| 97 | std::string value; |
---|
| 98 | int width; |
---|
[512] | 99 | std::string units; |
---|
[440] | 100 | |
---|
| 101 | }; |
---|
| 102 | |
---|
| 103 | } |
---|
| 104 | |
---|
| 105 | #endif //VOTABLE_HH |
---|