[ncl-talk] mpProjection in gsn_csm_contour

Kreienkamp Frank Frank.Kreienkamp at dwd.de
Wed Mar 18 01:08:15 MDT 2015


Hello,

i want to plot a grid based plot, including an contour overlay. The grid based plot is drawn in Stereographic projection using mpProjection = "Stereographic" and plot = gsn_csm_map(wks,res).  On top of this map I want to add a contour-plot showing if changes are significant or not.
Unfortunately both plots do not use the same projection.

But if I use resNatVar at mpProjection = "Stereographic" I get the information: warning:mpProjection is not a valid resource in ..

I have added the source-code part and an example plot.

What can I do?

Thanks in advance
Frank


 ;************************************************
 ; create plot
   wtype                             = "png"
   wtype at wkWidth                     =   970              ; Set the pixel size of image.
   wtype at wkHeight                    =  1000              ; Set the pixel size of image.
   wks                               = gsn_open_wks(wtype,"test")
 ;************************************************
   res                               = True
   res at gsnMaximize                   = True
   res at gsnDraw                       = False
   res at gsnFrame                      = False
   res at mpProjection                  = "Stereographic"
   res at mpCenterLatF                  = 50                 ; Centered over Germany
   res at mpCenterLonF                  = 10                 ; Centered over Germany
   res at mpLimitMode                   = "Corners"          ; choose range of map
   res at mpLeftCornerLatF              =  55.8
   res at mpLeftCornerLonF              =   2.6
   res at mpRightCornerLatF             =  45.1
   res at mpRightCornerLonF             =  19.5
   res at mpGridLatSpacingF             = 2
   res at mpGridLonSpacingF             = 2
   res at mpOutlineDrawOrder            = "PostDraw"         ; draw continental outline last
   res at mpFillDrawOrder               = "PreDraw"
   res at mpDataBaseVersion             = "HighRes"          ; use finer database
   res at mpOutlineBoundarySets         = "National"
   res at mpFillOn                      = False              ; turns off continent gray
   res at mpLeftAngleF                  = 7
   res at mpRightAngleF                 = 8
   res at mpBottomAngleF                = 6
   res at mpTopAngleF                   = 8
   res at mpMinLatF                     = 10.0
   res at pmTickMarkDisplayMode         = "Always"           ; Nicer tickmark labels
   res at mpGridAndLimbOn               = True               ; Turn on lat/lon grid
   res at mpGridLineDashPattern         = 2                  ; Dashed lines
   res at tmXTOn                        = False              ; turn tickmarks of
   res at tmXBOn                        = False              ; turn tickmarks of
   res at tmYLOn                        = False              ; turn tickmarks of
   res at tmYROn                        = False              ; turn tickmarks of
   res at gsnLeftString                 = ""
 ;************************************************
 ; Plot will just be created, and not drawn yet.
   plot                              = gsn_csm_map(wks,res) ; Create plot
 ;************************************************
 ; adding color definition
   cmap                              = RGBtoCmap("/kp/kp06/VisTool/data/konstdat/Farben_rgb_temp.dat")
   gsn_define_colormap(wks,cmap)
 ;************************************************
 ; adding map
   res at cnFillOn                      = True               ; color Fill
   res at cnFillMode                    = "RasterFill"       ; Raster Mode
   res at cnLinesOn                     =  False             ; Turn off contour lines
   res at cnLevelSelectionMode          = "ManualLevels"
   res at cnMinLevelValF       =     -90.0             ; min contour level
   res at cnMaxLevelValF       =      90.0              ; max contour level
   res at cnLevelSpacingF      =      20.0             ; contour spacing
   res at cnLabelBarEndStyle            = "ExcludeOuterBoxes"        ; no additional ColorBoxes
   res at gsnAddCyclic                  = False              ; regional data: not cyclic
 ;************************************************
 ; Plot will just be created, and not drawn yet.
   plot                              = gsn_csm_contour_map(wks,u,res)
 ;************************************************
 ;  add Info robust signal
    resNatVar                               = True
    resNatVar at gsnMaximize                   = True
    resNatVar at gsnDraw                       = False
    resNatVar at gsnFrame                      = False
    resNatVar at gsnLeftString                 = ""
    resNatVar at lbLabelBarOn                   = False
    resNatVar at cnFillOn                      = True               ; color Fill
    resNatVar at cnLinesOn                     =  False             ; Turn off contour lines
    resNatVar at cnLevelSelectionMode          = "AutomaticLevels"
    resNatVar at cnFillMode                    = "AreaFill"       ; Raster Mode
    resNatVar at cnFillPattern                 = 17
    resNatVar at cnFillBackgroundColor         = -1
    resNatVar at cnInfoLabelOn        = False
    resNatVar at cnLineLabelsOn = False
    resNatVar at cnMonoFillColor               = True
    resNatVar at cnConstFEnableFill            = True
    resNatVar at cnConstFLabelOn               = False
    resNatVar at cnFillColor                   = "black"
  ;************************************************
  ; Plot will just be created, and not drawn yet.
    plot1                              = gsn_csm_contour(wks,u1,resNatVar)
    overlay(plot,plot1)


[cid:image001.png at 01D0614F.B2E6B880]




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150318/ead1b305/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 145280 bytes
Desc: image001.png
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150318/ead1b305/attachment.png 


More information about the ncl-talk mailing list