SourceXtractorPlusPlus  0.11
Please provide a description of the project.
Public Member Functions | Private Member Functions | Private Attributes | List of all members
SourceXtractor::FitsImageSource< T > Class Template Reference

#include <FitsImageSource.h>

Inheritance diagram for SourceXtractor::FitsImageSource< T >:
[legend]
Collaboration diagram for SourceXtractor::FitsImageSource< T >:
[legend]

Public Member Functions

 FitsImageSource (const std::string &filename, int hdu_number=0, std::shared_ptr< FitsFileManager > manager=FitsFileManager::getInstance())
 
 FitsImageSource (const std::string &filename, int width, int height, const std::shared_ptr< CoordinateSystem > coord_system=nullptr, std::shared_ptr< FitsFileManager > manager=FitsFileManager::getInstance())
 
virtual ~FitsImageSource ()=default
 
std::string getRepr () const override
 Human readable representation of this source. More...
 
std::shared_ptr< ImageTile< T > > getImageTile (int x, int y, int width, int height) const override
 
int getWidth () const override
 Returns the width of the image in pixels. More...
 
int getHeight () const override
 Returns the height of the image in pixels. More...
 
void saveTile (ImageTile< T > &tile) override
 
template<typename TT >
bool readFitsKeyword (const std::string &header_keyword, TT &out_value) const
 
int getHDU () const
 
std::unique_ptr< std::vector< char > > getFitsHeaders (int &number_of_records) const
 
const std::map< std::string, MetadataEntry > & getMetadata () const override
 
- Public Member Functions inherited from SourceXtractor::ImageSource< T >
 ImageSource ()
 
virtual ~ImageSource ()=default
 
- Public Member Functions inherited from SourceXtractor::ImageSourceBase
virtual ~ImageSourceBase ()=default
 
- Public Member Functions inherited from std::enable_shared_from_this< ImageSource< T > >
enable_shared_from_this (T... args)
 
operator= (T... args)
 
shared_from_this (T... args)
 
~enable_shared_from_this (T... args)
 

Private Member Functions

void switchHdu (fitsfile *fptr, int hdu_number) const
 
int getDataType () const
 
int getImageType () const
 
template<>
int getDataType () const
 
template<>
int getDataType () const
 
template<>
int getDataType () const
 
template<>
int getDataType () const
 
template<>
int getDataType () const
 
template<>
int getDataType () const
 
template<>
int getImageType () const
 
template<>
int getImageType () const
 
template<>
int getImageType () const
 
template<>
int getImageType () const
 
template<>
int getImageType () const
 
template<>
int getImageType () const
 

Private Attributes

std::string m_filename
 
std::shared_ptr< FitsFilem_fits_file
 
std::shared_ptr< FitsFileManagerm_manager
 
int m_width
 
int m_height
 
int m_hdu_number
 

Detailed Description

template<typename T>
class SourceXtractor::FitsImageSource< T >

Definition at line 43 of file FitsImageSource.h.

Constructor & Destructor Documentation

◆ FitsImageSource() [1/2]

template<typename T >
SourceXtractor::FitsImageSource< T >::FitsImageSource ( const std::string filename,
int  hdu_number = 0,
std::shared_ptr< FitsFileManager manager = FitsFileManager::getInstance() 
)

Constructor

Parameters
filenamePath to the FITS file
hdu_numberHDU number. If <= 0, the constructor will use the first HDU containing an image
manager

Definition at line 45 of file FitsImageSource.cpp.

References conf::filename, SourceXtractor::FitsImageSource< T >::m_fits_file, SourceXtractor::FitsImageSource< T >::m_hdu_number, SourceXtractor::FitsImageSource< T >::m_height, SourceXtractor::FitsImageSource< T >::m_manager, SourceXtractor::FitsImageSource< T >::m_width, and SourceXtractor::FitsImageSource< T >::switchHdu().

Here is the call graph for this function:

◆ FitsImageSource() [2/2]

template<typename T >
SourceXtractor::FitsImageSource< T >::FitsImageSource ( const std::string filename,
int  width,
int  height,
const std::shared_ptr< CoordinateSystem coord_system = nullptr,
std::shared_ptr< FitsFileManager manager = FitsFileManager::getInstance() 
)

◆ ~FitsImageSource()

template<typename T>
virtual SourceXtractor::FitsImageSource< T >::~FitsImageSource ( )
virtualdefault

Member Function Documentation

◆ getDataType() [1/7]

template<typename T>
int SourceXtractor::FitsImageSource< T >::getDataType ( ) const
private

◆ getDataType() [2/7]

template<>
int SourceXtractor::FitsImageSource< double >::getDataType ( ) const
private

Definition at line 242 of file FitsImageSource.cpp.

◆ getDataType() [3/7]

template<>
int SourceXtractor::FitsImageSource< float >::getDataType ( ) const
private

Definition at line 245 of file FitsImageSource.cpp.

◆ getDataType() [4/7]

template<>
int SourceXtractor::FitsImageSource< unsigned int >::getDataType ( ) const
private

Definition at line 248 of file FitsImageSource.cpp.

◆ getDataType() [5/7]

template<>
int SourceXtractor::FitsImageSource< int >::getDataType ( ) const
private

Definition at line 251 of file FitsImageSource.cpp.

◆ getDataType() [6/7]

template<>
int SourceXtractor::FitsImageSource< long >::getDataType ( ) const
private

Definition at line 255 of file FitsImageSource.cpp.

