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

FitsNTuple Class Reference

#include <FitsNTuple.h>

Inheritance diagram for FitsNTuple:

Inheritance graph
[legend]
Collaboration diagram for FitsNTuple:

Collaboration graph
[legend]
List of all members.

Detailed Description

A DataSource class implemented with a vector<double> copied from FITS table.

Note:
This class is not yet completely implemented.
Author:
Paul F. Kunz <Paul_Kunz@slac.stanford.edu>

Definition at line 28 of file FitsNTuple.h.

Public Types

typedef void(hippodraw::Observer::* Action )(const Observable *)
 The member function of the Observer that is called.
typedef std::list< hippodraw::Observer * > ObserverList_t
 The type of STL container to maintain list of Observer objects.

Public Member Functions

int addColumn (const std::string &label, const std::vector< double > &column)
 Adds a column to the end of the FitsNTuple.
void addObserver (hippodraw::Observer *)
 Adds an Observer to the Observer list.
virtual void addRow (const std::vector< double > &row)
 Raises an assertion as the contained FITS file should not be changed.
virtual void clear ()
 Clears the data cache; doesn't not modify the contained fits file.
unsigned int columns () const
 Returns the number of columns or data arrays available from this DataSource.
virtual void copy (const DataSource &)
 Raises exception because with this release, copying the fits table is not supported.
virtual bool empty () const
 Returns true, if FitsNTuple is empty, i.e.
virtual bool fillRange (unsigned int column, Range &) const
 Fills the Range object from data indexed by column.
 FitsNTuple (FitsFile *file)
 A constructor with a FitsFile as argument.
virtual const std::vector<
double > & 
getColumn (unsigned int column) const
 Returns the data in the column with index column.
virtual const std::vector<
double > & 
getColumn (const std::string &name) const
 Returns the data in the column with label name.
const FitsFilegetFile () const
 Returns the FITS file used to create this object.
virtual const std::stringgetLabelAt (unsigned int index) const
 Returns the label for the column at index index.
virtual const std::vector<
std::string > & 
getLabels () const
 Returns the list of available labels.
const std::stringgetName () const
 Returns the name of the ntuple.
const ObserverList_tgetObservers () const
 Returns the list of observers.
unsigned int getRank () const
 Returns the rank of the data source.
virtual const std::vector<
double > & 
getRow (unsigned int) const =0
 Returns a const reference to slice along the axis known as a row.
virtual const std::vector<
double > & 
getRow (unsigned int index) const
 Returns a const reference to slice along the axis known as a row.
const std::vector< unsigned
int > & 
getShape () const
 Returns the shape of the data elements.
virtual int indexOf (const std::string &label) const
 Returns the index of the column whose label is label.
virtual unsigned int indexOfMaxElement (unsigned int index) const
 Returns row index of the maximum element in a column for the given column.
virtual unsigned int indexOfMinElement (unsigned int index) const
 Returns row index of the minimum element in a column for the given column.
virtual bool isMultiDimensional (const std::string &column) const
 Answers if rows of column are composed of the multidimensional data.
bool isNull () const
 Returns true if the receiving objects is a null object.
bool isValidLabel (const std::string &label) const
 Returns true if label is a valid label for a column in the DataSource.
virtual void notifyObservers () const
 Notifies observers.
virtual double operator[] (std::vector< unsigned int > &indices) const
 Raises assertion as this method is not yet implemented.
void removeObserver (hippodraw::Observer *)
 Removes an Observer from the Observer list.
void replaceColumn (const std::string &label, const std::vector< double > &data)
 Replaces the data in column labeled label.
void replaceColumn (unsigned int index, const std::vector< double > &data)
 Replaces the data in column index.
virtual void reserve (unsigned int count)
 Raises assertion as the contained FITS file should not be changed.
virtual unsigned int rows () const
 Returns the size of the slice for the next to last dimension.
virtual bool setLabelAt (const std::string &s, unsigned int index)
 Changes the label of a data column to s.
virtual void setLabels (const std::vector< std::string > &v)
 Assigns the label to each column from the vector of strings @ v.
