[gradsusr] Using maskout function to apply TWO masks
Jeff Duda
jeffduda319 at gmail.com
Tue Jun 3 17:09:05 EDT 2014
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.
Jeff Duda
On Tue, Jun 3, 2014 at 3:14 PM, Roberto Mera <RMera at ucsusa.org> wrote:
> Grads crew:
>
>
>
> 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
>
>
> 'areal=aave(maskout(ave(field88,t=1,t=6),mskgrd(t=1)),x=147,x=250,y=94.1815,y=182.057)'
>
> 'd areal'
>
> areal=subwrd(result,4)
>
> say areal
>
> if (rc != 0) ; break ; endif
>
> count = count +1
>
> endwhile
>
>
>
> Robert
>
>
>
>
>
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>
--
Jeff Duda
Graduate research assistant
University of Oklahoma School of Meteorology
Center for Analysis and Prediction of Storms
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20140603/9bc64d37/attachment.html
More information about the gradsusr
mailing list