Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

FitsController Class Reference

#include <FitsController.h>

Collaboration diagram for FitsController:

Collaboration graph
[legend]
List of all members.

Detailed Description

A Controller class for FITS files.

Author:
Paul F. Kunz <Paul_Kunz@slac.stanford.edu>

Definition at line 31 of file FitsController.h.

Public Member Functions

void checkForImage (PlotterBase *plotter, const DataSource &source, const std::vector< std::string > &binding)
 Check and fix plotter for FITS image data source.
DataSourcecreateNTuple (const std::string &filename, const std::string &name, int index)
 Creates a FitsNTuple from a ASCII or binary table in a FITS file.
DataSourcecreateNTuple (const std::string &filename, const std::string &name)
 Creates a FitsNTuple from a ASCII or binary table in a FITS file.
const std::vector< std::string > & getNTupleNames (const std::string &file_name)
 Returns a temporarily list of the names of the DataSource objects in the FITS file.
FitsFileopenFile (const std::string &file)
 Opens the named file, if not already opened.
const std::stringversion () const
 Returns the version of cfitsio being used.
virtual ~FitsController ()
 The destructor.

Static Public Member Functions

static FitsControllerinstance ()
 Returns the singleton instance of the FitsController.

Private Member Functions

void closeFile (const std::string &name)
 Closed the named file, if found in list of opened files.

Private Attributes

std::map< std::string, FitsFile * > m_file_map
 A map of open FITS files.
std::vector< std::stringm_ntuple_names
 A list of possible NTuple names in the FITS file.
std::string m_version
 The version of cfitsio being used.

Static Private Attributes

static FitsControllers_instance = 0
 The singleton instance of the FitsController.


Constructor & Destructor Documentation

FitsController::~FitsController  )  [virtual]
 

The destructor.

Definition at line 56 of file FitsController.cxx.


Member Function Documentation

void FitsController::checkForImage PlotterBase plotter,
const DataSource source,
const std::vector< std::string > &  binding
 

Check and fix plotter for FITS image data source.

If the data source for the Plotter is a FITS image file, then sets the parameters of the image. Otherwise does nothing.

Definition at line 207 of file FitsController.cxx.

References FitsNTuple::getFile(), FitsFileBase::Image, PlotterBase::setAspectRatio(), Range::setHigh(), Range::setLength(), Range::setLow(), PlotterBase::setOffset(), num_util::type(), hippodraw::Axes::X, and hippodraw::Axes::Y.

void FitsController::closeFile const std::string name  )  [private]
 

Closed the named file, if found in list of opened files.

Definition at line 114 of file FitsController.cxx.

DataSource * FitsController::createNTuple const std::string filename,
const std::string name,
int  index
 

Creates a FitsNTuple from a ASCII or binary table in a FITS file.

Returns a FitsNTuple object from the file filename, with HDU number index. Use name as the HDU name. name name. If the object already exists, return it, otherwise creates and returns a new one. If error occurs in the creation, throws a DataSourceException. Since HDU may not have a name, one uses the index to find it.

Definition at line 169 of file FitsController.cxx.

References DataSourceController::instance(), and openFile().

DataSource * FitsController::createNTuple const std::string filename,
const std::string name
 

Creates a FitsNTuple from a ASCII or binary table in a FITS file.

Looks from an HDU with extension name name. If none exists, throws a DataSourceException. If it does exist, then returns the created FitsNTuple.

Definition at line 140 of file FitsController.cxx.

References getNTupleNames(), and num_util::size().

const vector< string > & FitsController::getNTupleNames const std::string file_name  ) 
 

Returns a temporarily list of the names of the DataSource objects in the FITS file.

Definition at line 126 of file FitsController.cxx.

References m_ntuple_names, and openFile().

Referenced by createNTuple().

FitsController * FitsController::instance  )  [static]
 

Returns the singleton instance of the FitsController.

Definition at line 47 of file FitsController.cxx.

References s_instance.

Referenced by DisplayController::createDisplay(), HiNTupleXML::getObject(), CanvasView::helpAbout(), PyFitsController::instance(), QtFileDialog::isFitsFile(), and QtFileDialog::openFitsTuple().

FitsFile * FitsController::openFile const std::string file  ) 
 

Opens the named file, if not already opened.

Opens and returns pointer to a FITS file. If file is not found, or file is not a FITS file, then throws DataSourceException.

Definition at line 80 of file FitsController.cxx.

References m_file_map.

Referenced by createNTuple(), getNTupleNames(), and QtFileDialog::isFitsFile().

const std::string & FitsController::version  )  const
 

Returns the version of cfitsio being used.

Definition at line 62 of file FitsController.cxx.

References m_version.


Member Data Documentation

std::map< std::string, FitsFile * > FitsController::m_file_map [private]
 

A map of open FITS files.

Definition at line 38 of file FitsController.h.

Referenced by openFile().

std::vector< std::string > FitsController::m_ntuple_names [private]
 

A list of possible NTuple names in the FITS file.

Definition at line 50 of file FitsController.h.

Referenced by getNTupleNames().

std::string FitsController::m_version [mutable, private]
 

The version of cfitsio being used.

Definition at line 42 of file FitsController.h.

Referenced by version().

FitsController * FitsController::s_instance = 0 [static, private]
 

The singleton instance of the FitsController.

Definition at line 43 of file FitsController.cxx.

Referenced by instance().


The documentation for this class was generated from the following files:
Generated for HippoDraw-1.14.8.5 by doxygen 1.4.3