void setName (const std::string &name)
 Sets the name of the ntuple.
virtual bool setReleventIndex (const std::string &column, const std::vector< unsigned int > &index)
 In case we are dealing with multidimensional data in rows of this column we would like to deal with on one entry of this multidimensional data.
virtual void setShape (std::vector< unsigned int > &shape)
 Sets the shape of the data elements.
void setTitle (const std::string &title)
 Sets the title of the ntuple to title.
virtual double sum (unsigned int column) const
 Returns the sum of all the elements in the sequence of column column.
virtual void throwIfInvalidLabel (const std::string &label) const
 Throws a DataSourceException object if label is not a valid label for this DataSource.
void throwIfInvalidRowSize (const std::vector< double > &row)
 Throws a DataSourceException if the size of the row is not equal to the number of columns, otherwise does nothing.
const std::stringtitle () const
 Returns a const reference to the title of the ntuple.
virtual double valueAt (unsigned int row, unsigned int column) const
 Returns the value in the table in position given by the row and column indexes.
virtual ~FitsNTuple ()
 The destructor.

Protected Member Functions

virtual void addLabel (const std::string &label)
 Adds a new label for a column.
virtual void copyPrivate (const DataSource &other)
 Copies the contents of the other DataSource.
bool isValidColumn (unsigned int index) const
 Returns true if index is valid, otherwise throws a DataSourceException.
void notifyObservers (Action action) const
 An internal method to iterate over all observers and to send the message action.

Protected Attributes

std::vector< double > m_array
 A temporary array that can be returned by const reference.
std::vector< unsigned int > m_shape
 The shape of the data.

Private Member Functions

int fillDataCache (unsigned int column)
 Fills the data cache for column column.
 FitsNTuple ()
 The default constructor.
void initColumns ()
 Initializes the columns of the NTuple.

Private Attributes

std::vector< std::vector<
double > * > 
m_data
 The numarray objects that contains the data.
FitsFilem_file
 The FitsFile used for this ntuple.
int m_hdu_num
 The HDU number used for this ntuple.


Member Typedef Documentation

typedef void( hippodraw::Observer::* Observable::Action)(const Observable *) [inherited]
 

The member function of the Observer that is called.

Definition at line 83 of file Observable.h.

typedef std::list< hippodraw::Observer * > Observable::ObserverList_t [inherited]
 

The type of STL container to maintain list of Observer objects.

Definition at line 46 of file Observable.h.


Constructor & Destructor Documentation

FitsNTuple::FitsNTuple  )  [private]
 

The default constructor.

Note:
The default constructor is private, because implementation depends on reading a fits file before adding columns.

Definition at line 33 of file FitsNTuple.cxx.

FitsNTuple::FitsNTuple FitsFile file  ) 
 

A constructor with a FitsFile as argument.

Definition at line 24 of file FitsNTuple.cxx.

References initColumns(), m_file, and m_hdu_num.

FitsNTuple::~FitsNTuple  )  [virtual]
 

The destructor.

Definition at line 39 of file FitsNTuple.cxx.


Member Function Documentation

int FitsNTuple::addColumn const std::string label,
const std::vector< double > &  column
 

Adds a column to the end of the FitsNTuple.

If the size of the input array is the same as the size of the existing columns adds input array to then end of the FitsNTuple . Gives the column the label label. Returns the index of the newly created column. If the size of the input array differs from the size of existing columns or if the label already exists, then throws a DataSourceException object.

Definition at line 186 of file FitsNTuple.cxx.

References DataSource::addLabel(), DataSource::indexOf(), m_data, and rows().

Referenced by hippodraw::Python::export_FitsNTuple(), and initColumns().

void DataSource::addLabel const std::string label  )  [protected, virtual, inherited]
 

Adds a new label for a column.

Definition at line 150 of file DataSource.cxx.

References DataSource::m_labels.

Referenced by NumArrayTuple::addColumn(), NTuple::addColumn(), ListTuple::addColumn(), RootNTuple::addColumn(), and addColumn().

void Observable::addObserver hippodraw::Observer  )  [inherited]
 

