LSST Applications 27.0.0,g0265f82a02+469cd937ee,g02d81e74bb+21ad69e7e1,g1470d8bcf6+cbe83ee85a,g2079a07aa2+e67c6346a6,g212a7c68fe+04a9158687,g2305ad1205+94392ce272,g295015adf3+81dd352a9d,g2bbee38e9b+469cd937ee,g337abbeb29+469cd937ee,g3939d97d7f+72a9f7b576,g487adcacf7+71499e7cba,g50ff169b8f+5929b3527e,g52b1c1532d+a6fc98d2e7,g591dd9f2cf+df404f777f,g5a732f18d5+be83d3ecdb,g64a986408d+21ad69e7e1,g858d7b2824+21ad69e7e1,g8a8a8dda67+a6fc98d2e7,g99cad8db69+f62e5b0af5,g9ddcbc5298+d4bad12328,ga1e77700b3+9c366c4306,ga8c6da7877+71e4819109,gb0e22166c9+25ba2f69a1,gb6a65358fc+469cd937ee,gbb8dafda3b+69d3c0e320,gc07e1c2157+a98bf949bb,gc120e1dc64+615ec43309,gc28159a63d+469cd937ee,gcf0d15dbbd+72a9f7b576,gdaeeff99f8+a38ce5ea23,ge6526c86ff+3a7c1ac5f1,ge79ae78c31+469cd937ee,gee10cc3b42+a6fc98d2e7,gf1cff7945b+21ad69e7e1,gfbcc870c63+9a11dc8c8f
LSST Data Management Base Package
Loading...
Searching...
No Matches
Namespaces | Macros | Typedefs | Functions
fits.cc File Reference
#include <cstdint>
#include <cstdio>
#include <complex>
#include <cmath>
#include <sstream>
#include <unordered_set>
#include <unordered_map>
#include <filesystem>
#include <regex>
#include <cctype>
#include "fitsio.h"
#include "fitsio2.h"
#include "boost/algorithm/string.hpp"
#include "boost/preprocessor/seq/for_each.hpp"
#include "boost/format.hpp"
#include "lsst/pex/exceptions.h"
#include "lsst/log/Log.h"
#include "lsst/afw/fits.h"
#include "lsst/geom/Angle.h"
#include "lsst/afw/geom/wcsUtils.h"
#include "lsst/afw/fitsCompression.h"

Go to the source code of this file.

Namespaces

namespace  lsst
 
namespace  lsst::afw
 
namespace  lsst::afw::fits
 
namespace  lsst::afw::fits::detail
 

Macros

#define INSTANTIATE_KEY_OPS(r, data, T)
 
#define INSTANTIATE_IMAGE_OPS(r, data, T)
 
#define INSTANTIATE_TABLE_OPS(r, data, T)
 
#define INSTANTIATE_TABLE_ARRAY_OPS(r, data, T)
 
#define KEY_TYPES
 
#define COLUMN_TYPES
 
#define COLUMN_ARRAY_TYPES
 
#define IMAGE_TYPES    (unsigned char)(short)(unsigned short)(int)(unsigned int)(std::int64_t)(std::uint64_t)(float)(double)
 

Typedefs

using lsst::afw::fits::dafPlistPtr = std::shared_ptr<daf::base::PropertyList>
 

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.
 
std::string lsst::afw::fits::makeErrorMessage (void *fptr, int status=0, std::string const &msg="")
 Return an error message reflecting FITS I/O errors.
 
std::string lsst::afw::fits::makeLimitedFitsHeader (lsst::daf::base::PropertySet const &metadata, std::set< std::string > const &excludeNames={})
 Format a PropertySet into an FITS header string in a simplistic fashion.
 
template<typename T >
int lsst::afw::fits::getBitPix ()
 Return the cfitsio integer BITPIX code for the given data type.
 
void lsst::afw::fits::setAllowImageCompression (bool allow)
 
bool lsst::afw::fits::getAllowImageCompression ()
 
