[ncl-talk] ContourPlotDraw and PlotManagerDraw error while ploting SST

Adam Phillips asphilli at ucar.edu
Tue Aug 30 08:59:11 MDT 2016


Hi Amit,
Did you try adding the trGridType resource to your script and setting it to
TriangularMesh? That warning message is telling you what is likely wrong.
You can examine your 2-dimensional coordinates yourself to see if anything
is out of range by using printMinMax, and you can use ismissing to check if
any of your coordinates are missing like this:
if (any(ismissing(ndtooned(lon))) then
  print("Missing longitude coordinates detected")
end if
; (and repeat for the lat array)

Hope that helps. If not, please respond to the ncl-talk email list.
Adam



On Tue, Aug 30, 2016 at 1:27 AM, Amit Kumar <amitkumar.777 at hotmail.com>
wrote:

> Hi All,
>
>
> attached plot .
>
>
> regards,
>
> Amit
>
>
> ------------------------------
> *From:* Amit Kumar <amitkumar.777 at hotmail.com>
> *Sent:* Tuesday, August 30, 2016 12:27 PM
> *To:* Mary Haley
> *Cc:* ncl-talk at ucar.edu; Guido Cioni
> *Subject:* Re: [ncl-talk] ContourPlotDraw and PlotManagerDraw error while
> ploting SST
>
>
> Hi All,
>
> While ploting south hemisphere co-ordinates i'm getting following error.
>
> warning:ContourPlotDraw: out of range coordinates encountered; standard
> RasterFill rendering method may be unreliable;
>  consider setting the resource trGridType to "TriangularMesh" if
> coordinates contain missing values
>
> I'm using
>
>   res at mpMinLonF     = 40.0
>   res at mpMaxLonF     = 110.0
>   res at mpMinLatF     = -50.0
>   res at mpMaxLatF     = 25.0
>
> to zoom into southern hemisphere, but it is not plotting southern
> latitudes is giving above error.
>
> Is there any other way to write southern latitudes?
>
>
> Regards
>
> Amit
> ------------------------------
> *From:* Mary Haley <haley at ucar.edu>
> *Sent:* Tuesday, August 30, 2016 1:58:13 AM
> *To:* Amit Kumar
> *Cc:* ncl-talk at ucar.edu; Guido Cioni
> *Subject:* Re: [ncl-talk] ContourPlotDraw and PlotManagerDraw error while
> ploting SST
>
> Amit,
>
> Guido's answer is correct, and I wanted to point out that you can also set
> this resource inside your NCL script. See:
>
> http://www.ncl.ucar.edu/Document/Language/error_messages.shtml#
> WorkspaceReallocation
>
> The above also recommends trying raster contouring, if you have a large
> array that you are trying to plot:
>
>   res@*cnFillMode* <http://www.ncl.ucar.edu/Document/Graphics/Resources/cn.shtml#cnFillMode> = "RasterFill"
>   res@*cnRasterSmoothingOn* <http://www.ncl.ucar.edu/Document/Graphics/Resources/cn.shtml#cnRasterSmoothingOn> = True   ; optional, but may produce better results
>
> Try it first without the "cnRasterSmoothingOn" set to True. If it looks too blocky, then add that resource
>
>
> --Mary
>
>
>
> On Mon, Aug 29, 2016 at 3:55 AM, Guido Cioni <guidocioni at gmail.com> wrote:
>
>> As stated here http://www.ncl.ucar.edu/Document/Graphics/hlures.shtml [at
>> the bottom] try to increase the default contour memory in the .hluresfile.
>> Regards,
>>
>> Guido Cioni
>> http://guidocioni.altervista.org
>>
>> On 29 Aug 2016, at 10:17, Amit Kumar <amitkumar.777 at hotmail.com> wrote:
>>
>> Hi all,
>>
>> I'm trying to plot daily file of SST using NCL. But I'm getting following
>> error:
>>
>> fatal:ContourPlotDraw: Workspace reallocation would exceed maximum size
>> 100000000
>> fatal:ContourPlotDraw: draw error
>> fatal:ContourPlotDraw: draw error
>> fatal:PlotManagerDraw: error in plot draw
>> fatal:_NhlPlotManagerDraw: Draw error
>>
>>
>> I'm able to plot HEM, OLR which are in same format and with same NCL
>> script but with SST I'm encountering these errors.
>>
>> My NC file description is as shown below:
>>
>> dimensions:
>>       x = 1744
>>       y = 657
>>       time = 1  // unlimited
>>    variables:
>>       double longitude ( y, x )
>>          standard_name :    longitude
>>          long_name :    longitude
>>          units :    degrees_east
>>          _CoordinateAxisType :    Lon
>>
>>       double latitude ( y, x )
>>          standard_name :    latitude
>>          long_name :    latitude
>>          units :    degrees_north
>>          _CoordinateAxisType :    Lat
>>
>>       double time ( time )
>>          standard_name :    time
>>          units :    hours since 1-1-1 00:00:00
>>          calendar :    standard
>>          axis :    T
>>
>>       double SST_DLY ( time, y, x )
>>          coordinates :    latitude longitude
>>          _FillValue :    -9e+33
>>          missing_value :    -9e+33
>>          fillvalue :    -9.e+33
>>
>>
>> My script is as below:
>>
>> load "/usr/share/ncarg/nclscripts/csm/gsn_code.ncl"
>> load "/usr/share/ncarg/nclscripts/csm/gsn_csm.ncl"
>> load "/usr/share/ncarg/nclscripts/csm/contributed.ncl"
>>
>> begin
>>
>>  a = addfile("/media/amit/E/Research/SWM/SST/AUG/output/india/
>> 07AUG.nc","r")
>>  ;filename = "/media/amit/E/India_shapefile/Districtbound(Satmet).shp"
>>  filename = "/media/amit/E/India_shapefile/State_bound(Satmet).shp"
>>
>>   var     = doubletofloat(a->SST_DLY(0,:,:))
>>   lat     =  a->latitude
>>   lon     =  a->longitude
>>
>> wks = gsn_open_wks("png","07AUG")                ; send graphics to PNG
>> file
>>
>>   res                      = True                  ; plot mods desired
>>   res at gsnDraw              = False
>>   res at gsnFrame             = False
>>   res at gsnAddCyclic         = False
>>   res at gsnStringFontHeightF = 0.015
>>   res at cnFillOn             = True                  ; turn on color fill
>>   res at gsnMaximize          = True     ; maximize plot in frame
>>   res at mpOutlineOn   = False   ; Use outlines from shapefile
>>   res at mpFillOn      = False
>>   res at cnLinesOn         = False    ; turn off contour lines
>>   res at cnLineLabelsOn    = False    ; turn off line labels
>>   res at cnLevelSelectionMode = "ExplicitLevels"
>>   res at cnLevels             = (/273,283,293,294,295,296,297,
>> 298,299,300,301,302,303,304,305/) ;   15 contour values
>>   res at cnFillPalette            = "rainbow"
>>   res at lbLabelBarOn     = False
>>   res at lbOrientation   = "Vertical"
>>   res at sfXArray             = lon
>>   res at sfYArray        =  lat
>>  ; res at mpMinLonF     = 1.0
>>  ; res at mpMaxLonF     = 163.0
>>  ; res at mpMinLatF     = -81.0
>>  ; res at mpMaxLatF     = 25.0
>>   res at pmTickMarkDisplayMode     = "Always"
>>   ;res at tiXAxisString            = "Longitude"
>>   ;res at tiYAxisString            = "Lattitude"
>>   res at tiXAxisFontHeightF     = 0.02
>>   res at tiYAxisFontHeightF     = 0.02
>> plot = gsn_csm_contour_map(wks,var, res)        ; create plot
>>
>> ;---Resource list for shapefile outlines
>>  plres                     = True
>>  plres at gsLineColor       = "black"
>>  plres at gsLineThicknessF  = "1.0"
>>  dumstr                = unique_string("poly")
>>  id = gsn_add_shapefile_polylines(wks,plot,filename,plres)
>>  draw(plot)
>>  frame(wks)
>> end
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>


-- 
Adam Phillips
Associate Scientist,  Climate and Global Dynamics Laboratory, NCAR
www.cgd.ucar.edu/staff/asphilli/   303-497-1726

<http://www.cgd.ucar.edu/staff/asphilli>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160830/cfe8d508/attachment.html 


More information about the ncl-talk mailing list