Adds an Observer to the Observer list.

Definition at line 49 of file Observable.cxx.

References Observable::m_list.

Referenced by CutPlotter::addCutTarget(), XyPlotter::addDataRep(), FunctionRep::FunctionRep(), BinningProjector::normalizeTo(), DataRepController::setAxisBindings(), DisplayController::setNTuple(), CutPlotter::setNTuple(), and TextPlotter::setParentDataRep().

void FitsNTuple::addRow const std::vector< double > &  row  )  [virtual]
 

Raises an assertion as the contained FITS file should not be changed.

Implements DataSource.

Definition at line 128 of file FitsNTuple.cxx.

void FitsNTuple::clear  )  [virtual]
 

Clears the data cache; doesn't not modify the contained fits file.

Implements DataSource.

Definition at line 101 of file FitsNTuple.cxx.

References m_data.

unsigned int DataSource::columns  )  const [inline, inherited]
 

Returns the number of columns or data arrays available from this DataSource.

Note:
This function was selected to be in line sine it contributes heavily in time for addRow member function.

Definition at line 332 of file DataSource.h.

References DataSource::m_labels.

Referenced by PyDataSource::addColumn(), ProfileProjector::changedNTuple(), Profile2DProjector::changedNTuple(), MapMatrixProjector::changedNTuple(), Map3Projector::changedNTuple(), Map2Projector::changedNTuple(), Map1Projector::changedNTuple(), DyHist2DProjector::changedNTuple(), DyHist1DProjector::changedNTuple(), QtRootNTuple::columns(), PyDataSource::columns(), NTupleSorter::columns(), NTuple::copy(), NTupleXML::createChildren(), NTupleProjector::dataRange(), NTupleProjector::dataRangeWithError(), hippodraw::Python::export_CircularBuffer(), hippodraw::Python::export_DataSource(), DataSource::fillRange(), NTuple::getColumn(), NTupleProjector::getNTupleAfterCuts(), NumArrayTuple::getNumArray(), NTupleProjector::getPos(), NTupleProjector::getPosWithError(), NTuple::getRow(), DataSource::indexOfMaxElement(), DataSource::indexOfMinElement(), DataSource::isValidColumn(), RTuple::operator[](), NumArrayTuple::replaceColumn(), NTuple::replaceColumn(), ListTuple::replaceColumn(), RootNTuple::replaceColumn(), replaceColumn(), NTuple::setLabels(), DataSource::sum(), and DataSource::throwIfInvalidRowSize().

void FitsNTuple::copy const DataSource  )  [virtual]
 

Raises exception because with this release, copying the fits table is not supported.

Definition at line 45 of file FitsNTuple.cxx.

void DataSource::copyPrivate const DataSource other  )  [protected, virtual, inherited]
 

Copies the contents of the other DataSource.

For use by derived classes only.

Definition at line 110 of file DataSource.cxx.

References DataSource::m_ds_name, DataSource::m_is_null, DataSource::m_labels, DataSource::m_shape, and DataSource::m_title.

Referenced by RTuple::copy(), and NTuple::copy().

bool FitsNTuple::empty  )  const [virtual]
 

Returns true, if FitsNTuple is empty, i.e.

has no data.

Implements DataSource.

Definition at line 121 of file FitsNTuple.cxx.

References rows().

int FitsNTuple::fillDataCache unsigned int  column  )  [private]
 

Fills the data cache for column column.

Returns the cfitsio status variable.

Definition at line 88 of file FitsNTuple.cxx.

References m_data, m_file, rows(), and num_util::size().

Referenced by fillRange(), and valueAt().

bool FitsNTuple::fillRange unsigned int  column,
Range
const [virtual]
 

Fills the Range object from data indexed by column.

Returns true if all the data in the column was valid, otherwise returns false. Invalid data is +/- HUGE_VAL or NAN. Invalid data is not used in setting the range.

Reimplemented from DataSource.

Definition at line 169 of file FitsNTuple.cxx.

References fillDataCache(), m_data, and Range::setRange().

