LSSTApplications
20.0.0
LSSTDataManagementBasePackage
|
Go to the documentation of this file.
2 #ifndef AFW_TABLE_IO_FitsWriter_h_INCLUDED
3 #define AFW_TABLE_IO_FitsWriter_h_INCLUDED
36 template <
typename OutputT,
typename ContainerT>
37 static void apply(OutputT& output,
std::string const& mode, ContainerT
const& container,
int flags) {
43 template <
typename ContainerT>
46 std::static_pointer_cast<BaseTable const>(container.getTable())->makeFitsWriter(&
fits, flags);
47 writer->write(container);
57 template <
typename ContainerT>
58 void write(ContainerT
const& container) {
60 for (
typename ContainerT::const_iterator i = container.begin(); i != container.end(); ++i) {
61 if (i->getTable() != container.getTable()) tables.
insert(i->getTable());
65 if ((**j).getSchema().compare(container.getTable()->getSchema(),
Schema::IDENTICAL) !=
68 "Cannot save Catalog with heterogenous schemas");
71 _writeTable(container.getTable(), container.size());
72 for (
typename ContainerT::const_iterator i = container.begin(); i != container.end(); ++i) {
111 #endif // !AFW_TABLE_IO_FitsWriter_h_INCLUDED
FitsWriter & operator=(FitsWriter &&)=default
virtual void _writeRecord(BaseRecord const &source)
Write an individual record.
virtual void _finish()
Finish writing a catalog.
A simple struct that combines the two arguments that must be passed to most cfitsio routines and cont...
FitsWriter(FitsWriter const &)=default
const char * source()
Source function that allows astChannel to source from a Stream.
FitsWriter(Fits *fits, int flags)
Construct from a wrapped cfitsio pointer.
Base class for all records.
Reports errors in the logical structure of the program.
FitsWriter(FitsWriter &&)=default
FitsWriter & operator=(FitsWriter const &)=default
@ IDENTICAL
Everything is the same.
A base class for image defects.
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
virtual ~FitsWriter()=default
virtual void _writeTable(std::shared_ptr< BaseTable const > const &table, std::size_t nRows)
Write a table and its schema.
static void apply(Fits &fits, ContainerT const &container, int flags)
Low-level driver for writing FITS files, operating on an open FITS file.
Writer object for FITS binary tables.
void write(ContainerT const &container)
Write records in a container to disk.
static void apply(OutputT &output, std::string const &mode, ContainerT const &container, int flags)
Driver for writing FITS files.