LSST Applications g180d380827+0f66a164bb,g2079a07aa2+86d27d4dc4,g2305ad1205+7d304bc7a0,g29320951ab+500695df56,g2bbee38e9b+0e5473021a,g337abbeb29+0e5473021a,g33d1c0ed96+0e5473021a,g3a166c0a6a+0e5473021a,g3ddfee87b4+e42ea45bea,g48712c4677+36a86eeaa5,g487adcacf7+2dd8f347ac,g50ff169b8f+96c6868917,g52b1c1532d+585e252eca,g591dd9f2cf+c70619cc9d,g5a732f18d5+53520f316c,g5ea96fc03c+341ea1ce94,g64a986408d+f7cd9c7162,g858d7b2824+f7cd9c7162,g8a8a8dda67+585e252eca,g99cad8db69+469ab8c039,g9ddcbc5298+9a081db1e4,ga1e77700b3+15fc3df1f7,gb0e22166c9+60f28cb32d,gba4ed39666+c2a2e4ac27,gbb8dafda3b+c92fc63c7e,gbd866b1f37+f7cd9c7162,gc120e1dc64+02c66aa596,gc28159a63d+0e5473021a,gc3e9b769f7+b0068a2d9f,gcf0d15dbbd+e42ea45bea,gdaeeff99f8+f9a426f77a,ge6526c86ff+84383d05b3,ge79ae78c31+0e5473021a,gee10cc3b42+585e252eca,gff1a9f87cc+f7cd9c7162,w.2024.17
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.