SourceXtractorPlusPlus
1.0.3
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
SEImplementation
SEImplementation
Output
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
13
#include "
SEImplementation/Output/FlushableOutput.h
"
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
:
42
std::string
m_filename
;
43
int
m_part_nb
;
44
45
std::shared_ptr<Euclid::Table::FitsWriter>
m_fits_writer
;
46
};
47
48
}
49
50
#endif
/* _SEIMPLEMENTATION_OUTPUT_FITSOUTPUT_H_ */
FlushableOutput.h
std::string
std::stringstream
Euclid::Table::Table
SourceXtractor::FitsOutput::m_fits_writer
std::shared_ptr< Euclid::Table::FitsWriter > m_fits_writer
Definition
FitsOutput.h:45
SourceXtractor::FitsOutput::nextPart
void nextPart() override
Definition
FitsOutput.h:26
SourceXtractor::FitsOutput::m_part_nb
int m_part_nb
Definition
FitsOutput.h:43
SourceXtractor::FitsOutput::writeRows
void writeRows(const std::vector< Euclid::Table::Row > &rows) override
Definition
FitsOutput.h:36
SourceXtractor::FitsOutput::m_filename
std::string m_filename
Definition
FitsOutput.h:42
SourceXtractor::FitsOutput::FitsOutput
FitsOutput(const std::string &filename, SourceToRowConverter source_to_row, size_t flush_size)
Definition
FitsOutput.h:20
SourceXtractor::FlushableOutput::FlushableOutput
FlushableOutput(SourceToRowConverter source_to_row, size_t flush_size)
Definition
FlushableOutput.h:22
SourceXtractor::FlushableOutput::SourceToRowConverter
std::function< Euclid::Table::Row(const SourceInterface &)> SourceToRowConverter
Definition
FlushableOutput.h:20
std::make_shared
T make_shared(T... args)
SourceXtractor
Definition
Aperture.h:30
std::shared_ptr
std::stringstream::str
T str(T... args)
std::vector
Generated by
1.14.0