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_fits_cut4 </TITLE>
7<META NAME="description" CONTENT="write_fits_cut4 ">
8<META NAME="keywords" CONTENT="idl">
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="idl.css">
27
28<LINK REL="next" HREF="idl_write_fits_map.htm">
29<LINK REL="previous" HREF="idl_vec2ang.htm">
30<LINK REL="next" HREF="idl_write_fits_map.htm">
31</HEAD>
32
33<body text="#000000" bgcolor="#FFFFFA">
34
35<DIV CLASS="navigation"><!--Navigation Panel-->
36<A
37 HREF="idl_vec2ang.htm">
38<IMG WIDTH="63" HEIGHT="24" ALT="previous" SRC="prev.png"></A>
39<A
40 HREF="idl_HEALPix_IDL_subroutines.htm">
41<IMG WIDTH="26" HEIGHT="24" ALT="up" SRC="up.png"></A>
42<A
43 HREF="idl_write_fits_map.htm">
44<IMG WIDTH="37" HEIGHT="24" ALT="next" SRC="next.png"></A>
45<A ID="tex2html421"
46  HREF="idl_TABLE_CONTENTS.htm">
47<IMG WIDTH="65" HEIGHT="24" ALT="contents" SRC="contents.png"></A>
48<BR>
49<B> Previous:</B> <A
50 HREF="idl_vec2ang.htm">vec2ang</A>
51
52<B>Up:</B> <A
53 HREF="idl_HEALPix_IDL_subroutines.htm">HEALPix/IDL subroutines</A>
54
55<B> Next:</B> <A
56 HREF="idl_write_fits_map.htm">write_fits_map</A>
57<B> Top:</B> <a href="main.htm">Main Page</a></DIV>
58<!--End of Navigation Panel-->
59
60<H1><A ID="SECTION7400"></A>
61<A ID="idl:write_fits_cut4"></A>
62<BR>
63
64</H1>
65
66<P>
67<b><font size=+6><FONT COLOR="#CC0000">write_fits_cut4 </FONT></font></b><hr>
68<H3>This IDL facility writes out a cut sky <b>HEALPix</b> map into a FITS file according to
69the <b>HEALPix</b> convention. The format used for the
70FITS file follows the one used for Boomerang98 and is adapted from
71COBE/DMR. This routine can be used to store polarized maps, where the
72information relative to the Stokes parameters I, Q and U are placed in extension
730, 1 and 2 respectively by successive invocation of the routine.</H3>
74Location in HEALPix directory tree: <a href="https://sourceforge.net/p/healpix/code/1005/tree/trunk/src/idl/fits/write_fits_cut4.pro"><b>src/idl/fits/write_fits_cut4.pro</b></a>&nbsp;
75
76<P>
77<hr><h1>FORMAT </h1><h3>IDL>
78WRITE_FITS_CUT4 , <A HREF="#idl:write_fits_cut4:File">File</A>, <A HREF="#idl:write_fits_cut4:Pixel">Pixel</A>, <A HREF="#idl:write_fits_cut4:Signal">Signal</A>[, <A HREF="#idl:write_fits_cut4:N_Obs">N_Obs</A>, <A HREF="#idl:write_fits_cut4:Serror">Serror</A>,
79<A HREF="#idl:write_fits_cut4:COORDSYS">COORDSYS=</A>,
80<A HREF="#idl:write_fits_cut4:EXTENSION">EXTENSION=</A>,
81<A HREF="#idl:write_fits_cut4:HDR">HDR=</A>,
82<A HREF="#idl:write_fits_cut4:NESTED">/NESTED</A>,
83<A HREF="#idl:write_fits_cut4:NSIDE">NSIDE=</A>,
84<A HREF="#idl:write_fits_cut4:ORDERING">ORDERING=</A>,
85<A HREF="#idl:write_fits_cut4:POLARISATION">/POLARISATION</A>,
86<A HREF="#idl:write_fits_cut4:RING">/RING</A>,
87<A HREF="#idl:write_fits_cut4:UNITS">UNITS=</A>,
88<A HREF="#idl:write_fits_cut4:XHDR">XHDR=</A>,
89<A HREF="#idl:write_fits_cut4:HELP">HELP=</A>]
90
91</h3>
92
93<P>
94<hr>
95<H1>QUALIFIERS</H1>
96
97  <DL COMPACT><DT>
98<B>File</B>
99<DD><A ID="idl:write_fits_cut4:File"></A>          name of a FITS file in which the map is to be written
100
101<P>
102<DT>
103<B>Pixel</B>
104<DD><A ID="idl:write_fits_cut4:Pixel"></A>	 (LONG or LONG64 vector),
105<BR>
106index of observed (or valid) pixels
107
108<P>
109<DT>
110<B>Signal</B>
111<DD><A ID="idl:write_fits_cut4:Signal"></A>	 (FLOAT or DOUBLE vector, same size as Pixel),
112<BR>
113value of signal in each observed pixel
114
115<P>
116<DT>
117<B>N_Obs</B>
118<DD><A ID="idl:write_fits_cut4:N_Obs"></A>	 (LONG or INT or LONG64 vector, Optional, same size as Pixel),
119<BR>
120number of
121	 observation per pixel.
122<BR>
123If absent, the field <TT>N_OBS</TT> will take a value of 1 in the output file.
124         If set to a scalar constant, <TT>N_OBS</TT> will take this value in the
125	 output file
126
127<P>
128<DT>
129<B>Serror</B>
130<DD><A ID="idl:write_fits_cut4:Serror"></A>	 (FLOAT or DOUBLE vector, Optional, same size as Pixel)
131<BR><EM>rms</EM> of signal in pixel, for white noise,
132                   this is <!-- MATH
133 $\propto 1/\sqrt{{\rm n\_obs}}$
134 -->
135<SPAN CLASS="MATH"><IMG STYLE="height: 2.51ex; vertical-align: -0.68ex; " SRC="idl_img102.png"
136 ALT="$\propto 1/\sqrt{{\rm n\_obs}}$"></SPAN>
137<BR>
138If absent, the field <TT>SERROR</TT> will take a value of 0.0 in the output file.
139         If set to a scalar constant, <TT>SERROR</TT> will take this value in the
140	 output file
141
142<P>
143</DL>
144
145<P>
146<hr><H1>KEYWORDS</H1>
147
148  <DL COMPACT><DT>
149<B>COORDSYS=</B>
150<DD><A ID="idl:write_fits_cut4:COORDSYS"></A>		  (optional),
151<BR>
152if set to either 'C', 'E' or 'G',  specifies that the
153		Healpix coordinate system is respectively Celestial=equatorial,
154		  Ecliptic or Galactic.
155		(The relevant keyword is then added/updated in the extension
156		  header, but the map is NOT rotated)
157
158<P>
159<DT>
160<B>EXTENSION=</B>
161<DD><A ID="idl:write_fits_cut4:EXTENSION"></A>		  (optional),
162<BR>	  (0 based) extension number in which to write data. <b>default:</b>0.
163	  If set to 0 (or not set) <EM>a new file is written from scratch</EM>.
164	  If set to a value
165		  larger than 1, the corresponding extension is added or
166		  updated, as long as all previous extensions already exist.
167		  All extensions of the same file should use the same ORDERING,
168		  NSIDE and COORDSYS.
169
170<P>
171<DT>
172<B>HDR=</B>
173<DD><A ID="idl:write_fits_cut4:HDR"></A>(optional),
174<BR>
175String array containing the information to be put in
176		the primary header.
177
178<P>
179<DT>
180<B>/NESTED</B>
181<DD><A ID="idl:write_fits_cut4:NESTED"></A>(optional)
182         if set, specifies that the map is in the NESTED ordering
183	scheme
184<BR>	<i>see also:</i>Ordering and Ring
185
186<P>
187<DT>
188<B>NSIDE=</B>
189<DD><A ID="idl:write_fits_cut4:NSIDE"></A>		(optional),
190<BR>
191scalar integer, <b>HEALPix</b> resolution parameter of the
192		data set. The resolution parameter should be made
193		available to the FITS file, either thru this
194		qualifier, or via the header (see XHDR).
195
196<P>
197<DT>
198<B>ORDERING=</B>
199<DD><A ID="idl:write_fits_cut4:ORDERING"></A>		  (optional),
200<BR>
201if set to either 'ring' or 'nested' (case un-sensitive),
202		  specifies that the map is respectively in RING or NESTED
203		  ordering scheme
204<BR>		<i>see also:</i>Nested and Ring
205<BR>
206The ordering information should be made
207		available to the FITS file, either thru a combination
208		  of Ordering/Ring/Nested, or via the header (see XHDR).
209
210<P>
211<DT>
212<B>/POLARISATION</B>
213<DD><A ID="idl:write_fits_cut4:POLARISATION"></A>	  specifies that file will contain the I, Q and U polarisation
214           Stokes parameter in extensions 0, 1 and 2 respectively, and sets the
215FITS header keywords accordingly
216
217<P>
218<DT>
219<B>/RING</B>
220<DD><A ID="idl:write_fits_cut4:RING"></A> if set, specifies that the map is in the RING ordering
221	scheme
222<BR>	<i>see also:</i>Ordering and Nested
223
224<P>
225<DT>
226<B>UNITS=</B>
227<DD><A ID="idl:write_fits_cut4:UNITS"></A>		(optional),
228<BR>
229string describing the physical units of the data set (only applies
230		to Signal and Serror)
231
232<P>
233<DT>
234<B>XHDR=</B>
235<DD><A ID="idl:write_fits_cut4:XHDR"></A>(optional),
236<BR>
237String array containing the information to be put in
238		the extension header.
239
240<P>
241<DT>
242<B>HELP=</B>
243<DD><A ID="idl:write_fits_cut4:HELP"></A>(optional),
244<BR>
245if set, an extensive help is displayed, and no file is written
246
247<P>
248</DL>
249
250<P>
251<hr>
252<H1>DESCRIPTION</H1>
253<blockquote>
254<br><br></blockquote>
255
256<P>
257<hr><H1>RELATED ROUTINES</H1><h3>This section lists the routines related to <b><FONT COLOR="#CC0000">write_fits_cut4 </FONT></b></h3>
258
259  <DL COMPACT><DT>
260<B>idl</B>
261<DD>version 6.4 or more is necessary to run <FONT COLOR="#CC0000">write_fits_cut4 </FONT>
262  <DT>
263<B><A HREF="idl_read_fits_cut4.htm#idl:read_fits_cut4">read_fits_cut4</A></B>
264<DD>This <b>HEALPix</b> IDL facility can be used to read in maps
265  written by <FONT COLOR="#CC0000">write_fits_cut4 </FONT>.
266  <DT>
267<B><A HREF="#idl:write_fits_cut4">write_fits_cut4</A>,
268<A HREF="idl_write_fits_map.htm#idl:write_fits_map">write_fits_map</A></B>
269<DD><DT>
270<B><A HREF="idl_write_tqu.htm#idl:write_tqu">write_tqu</A>,
271<A HREF="idl_write_fits_sb.htm#idl:write_fits_sb">write_fits_sb</A></B>
272<DD><b>HEALPix</b> IDL routines to write cut-sky maps, full-sky maps, polarized full-sky maps and
273arbitrary data sets into FITS files
274  <DT>
275<B>sxaddpar</B>
276<DD>This IDL routine (included in <b>HEALPix</b> package) can be used to update
277  or add FITS keywords to the header in <TT>HDR</TT> and <TT>XHDR</TT>
278  </DL>
279
280<P>
281<hr><H1>EXAMPLE # 1:</H1>
282<tt><TABLE CELLPADDING=3>
283<TR><TD ALIGN="LEFT"><FONT COLOR="#CC0000">write_fits_cut4 </FONT>, 'map_cut.fits', pixel, temperature, /ring,nside=32, /pol</TD>
284<TD ALIGN="LEFT">&nbsp;</TD>
285</TR>
286</TABLE></tt>
287<blockquote>writes in 'map_cut.fits' a FITS file containing the temperature measured in a
288  set of <b>HEALPix</b> pixel.
289</blockquote>
290<hr><H1>EXAMPLE # 2:</H1>
291<tt><TABLE CELLPADDING=3>
292<TR><TD ALIGN="LEFT"><FONT COLOR="#CC0000">write_fits_cut4 </FONT>,  'tqu_cut.fits', pixel, temperature, n_t, s_t, $</TD>
293</TR>
294<TR><TD ALIGN="LEFT">/ring, nside=32, /pol</TD>
295</TR>
296<TR><TD ALIGN="LEFT"><FONT COLOR="#CC0000">write_fits_cut4 </FONT>,  'tqu_cut.fits', pixel, qstokes, n_q, s_q, $</TD>
297</TR>
298<TR><TD ALIGN="LEFT">/ring, nside=32, /pol, ext=1</TD>
299</TR>
300<TR><TD ALIGN="LEFT"><FONT COLOR="#CC0000">write_fits_cut4 </FONT>,  'tqu_cut.fits', pixel, ustokes, n_u, s_u, $</TD>
301</TR>
302<TR><TD ALIGN="LEFT">/ring, nside=32, /pol, ext=2</TD>
303</TR>
304</TABLE></tt>
305<blockquote>writes in 'tqu_cut.fits' a FITS file with three extensions, each of them containing
306information on the observed pixel, the measured signal, the number of
307observations and noise per pixel, for the three Stokes parameters I, Q and U
308respectively. The <b>HEALPix</b> ring ordered scheme and the resolution <!-- MATH
309 $N_{\mathrm{side}}=32$
310 -->
311<SPAN CLASS="MATH"><I>N</I><SUB>side</SUB>=32</SPAN> is assumed.
312</blockquote>
313
314<P>
315
316<P>
317
318<DIV CLASS="navigation"><HR>
319<!--Navigation Panel-->
320<A
321 HREF="idl_vec2ang.htm">
322<IMG WIDTH="63" HEIGHT="24" ALT="previous" SRC="prev.png"></A>
323<A
324 HREF="idl_HEALPix_IDL_subroutines.htm">
325<IMG WIDTH="26" HEIGHT="24" ALT="up" SRC="up.png"></A>
326<A
327 HREF="idl_write_fits_map.htm">
328<IMG WIDTH="37" HEIGHT="24" ALT="next" SRC="next.png"></A>
329<A ID="tex2html421"
330  HREF="idl_TABLE_CONTENTS.htm">
331<IMG WIDTH="65" HEIGHT="24" ALT="contents" SRC="contents.png"></A>
332<BR>
333<B> Previous:</B> <A
334 HREF="idl_vec2ang.htm">vec2ang</A>
335
336<B>Up:</B> <A
337 HREF="idl_HEALPix_IDL_subroutines.htm">HEALPix/IDL subroutines</A>
338
339<B> Next:</B> <A
340 HREF="idl_write_fits_map.htm">write_fits_map</A>
341<B> Top:</B> <a href="main.htm">Main Page</a></DIV>
342<!--End of Navigation Panel-->
343<ADDRESS>
344Version 3.50, 2018-12-10
345</ADDRESS>
346</BODY>
347</HTML>
348