15 printf(
"\n\n--------------------------------\n");
16 printf(
"WELCOME TO FITS tutorial #5 !!!!\n");
17 printf(
"--------------------------------\n");
18 printf(
"We're gonna open a FITS file that contains a\n");
19 printf(
"table with 9 rows and 8 columns. Column 4 has name\n");
20 printf(
"'mag' and contains a vector of 6 numeric components.\n");
21 printf(
"The values of vectors in rows 1 and 2 (column 4) are:\n");
22 printf(
"Row1: (99.0, 24.768, 23.215, 21.68, 21.076, 20.857)\n");
23 printf(
"Row2: (99.0, 21.689, 20.206, 18.86, 18.32 , 18.128 )\n");
24 printf(
"WARNING: when coding, row and column indices start from 0\n");
26 if (!
gROOT->IsBatch()) {
36 printf(
"ERROR: could not access the HDU\n");
return;
44 for (
int iVec=0; iVec < 2; iVec++) {
45 printf(
"Vector %d = (", iVec+1);
48 if (i>0) printf(
", ");
49 printf(
"%lg", (*v)[i]);
54 printf(
"\nBONUS EXAMPLE: we're gonna dump all rows using\n");
55 printf(
"the function GetTabRealVectorCells()\n");
60 for (
int iVec=0; iVec < vectorCollection->
GetEntriesFast(); iVec++) {
61 printf(
"Vector %d = (", iVec+1);
62 v = (
TVectorD *) (*vectorCollection)[iVec];
64 if (i>0) printf(
", ");
65 printf(
"%lg", (*v)[i]);
74 delete vectorCollection;
virtual const char * DirName(const char *pathname)
Return the directory name in pathname.
FITS file interface class.
R__EXTERN TSystem * gSystem
Int_t GetEntriesFast() const
Int_t GetNoElements() const
TVectorD * GetTabRealVectorCell(Int_t rownum, Int_t colnum)
Get a real vector embedded in a cell given by (row>=0, column>=0)
TObjArray * GetTabRealVectorCells(Int_t colnum)
Get a collection of real vectors embedded in cells along a given column from a table HDU...