2 #ifndef AFW_TABLE_IO_FitsWriter_h_INCLUDED 3 #define AFW_TABLE_IO_FitsWriter_h_INCLUDED 36 template <
typename OutputT,
typename ContainerT>
39 apply(fits, container, flags);
43 template <
typename ContainerT>
44 static void apply(Fits&
fits, ContainerT
const& container,
int 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 const &)=default
Writer object for FITS binary tables.
void write(ContainerT const &container)
Write records in a container to disk.
A simple struct that combines the two arguments that must be passed to most cfitsio routines and cont...
A base class for image defects.
virtual ~FitsWriter()=default
const char * source()
Source function that allows astChannel to source from a Stream.
T static_pointer_cast(T... args)
static void apply(Fits &fits, ContainerT const &container, int flags)
Low-level driver for writing FITS files, operating on an open FITS file.
Reports errors in the logical structure of the program.
virtual void _writeTable(std::shared_ptr< BaseTable const > const &table, std::size_t nRows)
Write a table and its schema.
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Base class for all records.
static void apply(OutputT &output, std::string const &mode, ContainerT const &container, int flags)
Driver for writing FITS files.
virtual void _writeRecord(BaseRecord const &source)
Write an individual record.
virtual void _finish()
Finish writing a catalog.
Base class for all tables.
FitsWriter(Fits *fits, int flags)
Construct from a wrapped cfitsio pointer.