SourceXtractorPlusPlus  0.8
Please provide a description of the project.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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)
 
int getHDU () const
 
- 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
 
void loadHeadFile ()
 
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< FitsFileManagerm_manager
 
int m_width
 
int m_height
 
int m_hdu_number
 
std::map< std::string,
std::string
m_header
 

Detailed Description

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

Definition at line 38 of file FitsImageSource.h.

Constructor & Destructor Documentation

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 62 of file FitsImageSource.cpp.

References conf::filename, SourceXtractor::loadFitsHeader(), SourceXtractor::FitsImageSource< T >::loadHeadFile(), SourceXtractor::FitsImageSource< T >::m_hdu_number, SourceXtractor::FitsImageSource< T >::m_header, 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:

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() 
)
template<typename T >
virtual SourceXtractor::FitsImageSource< T >::~FitsImageSource ( )
virtualdefault

Member Function Documentation

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

Definition at line 276 of file FitsImageSource.cpp.

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

Definition at line 279 of file FitsImageSource.cpp.

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

Definition at line 282 of file FitsImageSource.cpp.

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

Definition at line 285 of file FitsImageSource.cpp.

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

Definition at line 289 of file FitsImageSource.cpp.

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

Definition at line 292 of file FitsImageSource.cpp.

template<typename T >
int SourceXtractor::FitsImageSource< T >::getHDU ( ) const
inline
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 70 of file FitsImageSource.h.

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

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 169 of file FitsImageSource.cpp.

References x, and y.

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

Definition at line 295 of file FitsImageSource.cpp.

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

Definition at line 298 of file FitsImageSource.cpp.

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

Definition at line 301 of file FitsImageSource.cpp.

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

Definition at line 304 of file FitsImageSource.cpp.

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

Definition at line 308 of file FitsImageSource.cpp.

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

Definition at line 311 of file FitsImageSource.cpp.

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

Human readable representation of this source.

Implements SourceXtractor::ImageSourceBase.

Definition at line 58 of file FitsImageSource.h.

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

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 65 of file FitsImageSource.h.

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

template<typename T >
void SourceXtractor::FitsImageSource< T >::loadHeadFile ( )
private

Definition at line 232 of file FitsImageSource.cpp.

References conf::filename, std::getline(), std::ifstream::good(), std::ifstream::is_open(), std::ifstream::open(), and std::string::size().

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

Here is the call graph for this function:

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

Definition at line 77 of file FitsImageSource.h.

References std::map< K, T >::end(), std::map< K, T >::find(), and SourceXtractor::FitsImageSource< T >::m_header.

Here is the call graph for this function:

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

Implements SourceXtractor::ImageSource< T >.

Definition at line 193 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:

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

Member Data Documentation

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

Definition at line 99 of file FitsImageSource.h.

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

template<typename T >
int SourceXtractor::FitsImageSource< T >::m_hdu_number
private
template<typename T >
std::map<std::string, std::string> SourceXtractor::FitsImageSource< T >::m_header
private
template<typename T >
int SourceXtractor::FitsImageSource< T >::m_height
private
template<typename T >
std::shared_ptr<FitsFileManager> SourceXtractor::FitsImageSource< T >::m_manager
private
template<typename T >
int SourceXtractor::FitsImageSource< T >::m_width
private

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