Re: Setting "MaskLand" Changes Gridline Settings

From: David Ian Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Wed, 18 Jul 2007 16:05:29 -0600

Hi Bruce,
The problem is not that the dashed settings are gone when
mpGridMaskMode is set to something other than "MaskNone", it is
that there seem to be different scalings for the mpGridLineDashSegLenF
value when used with different settings of mpGridMaskMode. The
value you have given mpGridLineDashSegLenF, 0.02, reduces the
dash pattern so much that it looks like a solid line for all settings of
mpGridMaskMode except for "MaskNone". If you draw the plots to the
ncgmWorkstation and then use 'idt' to zoom in on regions of the plot you
will see that the pattern is still present.

For historical reasons, the code used to draw the dash patterns is
different
for the "MaskNone" setting from what is used for all the other
settings. And
apparently there was no compensation applied to adjust for the
difference
in interpretation of the dash segment length. As a work around, it
appears
that if you make mpGridLineDashSegLenF larger by a factor of 3 or so
for
the other settings, you will get a similar appearance to your current
setting
for the "MaskNone" setting.

We will have to think about how to fix this while causing the least
amount
of incompatibility. The "MaskNone" scaling of the dash segment length
departs
from the standard used throughout most of NCL's graphics code, but it
would likely be
disruptive to a lot of code to change it. So I am not sure what we will
decide to
do about this.
  -dave

On Jul 16, 2007, at 9:03 AM, Lunde, Bruce N CIV NAVOCEANO, NP1 wrote:

> Hello,
>
> I am having a problem keeping the (dashed) settings
> for my grid lines when making a map. If I use
>
> res_at_mpGridMaskMode = "MaskNone"
>
> the results are what I want. If I use
>
> res_at_mpGridMaskMode = "MaskLand"
>
> the grid line settings revert to the NCL defaults (?).
>
> I have attached a script to demonstrate this. By
> switching the above lines (at line numbers 49 and 50)
> you can see the results.
>
> I am running NCL 4.3.0 on Cygwin (Bash on Windoze).
> I get the same result with NCL 4.2.0.a034 on AIX.
>
> Thanks, Bruce
>
> =====
> Bruce Lunde
> Bruce.Lunde_at_navy.mil
> 228-688-5843
> Code NP1
> Naval Oceanographic Office
> Stennis Space Center, MS
> =====
>
>
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> ;
> ;;;;;;;;
> ; HISTORY:
> ; 07-07-12 Bruce Lunde.
> ; NOTES:
> ; * Using NCL 4.3.0
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> ;
> ;;;;;;;;
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
>
> begin
>
> wks = gsn_open_wks("x11","plot_world")
>
> setvalues wks
> "wkForegroundColor" : (/0.,0.,0./)
> "wkBackgroundColor" : "gray"
> end setvalues
>
> gsn_define_colormap(wks,"testcmap")
>
> rr = 205.0/255.0
> gg = 186.0/255.0
> bb = 150.0/255.0
>
> iland = NhlNewColor(wks,rr,gg,bb)
> igray = NhlNewColor(wks,0.5,0.5,0.5)
>
> res = True ; Plot mods desired.
>
> res_at_gsnMaximize = True ; Enlarge plot.
> res_at_pmTickMarkDisplayMode = "Always" ; Turn on automatic tickmarks.
>
> res_at_mpOutlineOn = True
> res_at_mpLandFillColor = iland
> res_at_mpOceanFillColor = "white"
>
> res_at_mpGridAndLimbOn = True ; Turn on lon/lat lines.
> res_at_mpGridLineDashPattern = 2 ; Lon/Lat grid lines as dashed.
> res_at_mpGridLineDashSegLenF = 0.02
> res_at_mpGridSpacingF = 10.0 ; Grid line spacing for both
> lon/lat.
>
> ;
> ***********************************************************************
> ********
> ;** BUG: Everything except "MaskNone" does NOT keep your grid line
> setting * BUG
> ;
> ***********************************************************************
> ********
> res_at_mpGridMaskMode = "MaskOcean"
> res_at_mpGridMaskMode = "MaskNotOcean" ; Mask grid lines over land.
> res_at_mpGridMaskMode = "MaskNotLand"
> res_at_mpGridMaskMode = "MaskLand" ; Mask grid lines over land.
> res_at_mpGridMaskMode = "MaskNone" ; Do not mask grid lines
> anywhere.
>
> res_at_mpProjection = "CylindricalEquidistant"
> res_at_mpProjection = "Stereographic"
> res_at_mpProjection = "Satellite"
> res_at_mpProjection = "Mercator"
>
> res_at_tiMainString = res_at_mpProjection
>
> res_at_mpLimitMode = "LatLon" ; Required
> res_at_mpMinLatF = -80.0 ; Min Lat
> res_at_mpMaxLatF = 80.0 ; Max Lat
> res_at_mpMinLonF = 0.0 ; Min Lon
> res_at_mpMaxLonF = 360.0 ; Max Lon
>
> res_at_gsnDraw = False
> res_at_gsnFrame = False
>
> plot1 = gsn_csm_map(wks,res)
>
> draw(plot1)
> frame(wks)
>
> end
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Jul 18 2007 - 16:05:29 MDT

This archive was generated by hypermail 2.2.0 : Wed Jul 18 2007 - 17:38:12 MDT