ROOT
v6-20
Reference Guide
FITS_tutorial3.C
Go to the documentation of this file.
1
/// \file
2
/// \ingroup tutorial_FITS
3
/// \notebook -draw
4
///
5
/// Open a FITS file and retrieve the first plane of the image array
6
/// as a TImage object.
7
///
8
/// \macro_image
9
/// \macro_code
10
/// \macro_output
11
///
12
/// \author Claudi Martinez
13
14
void
FITS_tutorial3()
15
{
16
// We open a FITS file that contains several image
17
// extensions. The primary HDU contains no data.
18
// Data copyright: NASA
19
20
// Open extensions 1 to 5 from file
21
TString
dir =
gROOT
->GetTutorialDir();
22
23
auto
c
=
new
TCanvas
(
"c1"
,
"FITS tutorial #1"
, 800, 700);
24
c
->Divide(2, 3);
25
for
(
auto
i :
ROOT::TSeqI
(1, 6)) {
26
TFITSHDU
hdu(dir +
"/fitsio/sample3.fits"
, i);
27
28
std::unique_ptr<TImage> im(hdu.ReadAsImage(0));
29
c
->cd(i);
30
im->DrawClone();
31
}
32
}
c
#define c(i)
Definition:
RSha256.hxx:101
gROOT
#define gROOT
Definition:
TROOT.h:415
ROOT::TSeq
A pseudo container class which is a generator of indices.
Definition:
TSeq.hxx:66
TCanvas
The Canvas class.
Definition:
TCanvas.h:31
TFITSHDU
FITS file interface class.
Definition:
TFITS.h:34
TString
Basic string class.
Definition:
TString.h:131
tutorials
fitsio
FITS_tutorial3.C
ROOT v6-20 - Reference Guide Generated on Fri Apr 1 2022 00:23:40 (GVA Time) using Doxygen 1.9.4