00001
00002
00003 void FITS_tutorial3()
00004 {
00005 printf("\n\n--------------------------------\n");
00006 printf("WELCOME TO FITS tutorial #3 !!!!\n");
00007 printf("--------------------------------\n");
00008 printf("We're gonna open a FITS file that contains several image\n");
00009 printf("extensions. The primary HDU contains no data.\n");
00010 printf("Data copyright: NASA\n\n");
00011
00012 if (!gROOT->IsBatch()) {
00013
00014 }
00015
00016
00017
00018
00019 TCanvas *c = new TCanvas("c1", "FITS tutorial #1", 800, 700);
00020 c->Divide(2,3);
00021 for (int i=1; i <= 5; i++) {
00022 TFITSHDU *hdu = new TFITSHDU("sample3.fits", i);
00023 if (hdu == 0) {
00024 printf("ERROR: could not access the HDU\n"); return;
00025 }
00026
00027 TASImage *im = hdu->ReadAsImage(0);
00028 c->cd(i);
00029 im->Draw();
00030 delete hdu;
00031 }
00032 }
00033
00034