1 | // ----------------------------------------------------------------------- |
---|
2 | // ASCIICatalogueWriter.hh: Writing output catalogues to basic ASCII-format |
---|
3 | // files (or the screen). |
---|
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_ASCII_CATALOGUE_WRITER_H_ |
---|
30 | #define DUCHAMP_ASCII_CATALOGUE_WRITER_H_ |
---|
31 | |
---|
32 | #include <duchamp/Outputs/CatalogueWriter.hh> |
---|
33 | #include <duchamp/Outputs/FileCatalogueWriter.hh> |
---|
34 | #include <duchamp/Outputs/columns.hh> |
---|
35 | #include <duchamp/Detection/detection.hh> |
---|
36 | #include <ios> |
---|
37 | #include <iostream> |
---|
38 | #include <fstream> |
---|
39 | |
---|
40 | namespace duchamp { |
---|
41 | |
---|
42 | class ASCIICatalogueWriter : public FileCatalogueWriter |
---|
43 | { |
---|
44 | public: |
---|
45 | ASCIICatalogueWriter(); |
---|
46 | ASCIICatalogueWriter(std::string name); |
---|
47 | ASCIICatalogueWriter(Catalogues::DESTINATION dest); |
---|
48 | ASCIICatalogueWriter(std::string name, Catalogues::DESTINATION dest); |
---|
49 | ASCIICatalogueWriter(const ASCIICatalogueWriter& other); |
---|
50 | ASCIICatalogueWriter& operator= (const ASCIICatalogueWriter& other); |
---|
51 | virtual ~ASCIICatalogueWriter(){}; |
---|
52 | |
---|
53 | /// @brief open the catalogue for writing |
---|
54 | bool openCatalogue(std::ios_base::openmode mode = std::ios_base::out ); |
---|
55 | |
---|
56 | /// @brief Write header information - not including parameters |
---|
57 | void writeHeader(); |
---|
58 | void writeCommandLineEntry(int argc, char *argv[]); |
---|
59 | |
---|
60 | void writeParameters(); |
---|
61 | void writeStats(); |
---|
62 | void writeTableHeader(); |
---|
63 | void writeEntry(Detection *object); |
---|
64 | void writeCubeSummary(); |
---|
65 | void writeFooter(){}; |
---|
66 | |
---|
67 | bool closeCatalogue(); |
---|
68 | |
---|
69 | |
---|
70 | protected: |
---|
71 | std::ostream *itsStream; |
---|
72 | Catalogues::DESTINATION itsDestination; |
---|
73 | |
---|
74 | |
---|
75 | }; |
---|
76 | |
---|
77 | |
---|
78 | } |
---|
79 | |
---|
80 | |
---|
81 | #endif |
---|