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>ud_grade</TITLE>
7<META NAME="description" CONTENT="ud_grade">
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_unfold_weights.htm">
29<LINK REL="previous" HREF="idl_template_pixel_nest_templat.htm">
30<LINK REL="next" HREF="idl_unfold_weights.htm">
31</HEAD>
32
33<body text="#000000" bgcolor="#FFFFFA">
34
35<DIV CLASS="navigation"><!--Navigation Panel-->
36<A
37 HREF="idl_template_pixel_nest_templat.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_unfold_weights.htm">
44<IMG WIDTH="37" HEIGHT="24" ALT="next" SRC="next.png"></A>
45<A ID="tex2html413"
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_template_pixel_nest_templat.htm">template_pixel_nest &amp; template_pixel_ring</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_unfold_weights.htm">unfold_weights</A>
57<B> Top:</B> <a href="main.htm">Main Page</a></DIV>
58<!--End of Navigation Panel-->
59
60<H1><A ID="SECTION7000"></A>
61<A ID="idl:ud_grade"></A>
62<BR>
63
64</H1>
65
66<P>
67<b><font size=+6><FONT COLOR="#CC0000">ud_grade</FONT></font></b><hr>
68<H3>This IDL facility provides a means to upgrade/degrade or reorder a full
69sky or cut-sky <b>HEALPix</b> map contained in a FITS file or loaded in memory.
70</H3>
71Location in HEALPix directory tree: <a href="https://sourceforge.net/p/healpix/code/1005/tree/trunk/src/idl/toolkit/ud_grade.pro"><b>src/idl/toolkit/ud_grade.pro</b></a>&nbsp;
72
73<P>
74<hr><h1>FORMAT </h1><h3>IDL>
75UD_GRADE,
76<A HREF="#idl:ud_grade:map_in">Map_in</A>,
77<A HREF="#idl:ud_grade:map_out">Map_out</A> [,
78<A HREF="#idl:ud_grade:bad_data">BAD_DATA</A>=,
79<A HREF="#idl:ud_grade:help">HELP</A>=,
80<A HREF="#idl:ud_grade:nside_out">NSIDE_OUT</A>=,
81<A HREF="#idl:ud_grade:order_in">ORDER_IN</A>=,
82<A HREF="#idl:ud_grade:order_out">ORDER_OUT</A>=,
83<A HREF="#idl:ud_grade:pessimistic">/PESSIMISTIC</A>]
84</h3>
85
86<P>
87<hr>
88<H1>QUALIFIERS</H1>
89
90  <DL COMPACT><DT>
91<B>Map_in</B>
92<DD><A ID="idl:ud_grade:map_in"></A> input map: either a character
93string with the name of a FITS file containing a full-sky or cut-sky Healpix
94data set,
95      or a memory vector (real, integer, ...) containing a <EM>full sky</EM> data
96      set.
97    <DT>
98<B>Map_out</B>
99<DD><A ID="idl:ud_grade:map_out"></A> reordered map: if map_in was a filename, map_out should be
100    a filename, otherwise map_out should point to a memory array
101  </DL>
102
103<P>
104<hr><H1>KEYWORDS</H1>
105
106  <DL COMPACT><DT>
107<B>BAD_DATA =</B>
108<DD><A ID="idl:ud_grade:bad_data"></A>flag value of missing pixels.
109          <b>default:</b><TT>!healpix.bad_value</TT> <!-- MATH
110 $\equiv -1.6375\ 10^{30}$
111 -->
112<SPAN CLASS="MATH"><IMG STYLE="height: 1.92ex; vertical-align: -0.29ex; " SRC="idl_img105.png"
113 ALT="$\equiv -1.6375\ 10^{30}$"></SPAN>.
114    <DT>
115<B>/HELP</B>
116<DD><A ID="idl:ud_grade:help"></A>if set, the documentation header is printed out and the code exits
117    <DT>
118<B>NSIDE_OUT =</B>
119<DD><A ID="idl:ud_grade:nside_out"></A>output resolution parameter, can be
120    larger or smaller than the input one (scalar integer).
121	 <b>default:</b>same as input: map unchanged or simply reordered
122    <DT>
123<B>ORDER_IN =</B>
124<DD><A ID="idl:ud_grade:order_in"></A>input map ordering (either 'RING' or 'NESTED')
125	<b>default:</b>same as the input FITS keyword ORDERING if applicable.
126    <DT>
127<B>ORDER_OUT =</B>
128<DD><A ID="idl:ud_grade:order_out"></A>output map ordering (either 'RING' or 'NESTED')
129	<b>default:</b>same as ORDER_IN.
130    <DT>
131<B>/PESSIMISTIC</B>
132<DD><A ID="idl:ud_grade:pessimistic"></A><IMG STYLE="height: 21.86ex; vertical-align: -10.43ex; " SRC="idl_img117.png"
133 ALT="$\textstyle \parbox{0.5\hsize}{if set, during {\bf degradation} each big pixel c...
134...ast one good pixel
135is considered as good (optimistic)
136default = 0 (:not set)}$"></DL>
137
138<P>
139<hr>
140<H1>DESCRIPTION</H1>
141<blockquote>
142ud_grade can upgrade/degrade a <b>HEALPix</b> map using the hierarchical
143properties of <b>HEALPix</b> . It can also reorder a sky map (from NEST to RING and
144vice-versa). It operates on FITS files as well as on memory variables. Cut-sky
145operations are only accessible via FITS files.
146The degradation/upgradation is done assuming an
147intensive quantity (like temperature) that does not scale with surface area.
148In case of degradation a big pixel that contains at least one bad small pixel is
149considered as bad itself. When operating on FITS files, the header information
150from the input file that is not directly related the ordering/resolution is
151copied unchanged into the output file.
152</blockquote>
153
154<P>
155<hr><H1>RELATED ROUTINES</H1><h3>This section lists the routines related to <b><FONT COLOR="#CC0000">ud_grade</FONT></b></h3>
156
157  <DL COMPACT><DT>
158<B>idl</B>
159<DD>version 6.4 or more is necessary to run ud_grade.
160    <DT>
161<B><A HREF="idl_reorder.htm#idl:reorder">reorder</A></B>
162<DD>reorder a full sky Healpix map.
163  </DL>
164
165<P>
166<hr><H1>EXAMPLE # 1:</H1>
167<tt><TABLE CELLPADDING=3>
168<TR><TD ALIGN="LEFT">ud_grade,  'map_512.fits', 'map_256.fits', nside_out = 256</TD>
169</TR>
170</TABLE></tt>
171<blockquote>
172ud_grade reads the FITS file map_512.fits (that allegedly contains a map with
173NSIDE=512), and write in the FITS file map_256.fits a map degraded to resolution 256, with
174the same ordering.
175</blockquote>
176<hr><H1>EXAMPLE # 2:</H1>
177<tt><TABLE CELLPADDING=3>
178<TR><TD ALIGN="LEFT">ud_grade,  'map_512.fits', 'map_Nest256.fits', nside_out = 256, $</TD>
179</TR>
180<TR><TD ALIGN="LEFT">order_out = 'NESTED'</TD>
181</TR>
182</TABLE></tt>
183<blockquote>
184ud_grade reads the FITS file map_512.fits (that allegedly contains a map with
185NSIDE=512),
186and writes in the FITS file map_Nest256.fits a map degraded to resolution 256,
187with NESTED ordering.
188</blockquote>
189<hr><H1>EXAMPLE # 3:</H1>
190<tt><TABLE CELLPADDING=3>
191<TR><TD ALIGN="LEFT"><A HREF="idl_read_fits_map.htm#idl:read_fits_map">read_fits_map</A>, 'map_Nest256.fits', mymap</TD>
192</TR>
193<TR><TD ALIGN="LEFT">ud_grade,  mymap, mymap2, nside_out = 1024, order_in='NESTED', order_out='RING'</TD>
194</TR>
195</TABLE></tt>
196<blockquote>
197mymap is IDL variable containing a <b>HEALPix</b> NESTED-ordered map with resolution nside=256.
198ud_grade upgrades this map to a resolution of 1024, reorder it to RING and write
199it in the IDL vector mymap2.
200</blockquote>
201
202<P>
203
204<P>
205
206<P>
207
208<P>
209
210<DIV CLASS="navigation"><HR>
211<!--Navigation Panel-->
212<A
213 HREF="idl_template_pixel_nest_templat.htm">
214<IMG WIDTH="63" HEIGHT="24" ALT="previous" SRC="prev.png"></A>
215<A
216 HREF="idl_HEALPix_IDL_subroutines.htm">
217<IMG WIDTH="26" HEIGHT="24" ALT="up" SRC="up.png"></A>
218<A
219 HREF="idl_unfold_weights.htm">
220<IMG WIDTH="37" HEIGHT="24" ALT="next" SRC="next.png"></A>
221<A ID="tex2html413"
222  HREF="idl_TABLE_CONTENTS.htm">
223<IMG WIDTH="65" HEIGHT="24" ALT="contents" SRC="contents.png"></A>
224<BR>
225<B> Previous:</B> <A
226 HREF="idl_template_pixel_nest_templat.htm">template_pixel_nest &amp; template_pixel_ring</A>
227
228<B>Up:</B> <A
229 HREF="idl_HEALPix_IDL_subroutines.htm">HEALPix/IDL subroutines</A>
230
231<B> Next:</B> <A
232 HREF="idl_unfold_weights.htm">unfold_weights</A>
233<B> Top:</B> <a href="main.htm">Main Page</a></DIV>
234<!--End of Navigation Panel-->
235<ADDRESS>
236Version 3.50, 2018-12-10
237</ADDRESS>
238</BODY>
239</HTML>
240