1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> 2 3<!--Converted with LaTeX2HTML 2018.3 (Released July 19, 2018) --> 4<HTML lang="EN"> 5<HEAD> 6<TITLE>write_bintabh*</TITLE> 7<META NAME="description" CONTENT="write_bintabh*"> 8<META NAME="keywords" CONTENT="subroutines"> 9<META NAME="resource-type" CONTENT="document"> 10<META NAME="distribution" CONTENT="global"> 11 12<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> 13<META NAME="viewport" CONTENT="width=device-width, initial-scale=1.0"> 14<META NAME="Generator" CONTENT="LaTeX2HTML v2018.3"> 15 <link rel='apple-touch-icon' sizes='180x180' href='images/favicons/apple-touch-icon.png?v=2017'> 16 <link rel='icon' type='image/png' sizes='32x32' href='images/favicons/favicon-32x32.png?v=2017'> 17 <link rel='icon' type='image/png' sizes='16x16' href='images/favicons/favicon-16x16.png?v=2017'> 18 <link rel='manifest' href='images/favicons/manifest.json?v=2017'> 19 <link rel='mask-icon' href='images/favicons/safari-pinned-tab.svg?v=2017' color='#5bbad5'> 20 <link rel='shortcut icon' href='images/favicons/favicon.ico?v=2017'> 21 <meta name='apple-mobile-web-app-title' content='HEALPix'> 22 <meta name='application-name' content='HEALPix'> 23 <meta name='msapplication-config' content='images/favicons/browserconfig.xml?v=2017'> 24 <meta name='theme-color' content='#ffffff'> 25 26<LINK REL="STYLESHEET" HREF="subroutines.css"> 27 28<LINK REL="next" HREF="sub_write_dbintab.htm"> 29<LINK REL="previous" HREF="sub_write_bintab.htm"> 30<LINK REL="next" HREF="sub_write_dbintab.htm"> 31</HEAD> 32 33<body text="#000000" bgcolor="#FFFFFA"> 34 35<DIV CLASS="navigation"><!--Navigation Panel--> 36<A 37 HREF="sub_write_bintab.htm"> 38<IMG WIDTH="63" HEIGHT="24" ALT="previous" SRC="prev.png"></A> 39<A 40 HREF="sub_HEALPix_F90_subroutines.htm"> 41<IMG WIDTH="26" HEIGHT="24" ALT="up" SRC="up.png"></A> 42<A 43 HREF="sub_write_dbintab.htm"> 44<IMG WIDTH="37" HEIGHT="24" ALT="next" SRC="next.png"></A> 45<A ID="tex2html514" 46 HREF="sub_TABLE_CONTENTS.htm"> 47<IMG WIDTH="65" HEIGHT="24" ALT="contents" SRC="contents.png"></A> 48<BR> 49<B> Previous:</B> <A 50 HREF="sub_write_bintab.htm">write_bintab*</A> 51 52<B>Up:</B> <A 53 HREF="sub_HEALPix_F90_subroutines.htm">HEALPix/F90 subroutines</A> 54 55<B> Next:</B> <A 56 HREF="sub_write_dbintab.htm">write_dbintab</A> 57<B> Top:</B> <a href="main.htm">Main Page</a></DIV> 58<!--End of Navigation Panel--> 59 60<H1><A ID="SECTION11100"></A> 61<A ID="sub:write_bintabh"></A> 62<BR> 63 64</H1> 65 66<P> 67<b><font size=+6><FONT COLOR="#CC0000">write_bintabh</FONT></font></b><hr> 68<H3>This routine is designed to write large (or huge) arrays into a binary table 69extension of a FITS file. The user can 70choose to write the array piece by piece. This is designed to deal with Time 71Ordered Data set (tod).</H3> 72Location in HEALPix directory tree: <a href="https://sourceforge.net/p/healpix/code/1005/tree/trunk/src/f90/mod/fitstools.F90"><b>src/f90/mod/fitstools.F90</b></a> 73 74<P> 75<hr><h1>FORMAT </h1><blockquote><h3>call <FONT COLOR="#CC0000">write_bintabh</FONT>( 76<A HREF="#sub:write_bintabh:tod">tod</A>, <A HREF="#sub:write_bintabh:npix">npix</A>, <A HREF="#sub:write_bintabh:ntod">ntod</A>, <A HREF="#sub:write_bintabh:header">header</A>, <A HREF="#sub:write_bintabh:nlheader">nlheader</A>, <A HREF="#sub:write_bintabh:filename">filename</A>, <i><font color="#224422">[<A HREF="#sub:write_bintabh:extno">extno</A>, <A HREF="#sub:write_bintabh:firstpix">firstpix</A>, <A HREF="#sub:write_bintabh:repeat">repeat</A>]</font></i> 77)</h3></blockquote> 78Arguments appearing in <i><font color="#224422">italic</font></i> are 79optional. 80 81<P> 82<hr><H1>ARGUMENTS</H1> 83 84<TABLE CELLPADDING=3 BORDER="1"> 85<TR><TH ALIGN="LEFT" VALIGN="TOP" WIDTH=175><SPAN CLASS="textbf">name & dimensionality</SPAN></TH> 86<TH ALIGN="LEFT" VALIGN="TOP" WIDTH=25><SPAN CLASS="textbf">kind</SPAN></TH> 87<TH ALIGN="LEFT" VALIGN="TOP" WIDTH=40><SPAN CLASS="textbf">in/out</SPAN></TH> 88<TH ALIGN="LEFT" VALIGN="TOP" WIDTH=225><SPAN CLASS="textbf">description</SPAN></TH> 89</TR> 90<TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=175> </TD> 91<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25> </TD> 92<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=40> </TD> 93<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=225> </TD> 94</TR> 95<TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=175> 96tod<A ID="sub:write_bintabh:tod"></A>(0:npix-1,1:ntod)</TD> 97<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>SP/ DP</TD> 98<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=40>IN</TD> 99<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=225>The map or tod 100 to write to the FITS file. It will be written in the file at the location 101 corresponding to pixels (or time samples) 102 <TT>firstpix</TT> to <TT>firtpix + npix</TT> -1.</TD> 103</TR> 104<TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=175>npix<A ID="sub:write_bintabh:npix"></A></TD> 105<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>I8B</TD> 106<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=40>IN</TD> 107<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=225>Number of pixels or time samples in the map or TOD. See Note below.</TD> 108</TR> 109<TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=175>ntod<A ID="sub:write_bintabh:ntod"></A></TD> 110<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>I4B</TD> 111<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=40>IN</TD> 112<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=225>Number of maps or tods to be written. Each of them will be in a different column of the FITS binary table.</TD> 113</TR> 114<TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=175>header<A ID="sub:write_bintabh:header"></A>(LEN=80) (1:nlheader)</TD> 115<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>CHR</TD> 116<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=40>IN</TD> 117<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=225>The header for the FITS file.</TD> 118</TR> 119<TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=175>nlheader<A ID="sub:write_bintabh:nlheader"></A></TD> 120<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>I4B</TD> 121<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=40>IN</TD> 122<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=225>number of header lines to write to the file.</TD> 123</TR> 124<TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=175>filename<A ID="sub:write_bintabh:filename"></A>(LEN=<tt>filenamelen</tt>)</TD> 125<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>CHR</TD> 126<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=40>IN</TD> 127<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=225>The array is written into a FITS file with this filename.</TD> 128</TR> 129<TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=175><i><font color="#224422">extno<A ID="sub:write_bintabh:extno"></A></font></i></TD> 130<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>I4B</TD> 131<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=40>IN</TD> 132<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=225>extension number in which to write the data (0 133 based). <b>default:</b>0</TD> 134</TR> 135<TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=175><i><font color="#224422">firstpix<A ID="sub:write_bintabh:firstpix"></A></font></i></TD> 136<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>I8B</TD> 137<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=40>IN</TD> 138<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=225>0 Location in the FITS file of the first 139 pixel (or time sample) to be written (0 based). <b>default:</b> 140 0. See Note below.</TD> 141</TR> 142<TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=175><i><font color="#224422">repeat<A ID="sub:write_bintabh:repeat"></A></font></i></TD> 143<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>I4B</TD> 144<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=40>IN</TD> 145<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=225>Length of the element vector used in the binary 146 table. <b>default:</b>1024 if <TT>npix</TT> <SPAN CLASS="MATH"><IMG STYLE="height: 1.57ex; vertical-align: -0.10ex; " SRC="sub_img198.png" 147 ALT="$\propto 1024$"></SPAN>; 12000 if 148 <TT>npix</TT> <SPAN CLASS="MATH">> 12000</SPAN> and 1 otherwise. <BR> 149Choosing a large <TT>repeat</TT> for multi-column tables (<TT>ntod</TT> <SPAN CLASS="MATH">>1</SPAN>) generally 150 speeds up the I/O. It also helps bringing the number of rows 151 of the table under <SPAN CLASS="MATH">2<SUP>31</SUP></SPAN>, which is a hard limit of 152 cfitsio. <BR> 153If the number of samples or pixels of each map or TOD is not a multiple of 154 <TT>repeat</TT>, then the last element vector will be padded with sentinel values 155<A HREF="sub_healpix_types_module.htm#sub:healpix_types:hpx_sbadval"><TT>HPX_SBADVAL</TT></A> or 156<A HREF="sub_healpix_types_module.htm#sub:healpix_types:hpx_dbadval"><TT>HPX_DBADVAL</TT></A>.</TD> 157</TR> 158</TABLE> 159<B>Note :</B> Indices and number of data elements larger than 160 <SPAN CLASS="MATH">2<SUP>31</SUP></SPAN> are only accessible in FITS files on computers with 64 bit 161 enabled compilers and with some specific compilation options of 162 cfitsio (see cfitsio documentation). 163 164 165<P> 166<HR><H1>EXAMPLE:</H1> 167<tt>use <A HREF="sub_healpix_types_module.htm#sub:healpix_types">healpix_types</A> 168<BR> 169use fitstools, only : <FONT COLOR="#CC0000">write_bintabh</FONT> 170<BR> 171character(len=80), dimension(1:128) :: hdr 172<BR> 173real(SP), dimension(0:49,1) :: tod 174<BR> 175character(len=<A HREF="sub_healpix_types_module.htm#sub:healpix_types:filenamelen">FILENAMELEN</A>) :: fname='tod.fits' 176<BR> 177hdr(:) = ' ' 178<BR> 179tod(:,1) = 1. 180<BR> 181call <FONT COLOR="#CC0000">write_bintabh</FONT>(tod, 50_i8b, 1, hdr, 128, fname, firstpix=0_i8b, repeat=10) 182<BR> 183tod = tod * 3. 184<BR> 185call <FONT COLOR="#CC0000">write_bintabh</FONT>(tod, 20_i8b, 1, hdr, 128, fname, firstpix=40_i8b)</tt> 186<blockquote> 187Writes into the FITS file `tod.fits' a 1 column binary table, where the first 40 188data samples have the value <SPAN CLASS="MATH">1.</SPAN> and the next 20 have the value <SPAN CLASS="MATH">3.</SPAN> (Note that 189in this example the 190second call to <FONT COLOR="#CC0000">write_bintabh</FONT> overwrites some of the pixels written by the first call). The samples will be 191written in element vectors of length 10. The header for the FITS file is given in the 192string array <TT>hdr</TT> and its number of lines is 128. 193</blockquote> 194 195<P> 196<hr><H1>MODULES & ROUTINES</H1><H3>This section lists the modules and routines used by <FONT COLOR="#CC0000">write_bintabh</FONT>.</h3> 197 <DL COMPACT><DT> 198<B><SPAN CLASS="textbf">fitstools</SPAN></B> 199<DD>module, containing: 200 <DT> 201<B>printerror</B> 202<DD>routine for printing FITS error messages. 203 <DT> 204<B><SPAN CLASS="textbf">cfitsio</SPAN></B> 205<DD>library for FITS file handling. 206 </DL> 207 208<P> 209<hr><H1>RELATED ROUTINES</H1><h3>This section lists the routines related to <b><FONT COLOR="#CC0000">write_bintabh</FONT></b></h3> 210 211 <DL COMPACT><DT> 212<B><A HREF="sub_input_tod.htm#sub:input_tod">input_tod*</A></B> 213<DD>routine that reads a file created by <FONT COLOR="#CC0000">write_bintabh</FONT>. 214 <DT> 215<B><A HREF="sub_input_map.htm#sub:input_map">input_map</A>, 216 <A HREF="sub_read_bintab.htm#sub:read_bintab">read_bintab</A></B> 217<DD>routines to read <b>HEALPix</b> sky map, 218 <DT> 219<B><A HREF="sub_write_minimal_header.htm#sub:write_minimal_header">write_minimal_header</A></B> 220<DD>routine to write minimal FITS header 221 </DL> 222 223<P> 224 225<P> 226 227 228<P> 229 230<P> 231 232<DIV CLASS="navigation"><HR> 233<!--Navigation Panel--> 234<A 235 HREF="sub_write_bintab.htm"> 236<IMG WIDTH="63" HEIGHT="24" ALT="previous" SRC="prev.png"></A> 237<A 238 HREF="sub_HEALPix_F90_subroutines.htm"> 239<IMG WIDTH="26" HEIGHT="24" ALT="up" SRC="up.png"></A> 240<A 241 HREF="sub_write_dbintab.htm"> 242<IMG WIDTH="37" HEIGHT="24" ALT="next" SRC="next.png"></A> 243<A ID="tex2html514" 244 HREF="sub_TABLE_CONTENTS.htm"> 245<IMG WIDTH="65" HEIGHT="24" ALT="contents" SRC="contents.png"></A> 246<BR> 247<B> Previous:</B> <A 248 HREF="sub_write_bintab.htm">write_bintab*</A> 249 250<B>Up:</B> <A 251 HREF="sub_HEALPix_F90_subroutines.htm">HEALPix/F90 subroutines</A> 252 253<B> Next:</B> <A 254 HREF="sub_write_dbintab.htm">write_dbintab</A> 255<B> Top:</B> <a href="main.htm">Main Page</a></DIV> 256<!--End of Navigation Panel--> 257<ADDRESS> 258Version 3.50, 2018-12-10 259</ADDRESS> 260</BODY> 261</HTML> 262