Logo ROOT   6.18/05
Reference Guide
FITS_tutorial3.C File Reference

Detailed Description

View in nbviewer Open in SWAN

Open a FITS file and retrieve the first plane of the image array as a TImage object.

void FITS_tutorial3()
{
// We open a FITS file that contains several image
// extensions. The primary HDU contains no data.
// Data copyright: NASA
// Open extensions 1 to 5 from file
TString dir = gROOT->GetTutorialDir();
auto c = new TCanvas("c1", "FITS tutorial #1", 800, 700);
c->Divide(2, 3);
for (auto i : ROOT::TSeqI(1, 6)) {
TFITSHDU hdu(dir + "/fitsio/sample3.fits", i);
std::unique_ptr<TImage> im(hdu.ReadAsImage(0));
c->cd(i);
im->DrawClone();
}
}
#define c(i)
Definition: RSha256.hxx:101
#define gROOT
Definition: TROOT.h:414
A pseudo container class which is a generator of indices.
Definition: TSeq.hxx:66
The Canvas class.
Definition: TCanvas.h:31
FITS file interface class.
Definition: TFITS.h:34
Basic string class.
Definition: TString.h:131
Author
Claudi Martinez

Definition in file FITS_tutorial3.C.