[ncl-talk] gsLineThicknessF (bug?) in NCL 6.5

Mary Haley haley at ucar.edu
Tue Nov 20 10:14:59 MST 2018


Hi Nick,

This is definitely a bug. I'll provide a work-around a little later in this
email.

Meanwhile, as a favor, could you submit an issue using NCL's github issue
tracker? We're moving from JIRA to github for issue tracking, and would
like to get our users on this as well.

To report the issue:

[1] Go to the NCL github page:

https://github.com/NCAR/ncl

[2] Click on the "Issues" tab near the top of the page

[3] Click on the green "New Issue" button

[4] Fill in the title and description. The title should be descriptive, but
as brief as possible. What you had for the subject of this email would
work.

When filling out the description, you can use the attached sample script
which illustrates the problem. Unfortunately, github doesn't let you select
files with a ".ncl", but if you rename it to "xxx.ncl.txt" then you can
attach it to the issue.

Or, you can copy the script, and then in the github description box, if you
paste the code surrounded by these two lines:

```ncl
[....paste NCL code here...]
```

Then it will recognize this as an NCL script and will highlight bits of the
code for you!  You can click on the "preview" tab to see what it looks like.

[5] Once the description is done, click on the "Submit new issue" button to
submit it.

Back to the problem at hand. There are a couple of work-arounds.

*Work-around #1*

One is to fix the $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl script
yourself.  Edit this line:

  gsres_tmp = get_res_eq(res2,"gs")           ; Get resource list for
lines. Remove gsFill

and change "res2" to "res":

  gsres_tmp = get_res_eq(res,"gs")           ; Get resource list for lines.
Remove gsFill

*Work-around #2*

If you don't want to edit and change
$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl directly, then I created
a separate "gsn_table_fix.ncl" script for you, that has the new gsn_table
with the one line fix.  You can include this fixed script in your current
NCL script with:

load "./gsn_table_fix.ncl"

Let me know if this doesn't work for you.

--Mary


On Mon, Nov 19, 2018 at 12:14 PM Bassill, Nicholas <nbassill at albany.edu>
wrote:

> Hi All,
>
>    I wanted to share a possible bug - although it's also possible I'm
> doing something wrong that I can't figure out. Long story short, I have a
> crontab'd, daily script that creates plots like this:
> http://operations.nysmesonet.org/~hudson2016/forecasts/2018103100SOMregressionforecast.png .
> That plot was created with NCL 6.3. It's a graph, with a table added to it
> below, with "res at gsLineThicknessF = 6" for the table line thickness. I
> relocated this script to a different computer that uses NCL 6.5. That plot
> looks like:
> http://operations.nysmesonet.org/~hudson2016/forecasts/2018110100SOMregressionforecast.png -
> notice the table line thicknesses are much thinner.
>
>
>     I assumed I changed something in the move (and forgot), but recently I
> started making a new plot, also with a table attached to the bottom, using
> NCL 6.5, and sure enough, I can't change the line thickness.
>
>
> Even though I know most of these resources aren't relevant, these are the
> resources I've rotated through trying:
>
>   tableres at gsLineThicknessF = 10.0
>   tableres at gsFillLineThicknessF  = 25.0
>   tableres at gsEdgesOn = True
>   tableres at gsEdgeThicknessF = 20.0
>
>
>  .... all with no luck. I'm wondering if anyone else has experienced this
> issue, or has any suggestions?
>
>
> My script is very lengthy, and the underlying data complex, so I'm not
> sharing it here, but the table portion looks like:
>
> tableres = True
>   ncr = (/11,4/)     ; 4 rows, 3 columns
>   tableres at txFontHeightF = .012 ; fontvalues       ; Font height
>   tableres at gsLineThicknessF = 10.0
>   tableres at gsFillLineThicknessF  = 25.0
>   tableres at gsEdgesOn = True
>   tableres at gsEdgeThicknessF = 20.0
>
>   tableres at txJust = "CenterCenter"
> ncr = (/4,11/)
> tableres at txFont = "helvetica-bold"
>   text := round(transpose(forecastoutages),3)
>   text := where(text.lt.0,0,text)+""
>
>   y := (/0.02,0.12/)         ; Start and end X
>   x := (/0.2,0.8/)         ; Start and end Y
>
>   tableres at txFontHeightF = .011 ; fontvalues       ; Font height
>   tableres at txJust = "CenterCenter"
>
>   colors := 10+round(transpose(forecastoutages),3)
>   colors := where(colors.gt.220,220,colors)
>   colors := where(colors.lt.10,10,colors)
>
>   tableres at gsFillColor := colors
>
>   gsn_table(wks,ncr,x,y,text,tableres)
>
> ncr = (/4,1/)
> x = (/.04,.2/)
> res at gsFillColor := "white"
> gsn_table(wks,ncr,x,y,(/"10% Worst Case:","Best Forecast~N~:","90% Worst
> Case:","99% Worst Case:"/),tableres)
>
> ncr = (/1,11/)
> x = (/0.2,0.8/)
> y = (/0.12,0.145/)
>
>   gsn_table(wks,ncr,x,y,dayarray,tableres)
>
>
> Nick Bassill, PhD
>
> Modeler & Meteorologist, Center Of Excellence (Prior: NYS Mesonet)
>
> LC SB-28, 1400 Washington Ave.,
>
> SUNY, University at Albany, NY 12222
> (518) 442-6375
> NYSM Products: http://operations.nysmesonet.org/~nbassill/
> _______________________________________________
> 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/20181120/bab27b80/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: table_1.ncl
Type: application/octet-stream
Size: 497 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20181120/bab27b80/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gsn_table_fix.ncl
Type: application/octet-stream
Size: 8238 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20181120/bab27b80/attachment-0001.obj>


More information about the ncl-talk mailing list