LSST Applications g0f08755f38+82efc23009,g12f32b3c4e+e7bdf1200e,g1653933729+a8ce1bb630,g1a0ca8cf93+50eff2b06f,g28da252d5a+52db39f6a5,g2bbee38e9b+37c5a29d61,g2bc492864f+37c5a29d61,g2cdde0e794+c05ff076ad,g3156d2b45e+41e33cbcdc,g347aa1857d+37c5a29d61,g35bb328faa+a8ce1bb630,g3a166c0a6a+37c5a29d61,g3e281a1b8c+fb992f5633,g414038480c+7f03dfc1b0,g41af890bb2+11b950c980,g5fbc88fb19+17cd334064,g6b1c1869cb+12dd639c9a,g781aacb6e4+a8ce1bb630,g80478fca09+72e9651da0,g82479be7b0+04c31367b4,g858d7b2824+82efc23009,g9125e01d80+a8ce1bb630,g9726552aa6+8047e3811d,ga5288a1d22+e532dc0a0b,gae0086650b+a8ce1bb630,gb58c049af0+d64f4d3760,gc28159a63d+37c5a29d61,gcf0d15dbbd+2acd6d4d48,gd7358e8bfb+778a810b6e,gda3e153d99+82efc23009,gda6a2b7d83+2acd6d4d48,gdaeeff99f8+1711a396fd,ge2409df99d+6b12de1076,ge79ae78c31+37c5a29d61,gf0baf85859+d0a5978c5a,gf3967379c6+4954f8c433,gfb92a5be7c+82efc23009,gfec2e1e490+2aaed99252,w.2024.46
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 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:81

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.