const vector< double > & DataSource::getColumn unsigned int  column  )  const [virtual, inherited]
 

Returns the data in the column with index column.

Reimplemented in NTuple, RootNTuple, QtRootNTuple, and RootNTuple.

Definition at line 221 of file DataSource.cxx.

References DataSource::isValidColumn(), DataSource::m_array, DataSource::rows(), num_util::size(), and DataSource::valueAt().

const vector< double > & DataSource::getColumn const std::string name  )  const [virtual, inherited]
 

Returns the data in the column with label name.

Reimplemented in NTuple, RootNTuple, QtRootNTuple, and RootNTuple.

Definition at line 236 of file DataSource.cxx.

References DataSource::indexOf().

Referenced by PyDataSource::columnAsNumArray(), NTupleXML::createChildren2D(), hippodraw::Python::export_DataSource(), and PyDataSource::getColumn().

const FitsFile * FitsNTuple::getFile  )  const
 

Returns the FITS file used to create this object.

Definition at line 52 of file FitsNTuple.cxx.

References m_file.

Referenced by FitsController::checkForImage().

const string & DataSource::getLabelAt unsigned int  index  )  const [virtual, inherited]
 

Returns the label for the column at index index.

Returns the label for the column at index index, or throws a DataSourceException if index is out of range.

Definition at line 175 of file DataSource.cxx.

References DataSource::isNull(), DataSource::m_labels, and DataSource::title().

Referenced by NTupleXML::createChildren2D(), hippodraw::Python::export_ListTuple(), hippodraw::Python::export_NTuple(), hippodraw::Python::export_NumArrayTuple(), NTupleProjector::getAxisBindings(), NTupleProjector::getXLabel(), NTupleProjector::getYLabel(), Map1Projector::getYLabel(), Profile2DProjector::getZLabel(), MapMatrixProjector::getZLabel(), and Map3Projector::getZLabel().

const vector< string > & DataSource::getLabels  )  const [virtual, inherited]
 

Returns the list of available labels.

Reimplemented in QtRootNTuple.

Definition at line 168 of file DataSource.cxx.

References DataSource::m_labels.

Referenced by Inspector::availPlotTypesActivated(), hippodraw::Python::export_DataSource(), DisplayController::getDataSourceLabels(), QtRootNTuple::getLabels(), PyDataSource::getLabels(), NTupleProjector::getNTupleAfterCuts(), PyDataSource::replaceColumn(), RootNTuple::smartExpandRootNTuple(), Inspector::updateCutVarGroupBox(), and NTupleController::writeNTupleToFile().

const string & DataSource::getName  )  const [inherited]
 

Returns the name of the ntuple.

See also:
m_ds_name.

Definition at line 132 of file DataSource.cxx.

References DataSource::m_ds_name.

Referenced by HiNTupleXML::createElement(), NTupleProjector::getNTupleName(), DataSourceController::registerNTuple(), NTupleController::saveNTuples(), and NTupleXML::setAttributes().

const Observable::ObserverList_t & Observable::getObservers  )  const [inherited]
 

Returns the list of observers.

Definition at line 57 of file Observable.cxx.

References Observable::m_list.

unsigned int FitsNTuple::getRank  )  const
 

Returns the rank of the data source.

Returns the number of axes of the data source, i.e the rank.

Reimplemented from DataSource.

Definition at line 278 of file FitsNTuple.cxx.

References DataSource::m_shape.

virtual const std::vector< double >& DataSource::getRow unsigned  int  )  const [pure virtual, inherited]
 

Returns a const reference to slice along the axis known as a row.

Referenced by RTuple::copy(), NTuple::copy(), and NTupleController::writeNTupleToFile().

const std::vector< double > & FitsNTuple::getRow unsigned int  index  )  const [virtual]
 

Returns a const reference to slice along the axis known as a row.

Definition at line 156 of file FitsNTuple.cxx.

References DataSource::m_array, m_data, num_util::size(), and valueAt().

const vector< unsigned int > & FitsNTuple::getShape  )  const
 

Returns the shape of the data elements.

Reimplemented from DataSource.

