Open a FITS file whose primary array represents a spectrum (flux vs wavelength).
void FITS_tutorial4()
{
TFITSHDU hdu(dir +
"/fitsio/sample2.fits[1][DATAMAX > 2e-15]");
hdu.Print("T");
hdu.Print("T+");
std::unique_ptr<TVectorD> vp(hdu.GetTabRealVectorColumn("DATAMAX"));
std::cout <<
"v[0] = " <<
v[0] << std::endl;
std::cout << "Does the matched row have DATAMAX > 2e-15? :-)" << std::endl;
}
FITS file interface class.
CRVAL1 : REAL NUMBER
CRPIX1 : REAL NUMBER
CD1_1 : REAL NUMBER
DATAMIN : REAL NUMBER
DATAMAX : REAL NUMBER
RA_APER : REAL NUMBER
DEC_APER : REAL NUMBER
FILLCNT : REAL NUMBER
ERRCNT : REAL NUMBER
FPKTTIME : REAL NUMBER
LPKTTIME : REAL NUMBER
CTYPE1 : STRING
APER_POS : STRING
PASS_DIR : REAL NUMBER
YPOS : REAL NUMBER
YTYPE : STRING
EXPOSURE : REAL NUMBER
X_OFFSET : REAL NUMBER
Y_OFFSET : REAL NUMBER
CRVAL1 | CRPIX1 | CD1_1 | DATAMIN | DATAMAX | RA_APER | DEC_APER | FILLCNT | ERRCNT | FPKTTIME | LPKTTIME | CTYPE1 | APER_POS | PASS_DIR | YPOS | YTYPE | EXPOSURE | X_OFFSET | Y_OFFSET |
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 | 1 | 1 | 0 | 2.7e-15 | 1.8e+02 | 39 | 0 | 0 | 4.9e+04 | 4.9e+04 | PIXEL | SINGLE | 0 | -1.5e+03 | OBJ | 31 | 0 | 0 |
v[0] = 2.73876e-15
Does the matched row have DATAMAX > 2e-15? :-)
- Author
- Claudi Martinez
Definition in file FITS_tutorial4.C.