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>fits2cl*</TITLE> 7<META NAME="description" CONTENT="fits2cl*"> 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_gaussbeam.htm"> 29<LINK REL="previous" HREF="sub_fits2alms.htm"> 30<LINK REL="next" HREF="sub_gaussbeam.htm"> 31</HEAD> 32 33<body text="#000000" bgcolor="#FFFFFA"> 34 35<DIV CLASS="navigation"><!--Navigation Panel--> 36<A 37 HREF="sub_fits2alms.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_gaussbeam.htm"> 44<IMG WIDTH="37" HEIGHT="24" ALT="next" SRC="next.png"></A> 45<A ID="tex2html354" 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_fits2alms.htm">fits2alms*</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_gaussbeam.htm">gaussbeam</A> 57<B> Top:</B> <a href="main.htm">Main Page</a></DIV> 58<!--End of Navigation Panel--> 59 60<H1><A ID="SECTION3100"></A> 61<A ID="sub:fits2cl"></A> 62<BR> 63 64</H1> 65 66<P> 67<b><font size=+6><FONT COLOR="#CC0000">fits2cl*</FONT></font></b><hr> 68<H3>This routine reads a power spectrum or beam window function from a FITS ASCII 69or binary table. 70The routine can read temperature coefficients <SPAN CLASS="MATH"><IMG STYLE="height: 2.51ex; vertical-align: -0.67ex; " SRC="sub_img106.png" 71 ALT="$C_\ell^{TT}$"></SPAN> or both temperature and 72polarisation coefficients <SPAN CLASS="MATH"><IMG STYLE="height: 2.51ex; vertical-align: -0.67ex; " SRC="sub_img106.png" 73 ALT="$C_\ell^{TT}$"></SPAN>, <SPAN CLASS="MATH"><IMG STYLE="height: 2.51ex; vertical-align: -0.67ex; " SRC="sub_img107.png" 74 ALT="$C_\ell^{EE}$"></SPAN>, <SPAN CLASS="MATH"><IMG STYLE="height: 2.51ex; vertical-align: -0.67ex; " SRC="sub_img108.png" 75 ALT="$C_\ell^{BB}$"></SPAN>, <SPAN CLASS="MATH"><IMG STYLE="height: 2.51ex; vertical-align: -0.67ex; " SRC="sub_img109.png" 76 ALT="$C_\ell^{TE}$"></SPAN> (and 77<SPAN CLASS="MATH"><IMG STYLE="height: 2.51ex; vertical-align: -0.67ex; " SRC="sub_img110.png" 78 ALT="$C_\ell^{TB}$"></SPAN>, 79<SPAN CLASS="MATH"><IMG STYLE="height: 2.51ex; vertical-align: -0.67ex; " SRC="sub_img111.png" 80 ALT="$C_\ell^{EB}$"></SPAN>, 81<SPAN CLASS="MATH"><IMG STYLE="height: 2.51ex; vertical-align: -0.67ex; " SRC="sub_img112.png" 82 ALT="$C_\ell^{ET}$"></SPAN>, 83<SPAN CLASS="MATH"><IMG STYLE="height: 2.51ex; vertical-align: -0.67ex; " SRC="sub_img113.png" 84 ALT="$C_\ell^{BT}$"></SPAN>, 85<SPAN CLASS="MATH"><IMG STYLE="height: 2.51ex; vertical-align: -0.67ex; " SRC="sub_img114.png" 86 ALT="$C_\ell^{BE}$"></SPAN> when applicable). If the 87keyword PDMTYPE is found in the header, fits2cl assumes the table to be in the 88special format used by <EM>Planck</EM> and will ignore the first data column. 89If the input FITS file contains several 90extensions or HDUs, the one to be read can be specified thanks to the CFITSIO 91<A ID="tex2html19" 92 HREF="https://heasarc.gsfc.nasa.gov/docs/software/fitsio/c/c_user/node81.html">Extended File Name Syntax</A>, using its number (eg, <TT>file.fits[2]</TT> or <TT>file.fits+2</TT>) or its 93<TT>EXTNAME</TT> value (eg. <TT>file.fits[beam_100x100]</TT>). By default, only the first valid 94extension will be read.</H3> 95Location 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> 96 97<P> 98<hr><h1>FORMAT </h1><blockquote><h3>call <FONT COLOR="#CC0000">fits2cl*</FONT>( 99<A HREF="#sub:fits2cl:filename">filename</A>, <A HREF="#sub:fits2cl:clin">clin</A>, <A HREF="#sub:fits2cl:lmax">lmax</A>, <A HREF="#sub:fits2cl:ncl">ncl</A>, <A HREF="#sub:fits2cl:header">header</A>, [<A HREF="#sub:fits2cl:units">units</A>] 100)</h3></blockquote> 101 102<P> 103<hr><H1>ARGUMENTS</H1> 104 105<TABLE CELLPADDING=3 BORDER="1"> 106<TR><TH ALIGN="LEFT" VALIGN="TOP" WIDTH=200><SPAN CLASS="textbf">name & dimensionality</SPAN></TH> 107<TH ALIGN="LEFT" VALIGN="TOP" WIDTH=25><SPAN CLASS="textbf">kind</SPAN></TH> 108<TH ALIGN="LEFT" VALIGN="TOP" WIDTH=50><SPAN CLASS="textbf">in/out</SPAN></TH> 109<TH ALIGN="LEFT" VALIGN="TOP" WIDTH=175><SPAN CLASS="textbf">description</SPAN></TH> 110</TR> 111<TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=200> </TD> 112<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25> </TD> 113<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=50> </TD> 114<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=175> </TD> 115</TR> 116<TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=200> 117filename<A ID="sub:fits2cl:filename"></A>(LEN=<tt>filenamelen</tt>)</TD> 118<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>CHR</TD> 119<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=50>IN</TD> 120<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=175>the FITS file containing the power spectrum.</TD> 121</TR> 122<TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=200>lmax<A ID="sub:fits2cl:lmax"></A></TD> 123<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>I4B</TD> 124<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=50>IN</TD> 125<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=175>Maximum <SPAN CLASS="MATH"><IMG STYLE="height: 1.69ex; vertical-align: -0.10ex; " SRC="sub_img21.png" 126 ALT="$\ell$"></SPAN> value to be read.</TD> 127</TR> 128<TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=200>ncl<A ID="sub:fits2cl:ncl"></A></TD> 129<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>I4B</TD> 130<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=50>IN</TD> 131<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=175>1 for temperature coeffecients only, 4 for polarisation.</TD> 132</TR> 133<TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=200>clin<A ID="sub:fits2cl:clin"></A>(0:lmax,1:ncl)</TD> 134<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>SP/ DP</TD> 135<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=50>OUT</TD> 136<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=175>the power spectrum read from the file.</TD> 137</TR> 138<TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=200>header<A ID="sub:fits2cl:header"></A>(LEN=80) (1:)</TD> 139<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>CHR</TD> 140<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=50>OUT</TD> 141<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=175>the header read from the FITS-file.</TD> 142</TR> 143<TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=200>units<A ID="sub:fits2cl:units"></A>(LEN=80) (1:)</TD> 144<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>CHR</TD> 145<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=50>OUT</TD> 146<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=175>the column units read from the FITS-file.</TD> 147</TR> 148</TABLE> 149 150<P> 151<HR><H1>EXAMPLE:</H1> 152<tt>use <A HREF="sub_healpix_modules_module.htm#sub:healpix_modules">healpix_modules</A> 153<BR> 154real(<A HREF="sub_healpix_types_module.htm#sub:healpix_types:sp">SP</A>), allocatable, dimension(:,:) :: cl 155<BR> 156character(len=80), dimension(1:300) :: header 157<BR> 158character(len=80), dimension(1:100) :: units 159<BR> 160integer(<A HREF="sub_healpix_types_module.htm#sub:healpix_types:i4b">I4B</A>) :: lmax, ncl, np 161<BR> 162character(len=<A HREF="sub_healpix_types_module.htm#sub:healpix_types:filenamelen">filenamelen</A>) :: fitsfile='cl.fits' 163<BR> 164np = <A HREF="sub_getsize_fits.htm#sub:getsize_fits">getsize_fits</A>(fitsfile, nmaps=ncl, mlpol=lmax) 165<BR> 166allocate(cl(0:lmax, 1:ncl)) 167<BR> 168call fits2cl(fitsfile, cl, lmax, ncl, header, units) 169<BR></tt> 170<blockquote> 171Reads a power spectrum from the FITS file <TT>`cl.fits'</TT> and stores the result in 172<TT><A HREF="#sub:fits2cl:clin">cl</A>(0:lmax,1:ncl)</TT> 173which are the <A HREF="#sub:fits2cl:ncl"><TT>ncl</TT></A> <SPAN CLASS="MATH"><IMG STYLE="height: 2.04ex; vertical-align: -0.45ex; " SRC="sub_img105.png" 174 ALT="$C_\ell$"></SPAN> coefficients up to 175<SPAN CLASS="MATH"><IMG STYLE="height: 1.69ex; vertical-align: -0.10ex; " SRC="sub_img115.png" 176 ALT="$\ell=$"></SPAN><A HREF="#sub:fits2cl:lmax"><TT>lmax</TT></A>. 177The FITS header is returned in <A HREF="#sub:fits2cl:header"><TT>header</TT></A>, 178the column units in <A HREF="#sub:fits2cl:units"><TT>units</TT></A>. 179</blockquote> 180<hr><H1>MODULES & ROUTINES</H1><H3>This section lists the modules and routines used by <FONT COLOR="#CC0000">fits2cl*</FONT>.</h3> 181 <DL COMPACT><DT> 182<B><SPAN CLASS="textbf">fitstools</SPAN></B> 183<DD>module, containing: 184 <DT> 185<B>printerror</B> 186<DD>routine for printing FITS error messages. 187 <DT> 188<B><SPAN CLASS="textbf">cfitsio</SPAN></B> 189<DD>library for FITS file handling. 190 </DL> 191 192<P> 193<hr><H1>RELATED ROUTINES</H1><h3>This section lists the routines related to <b><FONT COLOR="#CC0000">fits2cl*</FONT></b></h3> 194 195 <DL COMPACT><DT> 196<B><A HREF="sub_create_alm.htm#sub:create_alm">create_alm</A></B> 197<DD>Routine to create <SPAN CLASS="MATH"><IMG STYLE="height: 1.46ex; vertical-align: -0.45ex; " SRC="sub_img6.png" 198 ALT="$a_{\ell m}$"></SPAN> values 199 from an input power spectrum. 200 <DT> 201<B><A HREF="sub_write_asctab.htm#sub:write_asctab">write_asctab</A></B> 202<DD>Routine to create an ascii 203 FITS file containing a power spectrum. 204 <DT> 205<B><A HREF="sub_getsize_fits.htm#sub:getsize_fits">getsize_fits</A></B> 206<DD>Routine to parse FITS file header, and determine the data storage features. 207<DT> 208<B><A HREF="sub_getnumext_fits.htm#sub:getnumext_fits">getnumext_fits</A></B> 209<DD>Routine to determine number of extensions of a FITS file. 210 </DL> 211 212<P> 213 214<P> 215 216 217<P> 218 219<P> 220 221<DIV CLASS="navigation"><HR> 222<!--Navigation Panel--> 223<A 224 HREF="sub_fits2alms.htm"> 225<IMG WIDTH="63" HEIGHT="24" ALT="previous" SRC="prev.png"></A> 226<A 227 HREF="sub_HEALPix_F90_subroutines.htm"> 228<IMG WIDTH="26" HEIGHT="24" ALT="up" SRC="up.png"></A> 229<A 230 HREF="sub_gaussbeam.htm"> 231<IMG WIDTH="37" HEIGHT="24" ALT="next" SRC="next.png"></A> 232<A ID="tex2html354" 233 HREF="sub_TABLE_CONTENTS.htm"> 234<IMG WIDTH="65" HEIGHT="24" ALT="contents" SRC="contents.png"></A> 235<BR> 236<B> Previous:</B> <A 237 HREF="sub_fits2alms.htm">fits2alms*</A> 238 239<B>Up:</B> <A 240 HREF="sub_HEALPix_F90_subroutines.htm">HEALPix/F90 subroutines</A> 241 242<B> Next:</B> <A 243 HREF="sub_gaussbeam.htm">gaussbeam</A> 244<B> Top:</B> <a href="main.htm">Main Page</a></DIV> 245<!--End of Navigation Panel--> 246<ADDRESS> 247Version 3.50, 2018-12-10 248</ADDRESS> 249</BODY> 250</HTML> 251