LSST Applications g063fba187b+cac8b7c890,g0f08755f38+6aee506743,g1653933729+a8ce1bb630,g168dd56ebc+a8ce1bb630,g1a2382251a+b4475c5878,g1dcb35cd9c+8f9bc1652e,g20f6ffc8e0+6aee506743,g217e2c1bcf+73dee94bd0,g28da252d5a+1f19c529b9,g2bbee38e9b+3f2625acfc,g2bc492864f+3f2625acfc,g3156d2b45e+6e55a43351,g32e5bea42b+1bb94961c2,g347aa1857d+3f2625acfc,g35bb328faa+a8ce1bb630,g3a166c0a6a+3f2625acfc,g3e281a1b8c+c5dd892a6c,g3e8969e208+a8ce1bb630,g414038480c+5927e1bc1e,g41af890bb2+8a9e676b2a,g7af13505b9+809c143d88,g80478fca09+6ef8b1810f,g82479be7b0+f568feb641,g858d7b2824+6aee506743,g89c8672015+f4add4ffd5,g9125e01d80+a8ce1bb630,ga5288a1d22+2903d499ea,gb58c049af0+d64f4d3760,gc28159a63d+3f2625acfc,gcab2d0539d+b12535109e,gcf0d15dbbd+46a3f46ba9,gda6a2b7d83+46a3f46ba9,gdaeeff99f8+1711a396fd,ge79ae78c31+3f2625acfc,gef2f8181fd+0a71e47438,gf0baf85859+c1f95f4921,gfa517265be+6aee506743,gfa999e8aa5+17cd334064,w.2024.51
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: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.