<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" id="owaParaStyle"></style>
</head>
<body fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Jeff,
<div><br>
</div>
<div>Thanks for the help. I'm a little confused about this part:</div>
<div><br>
</div>
<div><span style="font-family: 'Times New Roman'; font-size: 16px;">maskout(temperature,hgtsfc+700 - height)</span></div>
<div><font face="Times New Roman" size="3"><br>
</font></div>
<div><font face="Times New Roman" size="3">What is hgtsfc. Is that a defined variable?</font></div>
<div><font face="Times New Roman" size="3"><br>
</font></div>
<div><font face="Times New Roman" size="3">The temperature and topography variables are in different files so all I need is to create a mask about 700m. My ocean mask works. </font></div>
<div><font face="Times New Roman" size="3"><br>
</font></div>
<div><font face="Times New Roman" size="3">The name of the variable in the topography file is ht. I was trying this:</font></div>
<div><font face="Times New Roman" size="3"><br>
</font></div>
<div><font face="Times New Roman" size="3">msk700=(ht/ht,ht-700) but it masked out everything below 700 m.</font></div>
<div><font face="Times New Roman" size="3"><br>
</font></div>
<div><font face="Times New Roman" size="3">Thoughts?</font></div>
<div><font face="Times New Roman" size="3"><br>
</font></div>
<div><font face="Times New Roman" size="3">Robert<br>
</font>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div id="divRpF487141" style="direction: ltr;"><font face="Tahoma" size="2" color="#000000"><b>From:</b> gradsusr-bounces@gradsusr.org [gradsusr-bounces@gradsusr.org] on behalf of Jeff Duda [jeffduda319@gmail.com]<br>
<b>Sent:</b> Tuesday, June 03, 2014 5:09 PM<br>
<b>To:</b> GrADS Users Forum<br>
<b>Subject:</b> Re: [gradsusr] Using maskout function to apply TWO masks<br>
</font><br>
</div>
<div></div>
<div>
<div dir="ltr">
<div>
<div>
<div>
<div>The const() and maskout() are powerful functions suited just for this purpose.<br>
<br>
</div>
'define oceanmaskedtemperature = maskout(temperature,landseamask)' will get your your ocean mask<br>
</div>
<div>'set lev 1000 900'<br>
</div>
'define 700mmaskedtemperature = maskout(temperature,hgtsfc+700 - height)' will maskout the grid above 700 m. Note you need to define this in a 3D environment, hence the 'set lev' command preceeding it. Finally,<br>
</div>
</div>
'd 0.5*(oceanmaskedtemperature + 700mmaskedtemperature)' will give you the field you seek. Adding grids that have undefined values is the same thing as taking the intersection of sets. The 0.5 factor is used because the temperature values will get added together
where both fields have non-missing values. But those values will be the same, so divide by 2 to restore the original values.<br>
<br>
Jeff Duda<br>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Tue, Jun 3, 2014 at 3:14 PM, Roberto Mera <span dir="ltr">
<<a href="mailto:RMera@ucsusa.org" target="_blank">RMera@ucsusa.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div lang="EN-US">
<div>
<p class="MsoNormal">Grads crew:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I would like to get the area average for the temperature for the California Central Valley. I would also like to mask out the ocean so I don’t get those temperatures when I take the average. Right now I have a script that masks out the
ocean and I have also adapted it for other purposes.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">My question is this: How do I apply two masks? <u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I want to mask out the ocean and also, say >700 m altitude.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Right now my script loops through ensemble members and calculates the time average within each ensemble member and it gives me a number for the area average:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">*mskgrd=maskout(ht/ht,ht-0.1) ****this masks out the ocean<u></u><u></u></p>
<p class="MsoNormal">count = 1<u></u><u></u></p>
<p class="MsoNormal">while (count < 18)<u></u><u></u></p>
<p class="MsoNormal">'set e 'count<u></u><u></u></p>
<p class="MsoNormal">'areal=aave(maskout(ave(field88,t=1,t=6),mskgrd(t=1)),x=147,x=250,y=94.1815,y=182.057)'<u></u><u></u></p>
<p class="MsoNormal">'d areal'<u></u><u></u></p>
<p class="MsoNormal">areal=subwrd(result,4)<u></u><u></u></p>
<p class="MsoNormal">say areal<u></u><u></u></p>
<p class="MsoNormal">if (rc != 0) ; break ; endif<u></u><u></u></p>
<p class="MsoNormal">count = count +1<u></u><u></u></p>
<p class="MsoNormal">endwhile<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Robert<span style="font-size:12.0pt"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
<br>
_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br>
</blockquote>
</div>
<br>
<br clear="all">
<br>
-- <br>
Jeff Duda<br>
Graduate research assistant<br>
University of Oklahoma School of Meteorology<br>
Center for Analysis and Prediction of Storms<br>
</div>
</div>
</div>
</div>
</div>
</body>
</html>