getsize_fits


This routine reads the number of maps and/or the pixel ordering of a FITS file containing a HEALPix map.

Location in HEALPix directory tree: src/f90/mod/fitstools.F90 


FORMAT

var=getsize_fits( filename[, nmaps, ordering, obs_npix, nside, mlpol, type, polarisation, fwhm_arcmin, beam_leg, coordsys, polcconv, extno] )

Arguments appearing in italic are optional.


ARGUMENTS

name & dim. kind in/out description
       
var I8B OUT number of pixels or time samples in the chosen extension of the FITS file
filename(LEN=*) CHR IN filename of the FITS-file containing HEALPix map(s).
name & dim. kind in/out description
       
nmaps (OPTIONAL) I4B OUT number of maps in the extension.
ordering (OPTIONAL) I4B OUT pixel ordering, 0=unknown, 1=RING, 2=NESTED
obs_npix (OPTIONAL) I4B OUT number of non blanck pixels. It is set to -1 if it can not be determined from header information alone
nside (OPTIONAL) I4B OUT Healpix resolution parameter Nside. Returns a negative value if not found.
mlpol (OPTIONAL) I4B OUT maximum multipole used to generate the map (for simulated map). Returns a negative value if not found.
type (OPTIONAL) I4B OUT Healpix/FITS file type
<0 : file not found, or not valid
0 : image only fits file, deprecated Healpix format (var = 12 * nside * nside)
1 : ascii table, generally used for C(l) storage
2 : binary table : with implicit pixel indexing (full sky) (var = 12 * nside * nside)
3 : binary table : with explicit pixel indexing (generally cut sky) (var $\le$ 12 * nside * nside)
999 : unable to determine the type
polarisation (OPTIONAL) I4B OUT presence of polarisation data in the file
<0 : can not find out
0 : no polarisation
1 : contains polarisation (Q,U or G,C)
fwhm_arcmin (OPTIONAL) DP OUT returns the beam FWHM read from FITS header, translated from Deg (hopefully) to arcmin. Returns a negative value if not found.
beam_leg(LEN=*) (OPTIONAL) CHR OUT filename of beam or filtering window function applied to data (FITS keyword BEAM_LEG). Returns a empty string if not found.
coordsys(LEN=20) (OPTIONAL) CHR OUT string describing the pixelation astrophysical coordinates. 'G' = Galactic, 'E' = ecliptic, 'C' = celestial = equatorial. Returns a empty string if not found.
polcconv (OPTIONAL) I4B OUT polarisation coordinate convention (see Healpix primer for details) 0=unknown, 1=COSMO, 2=IAU
extno (OPTIONAL) I4B IN extension number (0 based) for which information is provided. Default = 0 (first extension).


EXAMPLE:

npix= getsize_fits('map.fits', nmaps=nmaps, ordering=ordering, obs_npix=obs_npix, nside=nside, mlpol=mlpol, type=type, polarisation=polarisation)
Returns 1 or 3 in nmaps, dependent on wether 'map.fits' contain only temperature or both temperature and polarisation maps. The pixel ordering number is found by reading the keyword ORDERING in the FITS file. If this keyword does not exist, 0 is returned.

MODULES & ROUTINES

This section lists the modules and routines used by getsize_fits.

fitstools
module, containing:
printerror
routine for printing FITS error messages.
cfitsio
library for FITS file handling.


RELATED ROUTINES

This section lists the routines related to getsize_fits

getnumext_fits
routine returning the number of extension in a FITS file
input_map
routine to read a HEALPix FITS file

Version 3.31, 2017-01-06