[ncl-talk] plotting potential temperature with mask
Mary Haley
haley at ucar.edu
Tue Mar 22 15:46:25 MDT 2016
I assume you are having a problem with this line:
tMask = (/mask(temperature,topo2d.lt.high2d,False)/)
and that "tMask" is now all missing?
Did you confirm you are using the mask function in the correct way?
What "mask" does is "protect" the values of the first argument
(temperature) in the locations where the second argument (topo2d < high2d)
is equal to the third argument (False).
So, basically you're asking that the values of temperature be returned at
all locations where topo2d is >= high2d, and set to missing otherwise.
Another way to do this is to use the "where" statement, which is a little
more user friendly. Both of these should be the same (if I have my logic
correct):
tMask = where(topo2d.ge.high2d,tMask,tMask at _FillValue)
tMask = where(topo2d.lt.high2d,tMask at _FillValue, tMask)
Please let ncl-talk know if this doesn't shine any light on the situation.
If you continue to have problems, I also suggest checking "high2d" to make
sure it has the values you think it has.
--Mary
On Mon, Mar 21, 2016 at 8:44 PM, Andrew Kren - NOAA Affiliate <
andrew.kren at noaa.gov> wrote:
> I am trying to plot a cross section of potential temperature (pressure x
> longitude). I followed a simple example here (
> https://www.ncl.ucar.edu/Applications/Scripts/mask_14.ncl) and modified
> it for my use. For some reason, when I create the mask, all values are
> reverted to the _FillValue, and I can't figure out why. My program is
> attached. Thanks.
>
>
>
> --
> Andrew Kren, PhD
> Research Scientist I, Global Observing Systems Analysis (GOSA) Group
> NOAA ESRL Global Systems Division (Rm 3C515)
> 325 Broadway, Boulder, CO 80305
> (303) 497-5418
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160322/794d37f4/attachment.html
More information about the ncl-talk
mailing list