Definition at line 271 of file FitsNTuple.cxx.

References DataSource::m_shape.

int DataSource::indexOf const std::string label  )  const [virtual, inherited]
 

Returns the index of the column whose label is label.

Returns the index of the data column whose label is label, or -1 if label does not exist.

Definition at line 189 of file DataSource.cxx.

References std::find(), and DataSource::m_labels.

Referenced by NumArrayTuple::addColumn(), NTuple::addColumn(), ListTuple::addColumn(), RootNTuple::addColumn(), addColumn(), NTuple::getColumn(), RootNTuple::getColumn(), DataSource::getColumn(), NumArrayTuple::getNumArray(), RootNTuple::getTBranch(), NTupleProjector::indexOf(), RootNTuple::isMultiDimensional(), NumArrayTuple::replaceColumn(), NTuple::replaceColumn(), ListTuple::replaceColumn(), RootNTuple::replaceColumn(), replaceColumn(), RootNTuple::rowDataDimSize(), NTupleProjector::setAxisBinding(), RootNTuple::setReleventIndex(), RootNTuple::smartExpandRootNTuple(), and QtRootNTuple::valueAt().

unsigned int DataSource::indexOfMaxElement unsigned int  index  )  const [virtual, inherited]
 

Returns row index of the maximum element in a column for the given column.

Reimplemented in NTuple.

Definition at line 377 of file DataSource.cxx.

References DataSource::columns(), DataSource::rows(), num_util::size(), and DataSource::valueAt().

unsigned int DataSource::indexOfMinElement unsigned int  index  )  const [virtual, inherited]
 

Returns row index of the minimum element in a column for the given column.

Reimplemented in NTuple.

Definition at line 398 of file DataSource.cxx.

References DataSource::columns(), DataSource::rows(), num_util::size(), and DataSource::valueAt().

void FitsNTuple::initColumns  )  [private]
 

Initializes the columns of the NTuple.

Definition at line 59 of file FitsNTuple.cxx.

References addColumn(), m_file, and num_util::size().

Referenced by FitsNTuple().

bool DataSource::isMultiDimensional const std::string column  )  const [virtual, inherited]
 

Answers if rows of column are composed of the multidimensional data.

Reimplemented in RootNTuple, QtRootNTuple, and RootNTuple.

Definition at line 359 of file DataSource.cxx.

bool DataSource::isNull  )  const [inherited]
 

Returns true if the receiving objects is a null object.

See also:
DataSource( bool ).

Definition at line 121 of file DataSource.cxx.

References DataSource::m_is_null.

Referenced by ProfileProjector::execute(), Profile2DProjector::execute(), DataSource::getLabelAt(), NTupleProjector::NTupleProjector(), NTupleProjector::setNTuple(), and NTupleProjector::~NTupleProjector().

bool DataSource::isValidColumn unsigned int  index  )  const [protected, inherited]
 

Returns true if index is valid, otherwise throws a DataSourceException.

Definition at line 208 of file DataSource.cxx.

References DataSource::columns(), and num_util::size().

Referenced by NTuple::getColumn(), and DataSource::getColumn().

bool DataSource::isValidLabel const std::string label  )  const [inherited]
 

Returns true if label is a valid label for a column in the DataSource.

The search is case sensitive. If the label is not found, returns false.

Definition at line 250 of file DataSource.cxx.

References std::find(), and DataSource::m_labels.

Referenced by DataSource::throwIfInvalidLabel().

void Observable::notifyObservers Action  action  )  const [protected, inherited]
 

An internal method to iterate over all observers and to send the message action.

Definition at line 69 of file Observable.cxx.

References std::bind2nd(), std::for_each(), Observable::m_list, and std::mem_fun().

void FitsNTuple::notifyObservers  )  const [virtual]
 

Notifies observers.

Todo:
remove this method when Observable is exposed to Python.

Reimplemented from Observable.

Definition at line 74 of file FitsNTuple.cxx.

References Observable::notifyObservers().

Referenced by replaceColumn().

double FitsNTuple::operator[] std::vector< unsigned int > &  indices  )  const [virtual]
 

Raises assertion as this method is not yet implemented.

Implements DataSource.

Definition at line 135 of file FitsNTuple.cxx.

void Observable::removeObserver hippodraw::Observer  )  [inherited]
 

Removes an Observer from the Observer list.

Definition at line 63 of file Observable.cxx.

References Observable::m_list.

Referenced by BinningProjector::normalizeTo(), CutPlotter::removeFromTarget(), DisplayController::removeTextObservers(), NTupleProjector::setNTuple(), FunctionRep::willDelete(), FunctionRep::~FunctionRep(), and NTupleProjector::~NTupleProjector().

void FitsNTuple::replaceColumn const std::string label,
const std::vector< double > &  data
 

Replaces the data in column labeled label.

If the label is valid and if the size of data is the same as existing columns, then replaces the specified column with a copy of data in data. If the label is not valid or the sizes differ, then throws a DataSourceException. In neither case is the FITS file modified.

Definition at line 249 of file FitsNTuple.cxx.

References DataSource::indexOf(), and replaceColumn().

void FitsNTuple::replaceColumn unsigned int  index,
const std::vector< double > &  data
 

Replaces the data in column index.

If index is in a valid range and if the size of data is the same as existing columns, then replaces the specified column with a copy of data in data. If index is not a valid range or the sizes differ, then throws a DataSourceException. In neither case is the FITS file modified.

Definition at line 224 of file FitsNTuple.cxx.

References DataSource::columns(), std::copy(), m_data, notifyObservers(), rows(), and num_util::size().

Referenced by hippodraw::Python::export_FitsNTuple(), and replaceColumn().

void FitsNTuple::reserve unsigned int  count  )  [virtual]
 

Raises assertion as the contained FITS file should not be changed.

Implements DataSource.

Definition at line 114 of file FitsNTuple.cxx.

unsigned int FitsNTuple::rows  )  const [virtual]
 

Returns the size of the slice for the next to last dimension.

Implements DataSource.

Definition at line 81 of file FitsNTuple.cxx.

References m_file.

Referenced by addColumn(), empty(), fillDataCache(), and replaceColumn().

bool DataSource::setLabelAt const std::string s,
unsigned int  index
[virtual, inherited]
 

Changes the label of a data column to s.

Parameters:
s the new label.
index the column number starting at zero.
Returns:
true if index is less than the width of the ntuple; otherwise, it does nothing and returns false.

Definition at line 157 of file DataSource.cxx.

References DataSource::m_labels, and Observable::notifyObservers().

void DataSource::setLabels const std::vector< std::string > &  v  )  [virtual, inherited]
 

Assigns the label to each column from the vector of strings @ v.

Reimplemented in NTuple.

Definition at line 289 of file DataSource.cxx.

References DataSource::m_labels, and Observable::notifyObservers().

Referenced by hippodraw::Python::export_ListTuple(), hippodraw::Python::export_NumArrayTuple(), RTuple::RTuple(), and NTuple::setLabels().

void DataSource::setName const std::string name  )  [inherited]
 

Sets the name of the ntuple.

See also:
m_ds_name.

Definition at line 126 of file DataSource.cxx.

References DataSource::m_ds_name, and Observable::notifyObservers().

Referenced by NTupleController::createNTuple(), hippodraw::Python::export_DataSource(), PyDataSource::registerNTuple(), DataSourceController::registerNTuple(), and PyDataSource::setName().

bool DataSource::setReleventIndex const std::string column,
const std::vector< unsigned int > &  index
[virtual, inherited]
 

In case we are dealing with multidimensional data in rows of this column we would like to deal with on one entry of this multidimensional data.

So here we set index of this relevant entry.

Reimplemented in RootNTuple, and RootNTuple.

Definition at line 366 of file DataSource.cxx.

void FitsNTuple::setShape std::vector< unsigned int > &  shape  )  [virtual]
 

Sets the shape of the data elements.

Sets the shape data elements from the vector shape. The rank is given by the size of the vector. A rank of 2 correspond to table. If the total number of elements in the FitsNTuple is not equal to the product of the shape, then an assertion is raised.

Reimplemented from DataSource.

Definition at line 258 of file FitsNTuple.cxx.

References DataSource::m_shape, and num_util::size().

void DataSource::setTitle const std::string title  )  [inherited]
 

Sets the title of the ntuple to title.

Definition at line 142 of file DataSource.cxx.

References DataSource::m_title, and Observable::notifyObservers().

Referenced by hippodraw::Python::export_DataSource(), NTupleController::readAsciiNTuple(), and PyDataSource::setTitle().

double DataSource::sum unsigned int  column  )  const [virtual, inherited]
 

Returns the sum of all the elements in the sequence of column column.

Reimplemented in NTuple.

Definition at line 419 of file DataSource.cxx.

References DataSource::columns(), DataSource::rows(), num_util::size(), and DataSource::valueAt().

void DataSource::throwIfInvalidLabel const std::string label  )  const [virtual, inherited]
 

Throws a DataSourceException object if label is not a valid label for this DataSource.

The exception object contains a message that the label is invalid. Derived classes may over-ride this method with more information on why the label is invalid.

Definition at line 264 of file DataSource.cxx.

References DataSource::isValidLabel().

Referenced by NTuple::getColumn(), RootNTuple::getColumn(), and QtRootNTuple::valueAt().

void DataSource::throwIfInvalidRowSize const std::vector< double > &  row  )  [inherited]
 

Throws a DataSourceException if the size of the row is not equal to the number of columns, otherwise does nothing.

Definition at line 277 of file DataSource.cxx.

References DataSource::columns(), and num_util::size().

Referenced by RTuple::addRow(), NTuple::addRow(), and NTuple::replaceRow().

const string & DataSource::title  )  const [inherited]
 

Returns a const reference to the title of the ntuple.

Definition at line 137 of file DataSource.cxx.

References DataSource::m_title.

Referenced by hippodraw::Python::export_DataSource(), DataSource::getLabelAt(), PyDataSource::getTitle(), NTupleProjector::getTitle(), and NTupleController::writeNTupleToFile().

double FitsNTuple::valueAt unsigned int  row,
unsigned int  column
const [virtual]
 

Returns the value in the table in position given by the row and column indexes.

Implements DataSource.

Definition at line 143 of file FitsNTuple.cxx.

References fillDataCache(), and m_data.

Referenced by getRow().


Member Data Documentation

std::vector< double > DataSource::m_array [mutable, protected, inherited]
 

A temporary array that can be returned by const reference.

Definition at line 81 of file DataSource.h.

Referenced by DataSource::getColumn(), RootNTuple::getRow(), and getRow().

std::vector< std::vector < double > * > FitsNTuple::m_data [private]
 

The numarray objects that contains the data.

Definition at line 35 of file FitsNTuple.h.

Referenced by addColumn(), clear(), fillDataCache(), fillRange(), getRow(), replaceColumn(), and valueAt().

FitsFile* FitsNTuple::m_file [private]
 

The FitsFile used for this ntuple.

Definition at line 39 of file FitsNTuple.h.

Referenced by fillDataCache(), FitsNTuple(), getFile(), initColumns(), and rows().

int FitsNTuple::m_hdu_num [private]
 

The HDU number used for this ntuple.

The first (primary) HDU is = 1.

Definition at line 44 of file FitsNTuple.h.

Referenced by FitsNTuple().

std::vector< unsigned int > DataSource::m_shape [protected, inherited]
 

The shape of the data.

The elements the DataSource can have an arbitrary number of dimensions, called rank. An ordinary table has rank of 2 and the shape is number of columns and number of rows. That is m_shape[0] is number of columns and m_share[1] is number of rows.

Definition at line 89 of file DataSource.h.

Referenced by DataSource::copyPrivate(), NumArrayTuple::getRank(), ListTuple::getRank(), RootNTuple::getRank(), getRank(), DataSource::getRank(), NumArrayTuple::getShape(), ListTuple::getShape(), RootNTuple::getShape(), getShape(), DataSource::getShape(), RTuple::operator[](), NTuple::operator[](),