ROOT
Version master
v6.34
v6.32
v6.30
v6.28
v6.26
v6.24
v6.22
v6.20
v6.18
v6.16
v6.14
v6.12
v6.10
v6.08
v6.06
Reference Guide
►
ROOT
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
Loading...
Searching...
No Matches
FITS_tutorial4.C
Go to the documentation of this file.
1
/// \file
2
/// \ingroup tutorial_FITS
3
/// \notebook
4
/// Open a FITS file whose primary array represents
5
/// a spectrum (flux vs wavelength).
6
///
7
/// \macro_code
8
/// \macro_output
9
///
10
/// \author Claudi Martinez
11
12
void
FITS_tutorial4
()
13
{
14
// We open a FITS file that contains the primary HDU and a little data table.
15
// The data table is extension #1 and it has 2 rows.
16
// We want to read only the rows that have the column named DATAMAX greater than 2e-15 (there's only 1
17
// matching row Data copyright: NASA
18
19
TString
dir =
gROOT
->GetTutorialDir();
20
21
// Open the table extension number 1)
22
TFITSHDU
hdu
(dir +
"/io/fitsio/sample2.fits[1][DATAMAX > 2e-15]"
);
23
24
hdu
.Print(
"T"
);
25
26
hdu
.Print(
"T+"
);
27
28
std::unique_ptr<TVectorD>
vp
(
hdu
.GetTabRealVectorColumn(
"DATAMAX"
));
29
const
auto
&
v
= *
vp
;
30
std::cout <<
"v[0] = "
<<
v
[0] << std::endl;
31
std::cout <<
"Does the matched row have DATAMAX > 2e-15? :-)"
<< std::endl;
32
}
TRangeDynCast
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Definition
TCollection.h:358
gROOT
#define gROOT
Definition
TROOT.h:406
ROOT::Detail::TRangeCast
Definition
TCollection.h:311
TFITSHDU
FITS file interface class.
Definition
TFITS.h:35
TString
Basic string class.
Definition
TString.h:139
v
@ v
Definition
rootcling_impl.cxx:3699
tutorials
io
fitsio
FITS_tutorial4.C
ROOT master - Reference Guide Generated on Sun Apr 6 2025 05:38:00 (GVA Time) using Doxygen 1.10.0