NASA - Jet Propulsion Laboratory
    + View the NASA Portal
Search JPL
Jet Propulsion Laboratory Home Earth Solar System Stars & Galaxies Technology
Introduction Background Software Links


write_bintabh


This routine is designed to write large (or huge) arrays into a binary table extension of a FITS file. The user can choose to write the array piece by piece. This is designed to deal with Time Ordered Data set (tod).


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


FORMAT

call write_bintabh( tod, npix, ntod, header, nlheader, filename, [extno, firstpix, repeat] )

Arguments appearing in italic are optional.


ARGUMENTS

name & dimensionality kind in/out description
       
tod(0:npix-1,1:ntod) SP IN the map or tod to write to the FITS-file. It will be written in the file at the location corresponding to pixels (or time samples) firstpix to firtpix + npix -1.
npix I8B IN Number of pixels or time samples in the map or TOD. See Note below.
ntod I4B IN number of maps or tods to be written.
header(LEN=80) (1:nlheader) CHR IN The header for the FITS-file.
nlheader I4B IN number of header lines to write to the file.
filename(LEN=filenamelen) CHR IN the array is written into a FITS-file with this filename.
extno I4B IN extension number in which to write the data (0 based). default:0
firstpix I8B IN 0 location in the FITS file of the first pixel (or time sample) to be written (0 based). default: 0. See Note below.
repeat I4B IN length of the element vector used in the binary table. default:1024 if npix $\propto 1024$; 12000 if npix > 12000 and 1 otherwise. Choosing a large repeat for multi-column tables (ntod >1) generally speeds up the I/O. It also helps bringing the number of rows of the table under 231, which is a hard limit of cfitsio.
Note : Indices and number of data elements larger than 231 are only accessible in FITS files on computers with 64 bit enabled compilers and with some specific compilation options of cfitsio (see cfitsio documentation).


EXAMPLE:

use healpix_types
use fitstools, only : write_bintabh
character(len=80), dimension(1:128) :: hdr
real(SP), dimension(0:49,1) :: tod
hdr(:) = ' '
tod(:,1) = 1.
call write_bintabh(tod, 50_i8b, 1, header, 128, 'tod.fits', firstpix=0_i8b, repeat=10)
tod = tod * 3.
call write_bintabh(tod, 20_i8b, 1, header, 128, 'tod.fits', firstpix=40_i8b)

Writes into the FITS file `tod.fits' a 1 column binary table, where the first 40 data samples have the value 1. and the next 20 have the value 3. (Note that in this example the second call to write_bintabh overwrites some of the pixels written by the first call). The samples will be written in element vectors of length 10. The header for the FITS-file is given in the string array hdr and the number of lines in the header is 128.


MODULES & ROUTINES

This section lists the modules and routines used by write_bintabh.

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 write_bintabh


input_tod*
routine that reads a file created by write_bintabh.
input_map, read_bintab
routines to read HEALPix sky map,
write_minimal_header
routine to write minimal FITS header

Eric Hivon 2010-06-18
Privacy / Copyright
FIRST GOV Contact: NASA Home Page Site Manager:
Webmaster:

CL 03-2650