std::shared_ptr< daf::base::PropertyListlsst::afw::fits::combineMetadata (daf::base::PropertyList const &first, daf::base::PropertyList const &second)
 Combine two sets of metadata in a FITS-appropriate fashion.
 
template<typename T , typename... Args>
dafPlistPtr lsst::afw::fits::detail::_readMetadata (T &&fitsparm, bool strip, Args... args)
 
std::shared_ptr< daf::base::PropertyListlsst::afw::fits::readMetadata (std::string const &fileName, int hdu=DEFAULT_HDU, bool strip=false)
 Read FITS header.
 
std::shared_ptr< daf::base::PropertyListlsst::afw::fits::readMetadata (std::string const &fileName, std::string const &hduname, HduType type=HduType::ANY, int hduver=0, bool strip=false)
 Read FITS header.
 
std::shared_ptr< daf::base::PropertyListlsst::afw::fits::readMetadata (fits::MemFileManager &manager, int hdu=DEFAULT_HDU, bool strip=false)
 Read FITS header.
 
std::shared_ptr< daf::base::PropertyListlsst::afw::fits::readMetadata (fits::MemFileManager &manager, std::string const &hduname, HduType type=HduType::ANY, int hduver=0, bool strip=false)
 Read FITS header.
 
std::shared_ptr< daf::base::PropertyListlsst::afw::fits::readMetadata (fits::Fits &fitsfile, bool strip=false)
 Read FITS header.
 

Macro Definition Documentation

◆ COLUMN_ARRAY_TYPES

#define COLUMN_ARRAY_TYPES
Value:

Definition at line 1891 of file fits.cc.

1891#define COLUMN_ARRAY_TYPES \
1892 (bool)(char)(std::uint8_t)(std::int16_t)(std::uint16_t)(std::int32_t)(std::uint32_t)(std::int64_t)( \
1893 float)(double)(lsst::geom::Angle)(std::complex<float>)(std::complex<double>)

◆ COLUMN_TYPES

#define COLUMN_TYPES
Value:

Definition at line 1887 of file fits.cc.

1887#define COLUMN_TYPES \
1888 (bool)(std::string)(std::int8_t)(std::uint8_t)(std::int16_t)(std::uint16_t)(std::int32_t)(std::uint32_t) \
1889 (std::int64_t)(float)(double)(lsst::geom::Angle)(std::complex<float>)(std::complex<double>)

◆ IMAGE_TYPES

#define IMAGE_TYPES    (unsigned char)(short)(unsigned short)(int)(unsigned int)(std::int64_t)(std::uint64_t)(float)(double)

Definition at line 1895 of file fits.cc.

1895#define IMAGE_TYPES \
1896 (unsigned char)(short)(unsigned short)(int)(unsigned int)(std::int64_t)(std::uint64_t)(float)(double)

◆ INSTANTIATE_IMAGE_OPS

#define INSTANTIATE_IMAGE_OPS ( r,
data,
T )
Value:
template void Fits::writeImageImpl(T const *, int); \
template void Fits::writeImage(image::ImageBase<T> const &, ImageWriteOptions const &, \
daf::base::PropertySet const *, \
template void Fits::readImageImpl(int, T *, long *, long *, long *); \
template bool Fits::checkImageType<T>(); \
template int getBitPix<T>();
The base class for all image classed (Image, Mask, MaskedImage, ...)
Definition ImageBase.h:102
Represent a 2-dimensional array of bitmask pixels.
Definition Mask.h:77

Definition at line 1863 of file fits.cc.

1863#define INSTANTIATE_IMAGE_OPS(r, data, T) \
1864 template void Fits::writeImageImpl(T const *, int); \
1865 template void Fits::writeImage(image::ImageBase<T> const &, ImageWriteOptions const &, \
1866 daf::base::PropertySet const *, \
1867 image::Mask<image::MaskPixel> const *); \
1868 template void Fits::readImageImpl(int, T *, long *, long *, long *); \
1869 template bool Fits::checkImageType<T>(); \
1870 template int getBitPix<T>();

◆ INSTANTIATE_KEY_OPS

#define INSTANTIATE_KEY_OPS ( r,
data,
T )
Value:
template void Fits::updateKey(std::string const &, T const &, std::string const &); \
template void Fits::writeKey(std::string const &, T const &, std::string const &); \
template void Fits::updateKey(std::string const &, T const &); \
template void Fits::writeKey(std::string const &, T const &); \
template void Fits::updateColumnKey(std::string const &, int, T const &, std::string const &); \
template void Fits::writeColumnKey(std::string const &, int, T const &, std::string const &); \
template void Fits::updateColumnKey(std::string const &, int, T const &); \
template void Fits::writeColumnKey(std::string const &, int, T const &); \
template void Fits::readKey(std::string const &, T &);

