[gradsusr] Using maskout function to apply TWO masks
RMera at ucsusa.org
Thu Jul 3 12:16:22 EDT 2014
Thanks for the help. I'm a little confused about this part:
maskout(temperature,hgtsfc+700 - height)
What is hgtsfc. Is that a defined variable?
The temperature and topography variables are in different files so all I need is to create a mask about 700m. My ocean mask works.
The name of the variable in the topography file is ht. I was trying this:
msk700=(ht/ht,ht-700) but it masked out everything below 700 m.
From: gradsusr-bounces at gradsusr.org [gradsusr-bounces at gradsusr.org] on behalf of Jeff Duda [jeffduda319 at gmail.com]
Sent: Tuesday, June 03, 2014 5:09 PM
To: GrADS Users Forum
Subject: Re: [gradsusr] Using maskout function to apply TWO masks
The const() and maskout() are powerful functions suited just for this purpose.
'define oceanmaskedtemperature = maskout(temperature,landseamask)' will get your your ocean mask
'set lev 1000 900'
'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,
'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.
On Tue, Jun 3, 2014 at 3:14 PM, Roberto Mera <RMera at ucsusa.org<mailto:RMera at ucsusa.org>> wrote:
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.
My question is this: How do I apply two masks?
I want to mask out the ocean and also, say >700 m altitude.
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:
*mskgrd=maskout(ht/ht,ht-0.1) ****this masks out the ocean
count = 1
while (count < 18)
'set e 'count
if (rc != 0) ; break ; endif
count = count +1
gradsusr mailing list
gradsusr at gradsusr.org<mailto:gradsusr at gradsusr.org>
Graduate research assistant
University of Oklahoma School of Meteorology
Center for Analysis and Prediction of Storms
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the gradsusr