Loading [MathJax]/extensions/tex2jax.js
LSST Applications 28.0.0,g04a91732dc+39818242a5,g07dc498a13+fb7087bc2f,g1409bbee79+fb7087bc2f,g1a7e361dbc+fb7087bc2f,g1fd858c14a+9df69a7481,g33399d78f5+cf93122263,g35bb328faa+e55fef2c71,g3bd4b5ce2c+e9a0db2a0e,g3dabb73f91+b2cce74dd5,g424a4f6e28+ee57be4232,g53246c7159+e55fef2c71,g5477a8d5ce+64cdf2f092,g60b5630c4e+ee57be4232,g78460c75b0+8427c4cc8f,g786e29fd12+307f82e6af,g8534526c7b+8e1c6b434f,g89139ef638+fb7087bc2f,g8b49a6ea8e+ee57be4232,g8e3b232dfe+801804d184,g9125e01d80+e55fef2c71,g989de1cb63+fb7087bc2f,g9f33ca652e+f0b312e6e5,gaaedd4e678+fb7087bc2f,gabe3b4be73+9c0c3c7524,gb1101e3267+d435cc4fc1,gb58c049af0+28045f66fd,gca43fec769+e55fef2c71,gce7788e931+f50f89eb98,gcf25f946ba+cf93122263,gd6cbbdb0b4+f6e5445f66,gdd9490a0bf+839504dd15,gde0f65d7ad+9dfeb3589e,ge278dab8ac+b4c2c8faf7,geab183fbe5+ee57be4232,gec3dcf77f0+e7bc33f3ea,gecb8035dfe+1f480bec5e,gf58bf46354+e55fef2c71,gfe7187db8c+5801f20593
LSST Data Management Base Package
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 1898 of file fits.cc.

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

◆ COLUMN_TYPES

#define COLUMN_TYPES
Value:

Definition at line 1894 of file fits.cc.

1894#define COLUMN_TYPES \
1895 (bool)(std::string)(std::int8_t)(std::uint8_t)(std::int16_t)(std::uint16_t)(std::int32_t)(std::uint32_t) \
1896 (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 1902 of file fits.cc.

1902#define IMAGE_TYPES \
1903 (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:82

Definition at line 1870 of file fits.cc.

1870#define INSTANTIATE_IMAGE_OPS(r, data, T) \
1871 template void Fits::writeImageImpl(T const *, int); \
1872 template void Fits::writeImage(image::ImageBase<T> const &, ImageWriteOptions const &, \
1873 daf::base::PropertySet const *, \
1874 image::Mask<image::MaskPixel> const *); \
1875 template void Fits::readImageImpl(int, T *, long *, long *, long *); \
1876 template bool Fits::checkImageType<T>(); \
1877 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 1859 of file fits.cc.

1859#define INSTANTIATE_KEY_OPS(r, data, T) \
1860 template void Fits::updateKey(std::string const &, T const &, std::string const &); \
1861 template void Fits::writeKey(std::string const &, T const &, std::string const &); \
1862 template void Fits::updateKey(std::string const &, T const &); \
1863 template void Fits::writeKey(std::string const &, T const &); \
1864 template void Fits::updateColumnKey(std::string const &, int, T const &, std::string const &); \
1865 template void Fits::writeColumnKey(std::string const &, int, T const &, std::string const &); \
1866 template void Fits::updateColumnKey(std::string const &, int, T const &); \
1867 template void Fits::writeColumnKey(std::string const &, int, T const &); \
1868 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 1882 of file fits.cc.

1882#define INSTANTIATE_TABLE_ARRAY_OPS(r, data, T) \
1883 template void Fits::writeTableArray(std::size_t row, int col, int nElements, T const *value); \
1884 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 1879 of file fits.cc.

1879#define INSTANTIATE_TABLE_OPS(r, data, T) \
1880 template int Fits::addColumn<T>(std::string const &ttype, int size); \
1881 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 1890 of file fits.cc.

1890#define KEY_TYPES \
1891 (bool)(unsigned char)(short)(unsigned short)(int)(unsigned int)(long)(unsigned long)(LONGLONG)( \
1892 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.