Definition at line 1852 of file fits.cc.

1852#define INSTANTIATE_KEY_OPS(r, data, T) \
1853 template void Fits::updateKey(std::string const &, T const &, std::string const &); \
1854 template void Fits::writeKey(std::string const &, T const &, std::string const &); \
1855 template void Fits::updateKey(std::string const &, T const &); \
1856 template void Fits::writeKey(std::string const &, T const &); \
1857 template void Fits::updateColumnKey(std::string const &, int, T const &, std::string const &); \
1858 template void Fits::writeColumnKey(std::string const &, int, T const &, std::string const &); \
1859 template void Fits::updateColumnKey(std::string const &, int, T const &); \
1860 template void Fits::writeColumnKey(std::string const &, int, T const &); \
1861 template void Fits::readKey(std::string const &, T &);

◆ INSTANTIATE_TABLE_ARRAY_OPS

#define INSTANTIATE_TABLE_ARRAY_OPS ( r,
data,
T )
Value:
template void Fits::writeTableArray(std::size_t row, int col, int nElements, T const *value); \
template void Fits::readTableArray(std::size_t row, int col, int nElements, T *value);
int row
Definition CR.cc:145
int col
Definition CR.cc:144

Definition at line 1875 of file fits.cc.

1875#define INSTANTIATE_TABLE_ARRAY_OPS(r, data, T) \
1876 template void Fits::writeTableArray(std::size_t row, int col, int nElements, T const *value); \
1877 template void Fits::readTableArray(std::size_t row, int col, int nElements, T *value);

◆ INSTANTIATE_TABLE_OPS

#define INSTANTIATE_TABLE_OPS ( r,
data,
T )
Value:
template int Fits::addColumn<T>(std::string const &ttype, int size); \
template int Fits::addColumn<T>(std::string const &ttype, int size, std::string const &comment);

Definition at line 1872 of file fits.cc.

1872#define INSTANTIATE_TABLE_OPS(r, data, T) \
1873 template int Fits::addColumn<T>(std::string const &ttype, int size); \
1874 template int Fits::addColumn<T>(std::string const &ttype, int size, std::string const &comment);

◆ KEY_TYPES

#define KEY_TYPES
Value:
(bool)(unsigned char)(short)(unsigned short)(int)(unsigned int)(long)(unsigned long)(LONGLONG)( \

Definition at line 1883 of file fits.cc.

1883#define KEY_TYPES \
1884 (bool)(unsigned char)(short)(unsigned short)(int)(unsigned int)(long)(unsigned long)(LONGLONG)( \
1885 float)(double)(std::complex<float>)(std::complex<double>)(std::string)

Variable Documentation

◆ isComment

bool isComment

Definition at line 403 of file fits.cc.

◆ isValid

bool isValid

Definition at line 404 of file fits.cc.

◆ list

daf::base::PropertyList* list

Definition at line 932 of file fits.cc.

◆ set

daf::base::PropertySet* set

Definition at line 931 of file fits.cc.

◆ strip

bool strip

Definition at line 930 of file fits.cc.