[ncl-talk] "RasterFill" not plotting field

Mary Haley haley at ucar.edu
Wed Jan 4 07:46:13 MST 2017


Ryan,

I would need a little more information in order to debug this.

For starters, you set "opts_pv" equal to "res".  Does "res" have any extra
resource settings that might be affecting the contouring?

I recommend starting with a very simple script to make sure things are
working.  I've taken your resource settings, and created my own script that
plots HGT from a WRF file, and then masks some of the data values and plots
it again in gold, using the same settings you have.  It seems to work just
fine for me.  See attached. You should be able to run this script on your
own WRF output data by simply changing the name of the WRF output file in
the script.

The PNG images look a little weird (shifted towards the lower right of the
screen) because wrf_contour is really not meant to be used as a standalone
function. I assume that you are eventually overlaying fill_mgpv on another
plot, so this shift is not an issue.

--Mary



On Tue, Jan 3, 2017 at 1:32 PM, Ryan Connelly <rconne01 at gmail.com> wrote:

> Hi Mary,
>
> Surprisingly, it started plotting when I got into the office today.  I
> don't know either; it must be a Christmas miracle.
>
> But now I have a new problem.  I have my MGPV variable subset to just
> negative values using "where", and want to plot the resultant field of only
> negative MGPV values in gold.  However, when using RasterFill, it defaults
> to plotting in pink, no matter what I try.  I do the same process with RH,
> but since it is not a RasterFill, is plots in green as expected.  If I add
> the line opts at cnFillMode                = "RasterFill" to the relative
> humidity opts, it overrides my request and plots in clown colors, so I know
> that this is an error specific to RasterFill plotting.  I suspect it may be
> a bug.  Below are my opts for MGPV plotting, which I would like to appear
> in solid color gold:
>
> ; Plotting options for mgpv
>         opts_pv = res
>         opts_pv at cnLineLabelsOn = False
>         opts_pv at cnConstFLabelPerimOn = False
>         opts_pv at cnLabelMasking = True
>         opts_pv at cnInfoLabelOn = False
>         opts_pv at cnLineLabelPerimOn = False
>         opts_pv at cnLinesOn = False
>         opts_pv at pmLabelBarOrthogonalPosF = -0.07
>         opts_pv at cnFillMode                = "RasterFill"
>         opts_pv at cnFillOn                = True
>         opts_pv at cnRasterSmoothingOn     = True
>         opts_pv at lbLabelBarOn    = False ; Do not display label bar
>         opts_pv at cnMonoFillColor = True
>         opts_pv at cnFillColor = "gold"
>         fill_mgpv = wrf_contour(a,wks,neg_mgpv,opts_pv)
>
>
> Thanks,
> Ryan
>
> On Mon, Jan 2, 2017 at 9:14 AM, Mary Haley <haley at ucar.edu> wrote:
>
>> Hi Ryan,
>>
>> You might try adding this resource, to have the raster plot generated a
>> slightly different way:
>>
>> res at trGridType = "TriangularMesh"
>>
>> Still, I'm curious about why the plot is not showing up with raster
>> fill.  Is it sparse data?  It would be good to get the script and data if
>> possible, so we can make sure it's not a bug.
>>
>> Thanks,
>>
>> --Mary
>>
>>
>> On Thu, Dec 29, 2016 at 1:36 PM, Ryan Connelly <rconne01 at gmail.com>
>> wrote:
>>
>>> Hi,
>>>
>>> I'm running a rather computationally intensive NCL script that attempts
>>> to calculate and plot geostrophic MPV.  At times, it is (understandably)
>>> very *very *slow, and at other times I have encountered an error about
>>> workspace memory allocation being exceeded.  With regards to the latter, I
>>> read a suggestion to change from...
>>>
>>>         opts_pv at cnFillOn                  = True
>>>
>>> ...to...
>>>
>>>         opts_pv at cnFillMode                = "RasterFill"
>>>     opts_pv at cnRasterSmoothingOn       = True
>>>
>>> When doing so, the script executes much faster, but does not plot my
>>> desired field.  (I printed out test points to confirm that the values are
>>> within the range I tell it to plot in ContourParameters, so I know that is
>>> not the problem.)
>>>
>>> Why might this be?
>>>
>>> Thanks,
>>> Ryan
>>>
>>> --
>>> Ryan Connelly
>>> M.S. Student in Atmospheric Sciences, Stony Brook University
>>> B.S. in Meteorology with Minors in Mathematics and GIS, Valparaiso
>>> University
>>> rconne01 at gmail.com
>>> ryan.connelly at stonybrook.edu
>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> ncl-talk at ucar.edu
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>>
>>
>
>
> --
> Ryan Connelly
> M.S. Student in Atmospheric Sciences, Stony Brook University
> B.S. in Meteorology with Minors in Mathematics and GIS, Valparaiso
> University
> rconne01 at gmail.com
> ryan.connelly at stonybrook.edu
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170104/8efbc366/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wrf_nogsn.000001.png
Type: image/png
Size: 66464 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170104/8efbc366/attachment.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wrf_nogsn.000002.png
Type: image/png
Size: 24876 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170104/8efbc366/attachment-0001.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wrf_nogsn_1.ncl
Type: application/octet-stream
Size: 1267 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170104/8efbc366/attachment.obj 


More information about the ncl-talk mailing list