SourceXtractorPlusPlus  0.19
SourceXtractor++, the next generation SExtractor
 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 Class Reference

#include <FitsImageSource.h>

Inheritance diagram for SourceXtractor::FitsImageSource:
Inheritance graph
[legend]
Collaboration diagram for SourceXtractor::FitsImageSource:
Collaboration graph
[legend]

Public Member Functions

 FitsImageSource (const std::string &filename, int hdu_number=0, ImageTile::ImageType image_type=ImageTile::AutoType, std::shared_ptr< FileManager > manager=FileManager::getDefault())
 
 FitsImageSource (const std::string &filename, int width, int height, ImageTile::ImageType image_type, const std::shared_ptr< CoordinateSystem > coord_system=nullptr, bool append=false, bool empty_primary=false, std::shared_ptr< FileManager > manager=FileManager::getDefault())
 
virtual ~FitsImageSource ()=default
 
std::string getRepr () const override
 Human readable representation of this source. More...
 
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...
 
int getDepth () const
 Returns the depth of the image in pixels. More...
 
void setLayer (int layer)
 
std::shared_ptr< ImageTilegetImageTile (int x, int y, int width, int height) const override
 
void saveTile (ImageTile &tile) override
 
template<typename TT >
bool readFitsKeyword (const std::string &header_keyword, TT &out_value) const
 
int getHDU () const
 
ImageTile::ImageType getType () const override
 
std::unique_ptr< std::vector
< char > > 
getFitsHeaders (int &number_of_records) const
 
const std::map< std::string,
MetadataEntry > & 
getMetadata () const override
 
void setMetadata (const std::string &key, const MetadataEntry &value) override
 
- Public Member Functions inherited from SourceXtractor::ImageSource
 ImageSource ()
 
virtual ~ImageSource ()=default
 
- Public Member Functions inherited from std::enable_shared_from_this< ImageSource >
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
 

Private Attributes

std::string m_filename
 
std::shared_ptr< FileManagerm_file_manager
 
std::shared_ptr< FileHandlerm_handler
 
int m_hdu_number
 
int m_width
 
int m_height
 
int m_depth
 
ImageTile::ImageType m_image_type
 
int m_current_layer
 

Detailed Description

Definition at line 46 of file FitsImageSource.h.

Constructor & Destructor Documentation

SourceXtractor::FitsImageSource::FitsImageSource ( const std::string filename,
int  hdu_number = 0,
ImageTile::ImageType  image_type = ImageTile::AutoType,
std::shared_ptr< FileManager manager = FileManager::getDefault() 
)
explicit

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

References conf::filename, SourceXtractor::FitsFile::getFitsFilePtr(), m_depth, m_handler, m_hdu_number, m_height, m_image_type, m_width, std::move(), and switchHdu().

Here is the call graph for this function:

SourceXtractor::FitsImageSource::FitsImageSource ( const std::string filename,
int  width,
int  height,
ImageTile::ImageType  image_type,
const std::shared_ptr< CoordinateSystem coord_system = nullptr,
bool  append = false,
bool  empty_primary = false,
std::shared_ptr< FileManager manager = FileManager::getDefault() 
)
virtual SourceXtractor::FitsImageSource::~FitsImageSource ( )
virtualdefault

Member Function Documentation

int SourceXtractor::FitsImageSource::getDataType ( ) const
private
int SourceXtractor::FitsImageSource::getDepth ( ) const
inline

Returns the depth of the image in pixels.

Definition at line 86 of file FitsImageSource.h.

References m_depth.

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

Definition at line 261 of file FitsImageSource.cpp.

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

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

Here is the call graph for this function:

int SourceXtractor::FitsImageSource::getHDU ( ) const
inline

Definition at line 107 of file FitsImageSource.h.

References m_hdu_number.

int SourceXtractor::FitsImageSource::getHeight ( ) const
inlineoverridevirtual

Returns the height of the image in pixels.

Implements SourceXtractor::ImageSource.

