[ncl-talk] NCL plot problem with ascii data

MM Ali mmali110 at gmail.com
Fri Apr 5 19:50:19 MDT 2019


Hello Dennis,

As suggested by you, I posted the problem of "Cannot create triangular
mesh" to ncl-install group. Since the attached ce1.ncl is perfectly working
I get a doubt whether the problem is of installation. The program used .nc
file as input.  Please suggest.

Ali

On Fri, Apr 5, 2019 at 10:35 PM MM Ali <mmali110 at gmail.com> wrote:

> Dear Dennis,
>
> ncl -V gave  6.5.0
> and uname -a gave
>
> Linux elnino-vm.coaps.fsu.edu 4.19.15-300.fc29.x86_64 #1 SMP Mon Jan 14
> 16:32:35 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
>
> I do not use the linux system directly. I connect my laptop to the system
> through xming or nxclient. Both give the same error. Since you are able to
> run in your system having 6.5.0 version, I feel the error I get is because
> of the xming or nxclient problem. The program creates land filled with gray
> and the entire ocean portion filled with black. The error is:
>
> fatal:Cannot create triangular mesh: supply additional resources or build
> with Triangle package
> fatal:ContourPlotDraw: draw error
> fatal:ContourPlotDraw: draw error
> fatal:PlotManagerDraw: error in plot draw
> fatal:_NhlPlotManagerDraw: Draw error
> fatal:Cannot create triangular mesh: supply additional resources or build
> with Triangle package
> fatal:ContourPlotDraw: draw error
> fatal:ContourPlotDraw: draw error
> fatal:PlotManagerDraw: error in plot draw
> fatal:_NhlPlotManagerDraw: Draw error
> fatal:Cannot create triangular mesh: supply additional resources or build
> with Triangle package
> fatal:ContourPlotDraw: draw error
> fatal:ContourPlotDraw: draw error
> fatal:ContourPlotDraw: draw error
> fatal:PlotManagerDraw: error in plot draw
> fatal:_NhlPlotManagerDraw: Draw error
>
> I will be thankful who got a similar problem can help me.
>
> On Fri, Apr 5, 2019 at 5:25 PM Dennis Shea <shea at ucar.edu> wrote:
>
>> I used NCL 6.5.0 The oldest version of NCL that I have available is 6.3.0
>> [4+ years old].
>>
>> The script runs on both versions. There is no way to retrofit to an old
>> version.
>>
>> %> ncl -V
>> %> uname -a
>>
>> will provide useful information
>>
>> Ypu must post installation questions to the ncl-install at ucar.edu to
>> which you must subscribe. See
>>
>> *http://www.ncl.ucar.edu/Support/email_lists.shtml*
>> <http://www.ncl.ucar.edu/Support/email_lists.shtml>
>>
>> I do not help with installation questions.
>>
>> Good luck
>>
>>
>> On Thu, Apr 4, 2019 at 9:13 PM MM Ali <mmali110 at gmail.com> wrote:
>>
>>> Hello Dennis,
>>>
>>> Thank you very much for your elaborate explanation and particularly for
>>> correcting my manuscript. When I ran the edited code, I get the following
>>> error:
>>>
>>> fatal:Cannot create triangular mesh: supply additional resources or
>>> build with Triangle package
>>> fatal:ContourPlotDraw: draw error
>>> fatal:ContourPlotDraw: draw error
>>> fatal:PlotManagerDraw: error in plot draw
>>> fatal:_NhlPlotManagerDraw: Draw error
>>> fatal:Cannot create triangular mesh: supply additional resources or
>>> build with Triangle package
>>> fatal:ContourPlotDraw: draw error
>>> fatal:ContourPlotDraw: draw error
>>> fatal:PlotManagerDraw: error in plot draw
>>> fatal:_NhlPlotManagerDraw: Draw error
>>>
>>> Please suggest the changes in the code.
>>>
>>> Best regards
>>> Ali
>>>
>>> On Fri, Apr 5, 2019 at 5:44 AM Dennis Shea <shea at ucar.edu> wrote:
>>>
>>>> As ncl-talk always mentions: The 1st rule of data processing is: *Look
>>>> at your data!*
>>>>
>>>> [1]
>>>> The data look like they are sub-sampled from a gridded dataset. Given
>>>> the distribution of the locations, I would call this a 'ragged-2d-array.'
>>>> Specifically: each latitude  has a different number of points; each
>>>> longitude has a different number of points. See plots.
>>>>
>>>> [2]
>>>> Due to the ordering of the values on the ascii file, coordinate value
>>>> syntax [ *&* ] should not be used. Specifically, the latitude and
>>>> longitude values are not monotonic which is a requirement for coordinate
>>>> arrays.
>>>>
>>>> [3]
>>>> The the values are between 100E and 70W. For a limited region, I find
>>>> is easier in this instance to use all positive longitudes [or all negative
>>>> longitudes]. Hence, I changed a longitude range of 100 to 290.
>>>>
>>>> longitude = *where*
>>>> <http://www.ncl.ucar.edu/Document/Functions/Built-in/where.shtml>(longitude.lt.0,
>>>> longitude+360, longitude)
>>>>
>>>> [4]
>>>>
>>>> For graphics, NCL requires ragged arrays to be treated as an array of
>>>> random locations [eg: station data].
>>>>
>>>>   res*@*sfXArray = longitude  ; data values are irregularly spaced
>>>>   res*@*sfYArray  = latitude
>>>>
>>>> [5]
>>>>
>>>> The *gsn_coordinates* graphics utility which plot markers at each
>>>> location requires that the 1d latitude/longitude be attributes to the
>>>> variable being plotted:
>>>>
>>>>   variable*@lon1d*  = longitude
>>>>   variable*@lat1d*   = latitude
>>>> *  gsn_coordinates
>>>> <http://www.ncl.ucar.edu/Document/Graphics/Interfaces/gsn_coordinates.shtml>*(wks,contour,variable,mkres)
>>>>
>>>>
>>>> [6]
>>>>
>>>> The plots alternate between *cnFillMode*
>>>> <http://www.ncl.ucar.edu/Document/Graphics/Resources/cn.shtml#cnFillMode>
>>>> using the default  cnFillMode="AreaFill" and cnFillMode="RasterFill"
>>>>
>>>> In this case, I suggest cnFillMode="RasterFill"
>>>>
>>>> [7] For values that span 0.0, color palettes with *White-in-the-middle*
>>>> <http://www.ncl.ucar.edu/Document/Graphics/color_table_gallery.shtml>
>>>> work best
>>>> ======
>>>>
>>>> *%> ncl*  MMali.ncl
>>>>
>>>> =====
>>>>
>>>> Good luck
>>>>
>>>>
>>>> On Thu, Apr 4, 2019 at 10:06 AM Toni Klemm <toni-klemm at tamu.edu> wrote:
>>>>
>>>>> Hi Ali,
>>>>>
>>>>> I had this problem before. Since you extracted lat and lon data from
>>>>> ASCII, it might be that your data doesn’t have metadata information
>>>>> attached that tells NCL what it is (i.e., latitudes and longitudes).
>>>>> Without that it is just a bunch of numbers for NCL. You can add this
>>>>> metadata by adding this to your code after you extract your latitude and
>>>>> longitude variables:
>>>>>
>>>>>   latitude!0 = "lat"
>>>>>   latitude&lat = lat
>>>>>   latitude at long_name = "latitude"
>>>>>   latitude at units = "degrees_north"
>>>>>
>>>>>   longitude!0 = "lon"
>>>>>   longitude&lon = lon
>>>>>   longitude at long_name = "longitude"
>>>>>   longitude at units = "degrees_east"
>>>>>
>>>>> Hope that helps,
>>>>> Toni
>>>>>
>>>>>
>>>>>
>>>>> *Toni Klemm, Ph.D.*Postdoctoral Research Associate
>>>>> Department of Ecosystem Science and Management
>>>>> College of Agriculture and Life Sciences
>>>>> Texas A&M University, College Station, TX
>>>>> Contributor to the Early Career Climate Forum
>>>>> <http://www.eccforum.org>
>>>>> www.toni-klemm.de | @toniklemm <http://twitter.com/toniklemm>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Apr 4, 2019, at 2:00 AM, MM Ali <mmali110 at gmail.com> wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> I modified the ce_3.ncl code to read the ascii data. Data and the
>>>>> modified ncl code are attached. The variables in the data are dummy,
>>>>> latitude, longitude, variable, dummy2. I get the following errors
>>>>>
>>>>> (0)     check_for_y_lat_coord: Warning: Data either does not contain
>>>>> (0)     a valid latitude coordinate array or doesn't contain one at
>>>>> all.
>>>>> (0)     A valid latitude coordinate array should have a 'units'
>>>>> (0)     attribute equal to one of the following values:
>>>>> (0)         'degrees_north' 'degrees-north' 'degree_north' 'degrees
>>>>> north' 'degrees_N' 'Degrees_north' 'degree_N' 'degreeN' 'degreesN' 'deg
>>>>> north'
>>>>> (0)     check_for_lon_coord: Warning: Data either does not contain
>>>>> (0)     a valid longitude coordinate array or doesn't contain one at
>>>>> all.
>>>>> (0)     A valid longitude coordinate array should have a 'units'
>>>>> (0)     attribute equal to one of the following values:
>>>>> (0)         'degrees_east' 'degrees-east' 'degree_east' 'degrees east'
>>>>> 'degrees_E' 'Degrees_east' 'degree_E' 'degreeE' 'degreesE' 'deg east'
>>>>> (0)     Error: scalar_field: If the input data is 1-dimensional, you
>>>>> must set sfXArray and sfYArray to 1-dimensional arrays of the same length.
>>>>> warning:create: Bad HLU id passed to create, ignoring it
>>>>>
>>>>> Please help. It would be great if the necessary corrections are made
>>>>> to the code (I am just a few days old for NCL, though 66+ years old!)
>>>>> Thanks
>>>>> Ali
>>>>> *Dr. MM Ali*
>>>>> Formerly:
>>>>> Scientist G & Group Director
>>>>> NRSC/ISRO
>>>>> email: mmali110 at gmail.com
>>>>>            mmali at coaps.fsu.edu
>>>>> Mob: +91 9949045110
>>>>> <may.txt><ce3.ncl>_______________________________________________
>>>>> 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
>>>>>
>>>>
>>>
>>> --
>>> *Dr. MM Ali*
>>> Formerly:
>>> Scientist G & Group Director
>>> NRSC/ISRO
>>> email: mmali110 at gmail.com
>>>            mmali at coaps.fsu.edu
>>> Mob: +91 9949045110
>>>
>>
>
> --
> *Dr. MM Ali*
> Formerly:
> Scientist G & Group Director
> NRSC/ISRO
> email: mmali110 at gmail.com
>            mmali at coaps.fsu.edu
> Mob: +91 9949045110
>


-- 
*Dr. MM Ali*
Formerly:
Scientist G & Group Director
NRSC/ISRO
email: mmali110 at gmail.com
           mmali at coaps.fsu.edu
Mob: +91 9949045110
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190406/372bc488/attachment.html>


More information about the ncl-talk mailing list