[ncl-talk] poisson_grid_fill for MODIS reflectance data

Adam Phillips asphilli at ucar.edu
Fri Nov 20 15:12:12 MST 2015


Hi Archana,
Thanks for providing your script and data file (offline). The allocation
error is a common one that is referenced in the FAQs here:
http://www.ncl.ucar.edu/FAQ/#err_msgs_012

In short: You are creating a graphic that is bigger than what your current
allocation limit allows. You can easily increase that limit. However, in
this case, I think the error message is a symptom of a larger issue. You
have a very high resolution grid. Whenever you have such high resolution
data and you wish to color fill you will want to set cnFillMode =
"RasterFill" to speed things up. If you like the smoothed look provided by
cnFillMode = "AreaFill" (the default) you can set cnRasterSmoothingOn =
True. I think the allocation issue is being caused by the numerous noisy
contour lines that NCL is trying to draw. Turning those off (via cnLinesOn=
False) and turning on RasterFill resulted in the plot being drawn rather
quickly with a size of 0.5MB.

Here's the resource list I used:
res = True
res at gsnDraw             = False           ; don't draw
res at gsnFrame            = False           ; don't advance frame
res at cnFillOn            = True            ; turn on color
res at cnLinesOn           = False           ; turn off contour lines
res at cnLineLabelsOn      = False           ; turn off contour line labels

 res at cnLevelSelectionMode =  "ExplicitLevels"
 res at cnLevels = (/0,2000,4000,6000,8000,10000,12000,14000/)
 res at gsnAddCyclic         = False
 res at mpMinLatF            = latS
res at mpMaxLatF            = latN
res at mpMinLonF            = lonL
 res at mpMaxLonF            = lonR
 res at mpCenterLonF = (lonL+lonR)/2.
res at lbLabelBarOn        = False           ; turn off individual cb's
res at mpFillOn            = False
   res at cnFillMode = "RasterFill"
   res at cnRasterSmoothingOn = True

Hope that helps. If you have any further questions please respond to the
ncl-talk email list.
Adam

On Fri, Nov 20, 2015 at 12:22 PM, Archana Dayalu <adayalu at seas.harvard.edu>
wrote:

> Hi Adam,
>
> Ok, I tried the filling ... and am now trying the comparison plot panels
> using the examples on the website. Specifically, I adapted the
> http://www.ncl.ucar.edu/Applications/Scripts/grid_fill_1.ncl script for
> my purposes, but the problem I get a number of errors in the plotting end
> of things (not the filling):
> fatal:ContourPlotDraw: Workspace reallocation would exceed maximum size
> 300000000
> fatal:ContourPlotDraw: draw error
> fatal:ContourPlotDraw: draw error
> fatal:PlotManagerDraw: error in plot draw
> fatal:_NhlPlotManagerDraw: Draw error
>
> I am using ncl version 6.2.1. I tried another version of the plot based
> off of http://www.ncl.ucar.edu/Applications/Scripts/grid_fill_2.ncl and
> it plots individual points rather than contour fills.
>
> I have a sample file and the script I am using ... let me know if you need
> me to send that to you.
>
> Thank you for any help!
> Archana
>
>
>
>
> On Thu, Nov 19, 2015 at 5:06 PM, Adam Phillips <asphilli at ucar.edu> wrote:
>
>> Hi Archana,
>> I do not believe there is a set method to help you come up with nscan and
>> epsx. Just trial and error. Yes, you will want to set is_cyclic to False if
>> your data is not global.
>>
>> poisson_grid_fill is a good choice for interpolation as it excels at
>> filling in data both within data boundaries and along the edges. I believe
>> it is the favored interpolation/extrapolation routine around here when
>> infilling is required.
>>
>> Hope that helps!
>> Adam
>>
>> On Wed, Nov 18, 2015 at 6:08 PM, Archana Dayalu <adayalu at seas.harvard.edu
>> > wrote:
>>
>>> Hello,
>>> I am fairly new to methods of interpolation, and am considering using
>>> poisson_grid_fill to interpolate missing values after I quality filtered
>>> some 500m MODIS reflectance data (MOD09A1 product). Is there a method to
>>> determine the optimal values for nscan and epsx? In addition, I am not
>>> working with a global data set, so that would indicate is.cyclic = FALSE if
>>> I understood that argument correctly?
>>> Thanks for any help.
>>> Regards,
>>> Archana
>>>
>>>
>>> _______________________________________________
>>> 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>
>>
>
>
>
> --
> ____________________________________________________
> *Archana Dayalu*
> Graduate Student
> Dept. of Earth and Planetary Sciences
> Harvard University
> 24 Oxford Street #402
> Cambridge, MA 02138
> (617) 384-8206
>



-- 
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/20151120/6a437eb6/attachment.html 


More information about the ncl-talk mailing list