LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
Classes | Namespaces | Macros | Functions
fits.h File Reference
#include <string>
#include <boost/format.hpp>
#include <boost/scoped_array.hpp>
#include "lsst/pex/exceptions.h"
#include "lsst/daf/base.h"
#include "ndarray.h"

Go to the source code of this file.

Classes

class  lsst::afw::fits::HeaderIterationFunctor
 An exception thrown when problems are found when reading or writing FITS files. More...
 
class  lsst::afw::fits::MemFileManager
 Lifetime-management for memory that goes into FITS memory files. More...
 
class  lsst::afw::fits::Fits
 A simple struct that combines the two arguments that must be passed to most cfitsio routines and contains thin and/or templated wrappers around common cfitsio routines. More...
 

Namespaces

 lsst
 Estimate image backgrounds.
 
 lsst::afw
 
 lsst::afw::fits
 

Macros

#define LSST_FITS_EXCEPT(type, fitsObj,...)   type(LSST_EXCEPT_HERE, lsst::afw::fits::makeErrorMessage((fitsObj).fptr, (fitsObj).status, __VA_ARGS__))
 
#define LSST_FITS_CHECK_STATUS(fitsObj,...)   if ((fitsObj).status != 0) throw LSST_FITS_EXCEPT(lsst::afw::fits::FitsError, fitsObj, __VA_ARGS__)
 

Functions

std::string lsst::afw::fits::makeErrorMessage (std::string const &fileName="", int status=0, std::string const &msg="")
 Return an error message reflecting FITS I/O errors. More...
 
std::string lsst::afw::fits::makeErrorMessage (std::string const &fileName, int status, boost::format const &msg)
 
std::string lsst::afw::fits::makeErrorMessage (void *fptr, int status=0, std::string const &msg="")
 Return an error message reflecting FITS I/O errors. More...
 
std::string lsst::afw::fits::makeErrorMessage (void *fptr, int status, boost::format const &msg)
 
template<typename T >
int lsst::afw::fits::getBitPix ()
 Return the cfitsio integer BITPIX code for the given data type. More...
 

Detailed Description

Utilities for working with FITS files. These are mostly thin wrappers around cfitsio calls, and their main purpose is to transform functions signatures from void pointers and cfitsio's preprocessor type enums to a more type-safe and convenient interface using overloads and templates.

This was written as part of implementing the afw/table library. Someday the afw/image FITS I/O should be modified to use some of these with the goal of eliminating a lot of code between the two.

Definition in file fits.h.

Macro Definition Documentation

#define LSST_FITS_CHECK_STATUS (   fitsObj,
  ... 
)    if ((fitsObj).status != 0) throw LSST_FITS_EXCEPT(lsst::afw::fits::FitsError, fitsObj, __VA_ARGS__)

Throw a FitsError exception if the status of the given Fits object is nonzero.

Definition at line 97 of file fits.h.

#define LSST_FITS_EXCEPT (   type,
  fitsObj,
  ... 
)    type(LSST_EXCEPT_HERE, lsst::afw::fits::makeErrorMessage((fitsObj).fptr, (fitsObj).status, __VA_ARGS__))

A FITS-related replacement for LSST_EXCEPT that takes an additional Fits object and uses makeErrorMessage(fitsObj.fptr, fitsObj.status, ...) to construct the message.

Definition at line 91 of file fits.h.