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>apply_mask</TITLE> 7<META NAME="description" CONTENT="apply_mask"> 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_assert_assert_alloc_assert_.htm"> 29<LINK REL="previous" HREF="sub_angdist.htm"> 30<LINK REL="next" HREF="sub_assert_assert_alloc_assert_.htm"> 31</HEAD> 32 33<body text="#000000" bgcolor="#FFFFFA"> 34 35<DIV CLASS="navigation"><!--Navigation Panel--> 36<A 37 HREF="sub_angdist.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_assert_assert_alloc_assert_.htm"> 44<IMG WIDTH="37" HEIGHT="24" ALT="next" SRC="next.png"></A> 45<A ID="tex2html322" 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_angdist.htm">angdist</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_assert_assert_alloc_assert_.htm">assert, assert_alloc, assert_directory_present, assert_present, fatal_error</A> 57<B> Top:</B> <a href="main.htm">Main Page</a></DIV> 58<!--End of Navigation Panel--> 59 60<H1><A ID="SECTION1500"></A> 61<A ID="sub:apply_mask"></A> 62<BR> 63 64</H1> 65 66<P> 67<b><font size=+6><FONT COLOR="#CC0000">apply_mask</FONT></font></b><hr> 68<H3>This routine multiplies a <b>HEALPix</b> map by an arbitrary pixel mask and/or sets to 0 pixels 69lying in or out a constant latitude strip</H3> 70Location in HEALPix directory tree: <a href="https://sourceforge.net/p/healpix/code/1005/tree/trunk/src/f90/mod/pix_tools.F90"><b>src/f90/mod/pix_tools.F90</b></a> 71 72<P> 73<hr><h1>FORMAT </h1><blockquote><h3>call <FONT COLOR="#CC0000">apply_mask</FONT>( 74 <A HREF="#sub:apply_mask:map">map</A>, <A HREF="#sub:apply_mask:ordering">ordering</A>[, <A HREF="#sub:apply_mask:mask">mask</A>=, <A HREF="#sub:apply_mask:zbounds">zbounds</A>=] 75)</h3></blockquote> 76 77<P> 78<hr><H1>ARGUMENTS</H1> 79 80<TABLE CELLPADDING=3 BORDER="1"> 81<TR><TH ALIGN="LEFT" VALIGN="TOP" WIDTH=160><SPAN CLASS="textbf">name & dimensionality</SPAN></TH> 82<TH ALIGN="LEFT" VALIGN="TOP" WIDTH=25><SPAN CLASS="textbf">kind</SPAN></TH> 83<TH ALIGN="LEFT" VALIGN="TOP" WIDTH=40><SPAN CLASS="textbf">in/out</SPAN></TH> 84<TH ALIGN="LEFT" VALIGN="TOP" WIDTH=225><SPAN CLASS="textbf">description</SPAN></TH> 85</TR> 86<TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=160> </TD> 87<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25> </TD> 88<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=40> </TD> 89<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=225> </TD> 90</TR> 91<TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=160> 92map<A ID="sub:apply_mask:map"></A>(0:npix-1,1:p)</TD> 93<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>SP/ DP</TD> 94<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=40>INOUT</TD> 95<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=225><b>HEALPix</b> map(s) on which the mask(s) and/or cut will be applied. The map will obviously be modified on output if either 96<A HREF="#sub:apply_mask:mask">mask</A> or 97<A HREF="#sub:apply_mask:zbounds">zbounds</A> are provided.</TD> 98</TR> 99<TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=160>ordering<A ID="sub:apply_mask:ordering"></A></TD> 100<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>I4B</TD> 101<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=40>IN</TD> 102<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=225><b>HEALPix</b> scheme of the map(s) (and mask(s)) 1:RING, 2: NESTED (relevant for <A HREF="#sub:apply_mask:zbounds">zbounds</A>).</TD> 103</TR> 104<TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=160>mask<A ID="sub:apply_mask:mask"></A>(0:npix-1,1:q) OPTIONAL</TD> 105<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>SP/ DP</TD> 106<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=40>IN</TD> 107<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=225>pixel mask(s). 108Should have the same <A HREF="#sub:apply_mask:ordering">ordering</A> 109and number of pixels (npix) as <A HREF="#sub:apply_mask:map">map</A>. If several maps are provided (<SPAN CLASS="MATH"><I>p</I>>1</SPAN>), each map is multiplied by its respective mask, and if there are fewer masks than maps (<SPAN CLASS="MATH"><I>q</I><<I>p</I></SPAN>) the last mask is duplicated as many times as necessary to match the number of maps.</TD> 110</TR> 111<TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=160>zbounds<A ID="sub:apply_mask:zbounds"></A>(1:2) OPTIONAL</TD> 112<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=25>DP</TD> 113<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=40>IN</TD> 114<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=225>section of the map to be set to 0, expressed in terms of <!-- MATH 115 $z=\sin({\rm latitude}) = 116 \cos(\theta)$ 117 --> 118<SPAN CLASS="MATH"><IMG STYLE="height: 2.33ex; vertical-align: -0.68ex; " SRC="sub_img88.png" 119 ALT="$z=\sin({\rm latitude}) = 120\cos(\theta)$"></SPAN>. If zbounds(1)<SPAN CLASS="MATH"><</SPAN>zbounds(2), pixels 121<EM>outsise</EM> the strip zbounds(1)<SPAN CLASS="MATH"><<I>z</I><</SPAN>zbounds(2) are set to 0; if not, 122pixels <EM>on</EM> the strip 123zbounds(2)<SPAN CLASS="MATH"><IMG STYLE="height: 1.87ex; vertical-align: -0.41ex; " SRC="sub_img43.png" 124 ALT="$\le z \le$"></SPAN>zbounds(1) are set to 0. 125If absent, the map is unchanged. 126</TD> 127</TR> 128</TABLE> 129 130<P> 131 132<HR><H1>EXAMPLE:</H1> 133<tt>s = sin(15.0_dp * <A HREF="sub_healpix_types_module.htm#sub:healpix_types:deg2rad">DEG2RAD</A>) 134<BR> 135call <FONT COLOR="#CC0000">apply_mask</FONT>(map, 1, zbounds=(<SPAN CLASS="MATH"><IMG STYLE="height: 2.33ex; vertical-align: -0.68ex; " SRC="sub_img17.png" 136 ALT="$\backslash$"></SPAN> s, -s <SPAN CLASS="MATH"><IMG STYLE="height: 2.33ex; vertical-align: -0.68ex; " SRC="sub_img17.png" 137 ALT="$\backslash$"></SPAN>) ) 138<BR></tt> 139<blockquote> 140Will set to 0 pixels of the input (RING ordered) map lying in the strip <SPAN CLASS="MATH"><IMG STYLE="height: 2.33ex; vertical-align: -0.68ex; " SRC="sub_img89.png" 141 ALT="$\vert b\vert \le 15^o$"></SPAN>. 142</blockquote> 143 144<P> 145<hr><H1>MODULES & ROUTINES</H1><H3>This section lists the modules and routines used by <FONT COLOR="#CC0000">apply_mask</FONT>.</h3> 146 <DL COMPACT><DT> 147<B><SPAN CLASS="textbf">pix_tools</SPAN></B> 148<DD>module, containing: 149</DL> 150 151<P> 152 153<P> 154 155 156<P> 157 158<P> 159 160<DIV CLASS="navigation"><HR> 161<!--Navigation Panel--> 162<A 163 HREF="sub_angdist.htm"> 164<IMG WIDTH="63" HEIGHT="24" ALT="previous" SRC="prev.png"></A> 165<A 166 HREF="sub_HEALPix_F90_subroutines.htm"> 167<IMG WIDTH="26" HEIGHT="24" ALT="up" SRC="up.png"></A> 168<A 169 HREF="sub_assert_assert_alloc_assert_.htm"> 170<IMG WIDTH="37" HEIGHT="24" ALT="next" SRC="next.png"></A> 171<A ID="tex2html322" 172 HREF="sub_TABLE_CONTENTS.htm"> 173<IMG WIDTH="65" HEIGHT="24" ALT="contents" SRC="contents.png"></A> 174<BR> 175<B> Previous:</B> <A 176 HREF="sub_angdist.htm">angdist</A> 177 178<B>Up:</B> <A 179 HREF="sub_HEALPix_F90_subroutines.htm">HEALPix/F90 subroutines</A> 180 181<B> Next:</B> <A 182 HREF="sub_assert_assert_alloc_assert_.htm">assert, assert_alloc, assert_directory_present, assert_present, fatal_error</A> 183<B> Top:</B> <a href="main.htm">Main Page</a></DIV> 184<!--End of Navigation Panel--> 185<ADDRESS> 186Version 3.50, 2018-12-10 187</ADDRESS> 188</BODY> 189</HTML> 190