SourceXtractorPlusPlus  0.19
SourceXtractor++, the next generation SExtractor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FitsOutput.h
Go to the documentation of this file.
1 /*
2  * FitsOutput.h
3  *
4  * Created on: Feb 8, 2022
5  * Author: mschefer
6  */
7 
8 #ifndef _SEIMPLEMENTATION_OUTPUT_FITSOUTPUT_H_
9 #define _SEIMPLEMENTATION_OUTPUT_FITSOUTPUT_H_
10 
11 #include "Table/FitsWriter.h"
12 
14 
15 namespace SourceXtractor {
16 
17 class FitsOutput : public FlushableOutput {
18 
19 public:
20  FitsOutput (const std::string& filename, SourceToRowConverter source_to_row, size_t flush_size)
21  : FlushableOutput(source_to_row, flush_size), m_filename(filename), m_part_nb(0) {
22  m_fits_writer = std::make_shared<Euclid::Table::FitsWriter>(m_filename, true);
23  m_fits_writer->setHduName("CATALOG");
24  }
25 
26  void nextPart() override {
27  m_part_nb++;
28  std::stringstream hdu_name;
29  hdu_name << "CATALOG_" << m_part_nb;
30 
31  m_fits_writer = std::make_shared<Euclid::Table::FitsWriter>(m_filename);
32  m_fits_writer->setHduName(hdu_name.str());
33  }
34 
35 protected:
36  void writeRows(const std::vector<Euclid::Table::Row>& rows) override {
37  Euclid::Table::Table table {rows};
38  m_fits_writer->addData(table);
39  }
40 
41 private:
43  int m_part_nb;
44 
46 };
47 
48 }
49 
50 #endif /* _SEIMPLEMENTATION_OUTPUT_FITSOUTPUT_H_ */
STL class.
void nextPart() override
Definition: FitsOutput.h:26
void writeRows(const std::vector< Euclid::Table::Row > &rows) override
Definition: FitsOutput.h:36
string filename
Definition: conf.py:65
T str(T...args)
std::shared_ptr< Euclid::Table::FitsWriter > m_fits_writer
Definition: FitsOutput.h:45
FitsOutput(const std::string &filename, SourceToRowConverter source_to_row, size_t flush_size)
Definition: FitsOutput.h:20