Definition at line 81 of file FitsImageSource.h.

References m_height.

std::shared_ptr< ImageTile > SourceXtractor::FitsImageSource::getImageTile ( int  x,
int  y,
int  width,
int  height 
) const
overridevirtual
int SourceXtractor::FitsImageSource::getImageType ( ) const
private
const std::map< std::string, MetadataEntry > & SourceXtractor::FitsImageSource::getMetadata ( ) const
overridevirtual
Returns
A copy of the metadata set

Reimplemented from SourceXtractor::ImageSource.

Definition at line 306 of file FitsImageSource.cpp.

References SourceXtractor::FitsFile::getHDUHeaders(), m_handler, and m_hdu_number.

Referenced by getFitsHeaders(), and readFitsKeyword().

Here is the call graph for this function:

std::string SourceXtractor::FitsImageSource::getRepr ( ) const
inlineoverridevirtual

Human readable representation of this source.

Implements SourceXtractor::ImageSource.

Definition at line 71 of file FitsImageSource.h.

References m_filename.

ImageTile::ImageType SourceXtractor::FitsImageSource::getType ( ) const
inlineoverridevirtual

Implements SourceXtractor::ImageSource.

Definition at line 111 of file FitsImageSource.h.

References m_image_type.

int SourceXtractor::FitsImageSource::getWidth ( ) const
inlineoverridevirtual

Returns the width of the image in pixels.

Implements SourceXtractor::ImageSource.

Definition at line 76 of file FitsImageSource.h.

References m_width.

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

Definition at line 97 of file FitsImageSource.h.

References getMetadata().

Here is the call graph for this function:

void SourceXtractor::FitsImageSource::saveTile ( ImageTile tile)
overridevirtual
void SourceXtractor::FitsImageSource::setLayer ( int  layer)

Definition at line 254 of file FitsImageSource.cpp.

References m_current_layer, m_depth, and m_filename.

void SourceXtractor::FitsImageSource::setMetadata ( const std::string key,
const MetadataEntry value 
)
overridevirtual
void SourceXtractor::FitsImageSource::switchHdu ( fitsfile *  fptr,
int  hdu_number 
) const
private

Definition at line 239 of file FitsImageSource.cpp.

References m_filename.

Referenced by FitsImageSource(), getImageTile(), saveTile(), and setMetadata().

Member Data Documentation

int SourceXtractor::FitsImageSource::m_current_layer
private

Definition at line 139 of file FitsImageSource.h.

Referenced by getImageTile(), and setLayer().

int SourceXtractor::FitsImageSource::m_depth
private

Definition at line 136 of file FitsImageSource.h.

Referenced by FitsImageSource(), getDepth(), and setLayer().

std::shared_ptr<FileManager> SourceXtractor::FitsImageSource::m_file_manager
private

Definition at line 129 of file FitsImageSource.h.

Referenced by FitsImageSource().

std::string SourceXtractor::FitsImageSource::m_filename
private

Definition at line 128 of file FitsImageSource.h.

Referenced by FitsImageSource(), getRepr(), setLayer(), and switchHdu().

std::shared_ptr<FileHandler> SourceXtractor::FitsImageSource::m_handler
private

Definition at line 130 of file FitsImageSource.h.

Referenced by FitsImageSource(), getImageTile(), getMetadata(), saveTile(), and setMetadata().

int SourceXtractor::FitsImageSource::m_hdu_number
private
int SourceXtractor::FitsImageSource::m_height
private

Definition at line 135 of file FitsImageSource.h.

Referenced by FitsImageSource(), and getHeight().

ImageTile::ImageType SourceXtractor::FitsImageSource::m_image_type
private

Definition at line 137 of file FitsImageSource.h.

Referenced by FitsImageSource(), getDataType(), getImageTile(), getImageType(), and getType().

int SourceXtractor::FitsImageSource::m_width
private

Definition at line 134 of file FitsImageSource.h.

Referenced by FitsImageSource(), and getWidth().


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