[ncl-talk] "RasterFill" not plotting field

Ryan Connelly rconne01 at gmail.com
Wed Jan 4 13:09:58 MST 2017


Hi Mary,

opts_pv = res is just my way of initializing.  There's no difference is
switching to opts_pv = True; i.e., there isn't a hidden res causing the
problem.

I ran your script with my wrfout, but did not get your output.  Instead,
for plot 2, the masking works, but the original colors remain.  I've
attached my images.  Likewise, I added the lines to turn on @RasterFill and
@RasterSmoothing to a basic wrf_dbz plot, and that worked as expected.  So
it appears that the problem is that @cnMonoFillColor only works on contour
plots, not on raster plots, though somehow (as your attached images show)
this is only a problem on my end.  I'm running V6.3.0 if that matters.

Thanks,
Ryan



On Wed, Jan 4, 2017 at 9:46 AM, Mary Haley <haley at ucar.edu> wrote:

> 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
>>
>
>


-- 
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/2d3151ce/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wrf_nogsn.000002.png
Type: image/png
Size: 78900 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170104/2d3151ce/attachment.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wrf_nogsn.000001.png
Type: image/png
Size: 76863 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170104/2d3151ce/attachment-0001.png 


More information about the ncl-talk mailing list