◆ getDataType() [7/7]

template<>
int SourceXtractor::FitsImageSource< long long >::getDataType ( ) const
private

Definition at line 258 of file FitsImageSource.cpp.

◆ getFitsHeaders()

template<typename T >
std::unique_ptr< std::vector< char > > SourceXtractor::FitsImageSource< T >::getFitsHeaders ( int &  number_of_records) const

Definition at line 197 of file FitsImageSource.cpp.

References std::string::begin(), std::string::end(), and std::string::size().

Referenced by SourceXtractor::WCS::WCS().

Here is the call graph for this function:

◆ getHDU()

template<typename T>
int SourceXtractor::FitsImageSource< T >::getHDU ( ) const
inline

◆ getHeight()

template<typename T>
int SourceXtractor::FitsImageSource< T >::getHeight ( ) const
inlineoverridevirtual

Returns the height of the image in pixels.

Implements SourceXtractor::ImageSource< T >.

Definition at line 75 of file FitsImageSource.h.

References SourceXtractor::FitsImageSource< T >::m_height.

◆ getImageTile()

template<typename T >
std::shared_ptr< ImageTile< T > > SourceXtractor::FitsImageSource< T >::getImageTile ( int  x,
int  y,
int  width,
int  height 
) const
overridevirtual

Implements SourceXtractor::ImageSource< T >.

Definition at line 133 of file FitsImageSource.cpp.

References x, and y.

◆ getImageType() [1/7]

template<typename T>
int SourceXtractor::FitsImageSource< T >::getImageType ( ) const
private

◆ getImageType() [2/7]

template<>
int SourceXtractor::FitsImageSource< double >::getImageType ( ) const
private

Definition at line 261 of file FitsImageSource.cpp.

◆ getImageType() [3/7]

template<>
int SourceXtractor::FitsImageSource< float >::getImageType ( ) const
private

Definition at line 264 of file FitsImageSource.cpp.

◆ getImageType() [4/7]

template<>
int SourceXtractor::FitsImageSource< unsigned int >::getImageType ( ) const
private

Definition at line 267 of file FitsImageSource.cpp.

◆ getImageType() [5/7]

template<>
int SourceXtractor::FitsImageSource< int >::getImageType ( ) const
private

Definition at line 270 of file FitsImageSource.cpp.

◆ getImageType() [6/7]

template<>
int SourceXtractor::FitsImageSource< long >::getImageType ( ) const
private

Definition at line 274 of file FitsImageSource.cpp.

◆ getImageType() [7/7]

template<>
int SourceXtractor::FitsImageSource< long long >::getImageType ( ) const
private

Definition at line 277 of file FitsImageSource.cpp.

◆ getMetadata()

template<typename T>
const std::map<std::string, MetadataEntry>& SourceXtractor::FitsImageSource< T >::getMetadata ( ) const
inlineoverridevirtual

◆ getRepr()

template<typename T>
std::string SourceXtractor::FitsImageSource< T >::getRepr ( ) const
inlineoverridevirtual

Human readable representation of this source.

Implements SourceXtractor::ImageSourceBase.

Definition at line 63 of file FitsImageSource.h.

References SourceXtractor::FitsImageSource< T >::m_filename.

◆ getWidth()

template<typename T>
int SourceXtractor::FitsImageSource< T >::getWidth ( ) const
inlineoverridevirtual

Returns the width of the image in pixels.

Implements SourceXtractor::ImageSource< T >.

Definition at line 70 of file FitsImageSource.h.

References SourceXtractor::FitsImageSource< T >::m_width.

◆ readFitsKeyword()

template<typename T>
template<typename TT >
bool SourceXtractor::FitsImageSource< T >::readFitsKeyword ( const std::string header_keyword,
TT &  out_value 
) const
inline

Definition at line 82 of file FitsImageSource.h.

References SourceXtractor::FitsImageSource< T >::getMetadata().

Here is the call graph for this function:

◆ saveTile()

template<typename T >
void SourceXtractor::FitsImageSource< T >::saveTile ( ImageTile< T > &  tile)
overridevirtual

Implements SourceXtractor::ImageSource< T >.

Definition at line 157 of file FitsImageSource.cpp.

References SourceXtractor::ImageTile< T >::getImage(), SourceXtractor::ImageTile< T >::getPosX(), SourceXtractor::ImageTile< T >::getPosY(), x, and y.

Here is the call graph for this function:

◆ switchHdu()

template<typename T >
void SourceXtractor::FitsImageSource< T >::switchHdu ( fitsfile *  fptr,
int  hdu_number 
) const
private

Member Data Documentation

◆ m_filename

template<typename T>
std::string SourceXtractor::FitsImageSource< T >::m_filename
private

Definition at line 110 of file FitsImageSource.h.

Referenced by SourceXtractor::FitsImageSource< T >::getRepr().

◆ m_fits_file

template<typename T>
std::shared_ptr<FitsFile> SourceXtractor::FitsImageSource< T >::m_fits_file
private

◆ m_hdu_number

template<typename T>
int SourceXtractor::FitsImageSource< T >::m_hdu_number
private

◆ m_height

template<typename T>
int SourceXtractor::FitsImageSource< T >::m_height
private

◆ m_manager

template<typename T>
std::shared_ptr<FitsFileManager> SourceXtractor::FitsImageSource< T >::m_manager
private

◆ m_width

template<typename T>
int SourceXtractor::FitsImageSource< T >::m_width
private

The documentation for this class was generated from the following files: