ROOT logo
ROOT » GRAF2D » FITSIO » TFITSHDU

class TFITSHDU: public TNamed


FITS file interface class

TFITS is a class that allows extracting images and data from FITS files and contains several methods to manage them.
 

Function Members (Methods)

public:
TFITSHDU(const char* filepath_with_filter)
TFITSHDU(const TFITSHDU&)
TFITSHDU(const char* filepath, Int_t extension_number)
TFITSHDU(const char* filepath, const char* extension_name)
virtual~TFITSHDU()
voidTObject::AbstractMethod(const char* method) const
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
Bool_tChange(const char* filter)
Bool_tChange(Int_t extension_number)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTNamed::Clear(Option_t* option = "")
virtual TObject*TNamed::Clone(const char* newname = "") const
virtual Int_tTNamed::Compare(const TObject* obj) const
virtual voidTNamed::Copy(TObject& named) const
virtual voidTObject::Delete(Option_t* option = "")MENU
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidDraw(Option_t* opt = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual voidTNamed::FillBuffer(char*& buffer)
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
TVectorD*GetArrayColumn(UInt_t col)
TVectorD*GetArrayRow(UInt_t row)
Int_tGetColumnNumber(const char* colname)
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual const char*TObject::GetIconName() const
TString&GetKeywordValue(const char* keyword)
virtual const char*TNamed::GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
TFITSHDU::HDURecord*GetRecord(const char* keyword)
Int_tGetRecordNumber() const
Int_tGetTabNColumns() const
Int_tGetTabNRows() const
TVectorD*GetTabRealVectorCell(Int_t rownum, Int_t colnum)
TVectorD*GetTabRealVectorCell(Int_t rownum, const char* colname)
TObjArray*GetTabRealVectorCells(Int_t colnum)
TObjArray*GetTabRealVectorCells(const char* colname)
TVectorD*GetTabRealVectorColumn(Int_t colnum)
TVectorD*GetTabRealVectorColumn(const char* colname)
TObjArray*GetTabStringColumn(Int_t colnum)
TObjArray*GetTabStringColumn(const char* colname)
virtual const char*TNamed::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTNamed::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTNamed::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidTNamed::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual Bool_tTObject::Notify()
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
TFITSHDU&operator=(const TFITSHDU&)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidPrint(Option_t* opt = "") const
virtual Int_tTObject::Read(const char* name)
TH1*ReadAsHistogram()
TImage*ReadAsImage(Int_t layer = 0, TImagePalette* pal = 0)
TMatrixD*ReadAsMatrix(Int_t layer = 0, Option_t* opt = "")
virtual voidTObject::RecursiveRemove(TObject* obj)
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(ostream& out, Option_t* option = "")
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
virtual voidTNamed::SetName(const char* name)MENU
virtual voidTNamed::SetNameTitle(const char* name, const char* title)
static voidTObject::SetObjectStat(Bool_t stat)
virtual voidTNamed::SetTitle(const char* title = "")MENU
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector& insp)
virtual Int_tTNamed::Sizeof() const
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
protected:
static voidCleanFilePath(const char* filepath_with_filter, TString& dst)
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
Bool_tLoadHDU(TString& filepath_filter)
voidTObject::MakeZombie()
voidPrintColumnInfo(Option_t*) const
voidPrintFileMetadata(Option_t* opt = "") const
voidPrintFullTable(Option_t*) const
voidPrintHDUMetadata(Option_t* opt = "") const
private:
void_initialize_me()
void_release_resources()

Data Members

public:
enum EHDUTypes { kImageHDU
kTableHDU
};
enum EColumnTypes { kRealNumber
kString
kRealVector
};
enum TObject::EStatusBits { kCanDelete
kMustCleanup
kObjInCanvas
kIsReferenced
kHasUUID
kCannotPick
kNoContextMenu
kInvalidObject
};
enum TObject::[unnamed] { kIsOnHeap
kNotDeleted
kZombie
kBitMask
kSingleKey
kOverwrite
kWriteDelete
};
protected:
TStringfBaseFilePathPath to HDU's file excluding filter
TFITSHDU::Cell*fCellsTable cells (when fType == kTableHDU). Cells are ordered in the following way:
TString*fColumnNamesArray of column names following the order within the FITS file (when fType == kTableHDU)
TFITSHDU::EColumnTypes*fColumnTypesArray of column types following the order within the FITS file (when fType == kTableHDU)
TFITSHDU::Column*fColumnsInfoInformation about columns (when fType == kTableHDU)
TStringfExtensionNameExtension Name
TStringfFilePathPath to HDU's file including filter
Int_tfNColumnsNumber of columns (when fType == kTableHDU)
Int_tfNRecordsNumber of records
Int_tfNRowsNumber of rows (when fType == kTableHDU)
TStringTNamed::fNameobject identifier
Int_tfNumberHDU number (1=PRIMARY)
TArrayD*fPixelsImage pixels (when fType == kImageHDU)
TFITSHDU::HDURecord*fRecordsHDU metadata records
TArrayI*fSizesImage sizes in each dimension (when fType == kImageHDU)
TStringTNamed::fTitleobject title
TFITSHDU::EHDUTypesfTypeHDU type

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

void CleanFilePath(const char* filepath_with_filter, TString& dst)
 Clean path from possible filter and put the result in 'dst'.
TFITSHDU(const char* filepath_with_filter)
 TFITSHDU constructor from file path with HDU selection filter.
 Please refer to CFITSIO manual for more information about
 HDU selection filters.
 Examples:
 - TFITSHDU("/path/to/myfile.fits"): just open the PRIMARY HDU
 - TFITSHDU("/path/to/myfile.fits[1]"): open HDU #1
 - TFITSHDU("/path/to/myfile.fits[PICS]"): open HDU called 'PICS'
 - TFITSHDU("/path/to/myfile.fits[ACQ][EXPOSURE > 5]"): open the (table) HDU called 'ACQ' and
                                                        selects the rows that have column 'EXPOSURE'
                                                        greater than 5.
TFITSHDU(const char* filepath, Int_t extension_number)
 TFITSHDU constructor from filepath and extension number.
TFITSHDU(const char* filepath, const char* extension_name)
 TFITSHDU constructor from filepath and extension name.
~TFITSHDU()
 TFITSHDU destructor.
void _release_resources()
 Release internal resources.
void _initialize_me()
 Do some initializations.
Bool_t LoadHDU(TString& filepath_filter)
 Load HDU from fits file satisfying the specified filter.
 Returns kTRUE if success. Otherwise kFALSE.
 If filter == "" then the primary array is selected
TString& GetKeywordValue(const char* keyword)
 Get the value of a given keyword. Return "" if not found.
void PrintHDUMetadata(Option_t* opt = "") const
 Print records.
void PrintFileMetadata(Option_t* opt = "") const
 Print HDU's parent file's metadata.
void PrintColumnInfo(Option_t* ) const
 Print column information
void PrintFullTable(Option_t* ) const
 Print full table contents
void Print(Option_t* opt = "") const
 Print metadata.
 Currently supported options:
 ""  :  print HDU record data
 "F" :  print FITS file's extension names, numbers and types
 "F+":  print FITS file's extension names and types and their record data
 "T" :  print column information when HDU is a table
 "T+" : print full table (columns header and rows)
TImage * ReadAsImage(Int_t layer = 0, TImagePalette* pal = 0)
 Read image HDU as a displayable image. Return 0 if conversion cannot be done.
 If the HDU seems to be a multilayer image, 'layer' parameter can be used
 to retrieve the specified layer (starting from 0)
void Draw(Option_t* opt = "")
 If the HDU is an image, draw the first layer of the primary array
 To set a title to the canvas, pass it in "opt"
TMatrixD* ReadAsMatrix(Int_t layer = 0, Option_t* opt = "")
 Read image HDU as a matrix. Return 0 if conversion cannot be done
 If the HDU seems to be a multilayer image, 'layer' parameter can be used
 to retrieve the specified layer (starting from 0) in matrix form.
 Options (value of 'opt'):
 "S": stretch pixel values to a range from 0.0 to 1.0
TH1 * ReadAsHistogram()
 Read image HDU as a histogram. Return 0 if conversion cannot be done.
 The returned object can be TH1D, TH2D or TH3D depending on data dimensionality.
 Please, check condition (returnedValue->IsA() == TH*D::Class()) to
 determine the object class.
 NOTE: do not confuse with image histogram! This function interprets
 the array as a histogram. It does not compute the histogram of pixel
 values of an image! Here "pixels" are interpreted as number of entries.
TVectorD* GetArrayRow(UInt_t row)
 Get a row from the image HDU when it's a 2D array.
TVectorD* GetArrayColumn(UInt_t col)
 Get a column from the image HDU when it's a 2D array.
Int_t GetColumnNumber(const char* colname)
Get column number given its name
TObjArray* GetTabStringColumn(Int_t colnum)
 Get a string-typed column from a table HDU given its column index (>=0).
TObjArray* GetTabStringColumn(const char* colname)
 Get a string-typed column from a table HDU given its name
TVectorD* GetTabRealVectorColumn(Int_t colnum)
 Get a real number-typed column from a table HDU given its column index (>=0).
TVectorD* GetTabRealVectorColumn(const char* colname)
 Get a real number-typed column from a table HDU given its name
Bool_t Change(const char* filter)
 Change to another HDU given by "filter".
 The parameter "filter" will be appended to the
 FITS file's base path. For example:
 hduObject.Change("[EVENTS][TIME > 5]");
 Please, see documentation of TFITSHDU(const char *filepath_with_filter) constructor
 for further information.
Bool_t Change(Int_t extension_number)
 Change to another HDU given by extension_number
TObjArray * GetTabRealVectorCells(Int_t colnum)
 Get a collection of real vectors embedded in cells along a given column from a table HDU. colnum >= 0.
TObjArray * GetTabRealVectorCells(const char* colname)
 Get a collection of real vectors embedded in cells along a given column from a table HDU by name
TVectorD * GetTabRealVectorCell(Int_t rownum, Int_t colnum)
 Get a real vector embedded in a cell given by (row>=0, column>=0)
TVectorD * GetTabRealVectorCell(Int_t rownum, const char* colname)
 Get a real vector embedded in a cell given by (row>=0, column name)
TFITSHDU(const char* filepath_with_filter)
Int_t GetRecordNumber() const
Metadata access methods
{ return fNRecords; }
struct HDURecord * GetRecord(const char* keyword)
Int_t GetTabNColumns() const
Table readers
{ return fNColumns; }
Int_t GetTabNRows() const
{ return fNRows; }