[ncl-talk] Regridding irregularly spaced data onto a regular grid

zilore mumba zmumba at yahoo.com
Mon Jul 28 14:53:46 MDT 2014


Denis,
Thank you very much for all the work you have done for me.
This will provide me with learning material.
!. I have noted the very important points you make about the
dangers of extrapolation. This is
clearly illustrated by results from the different extrapolation methods you
used. Only the fifth (prc_objanal) of the six methods resembling what one would
expect from a look at the original data distribution, and to a lesser extent,
the sixth (prc_triple).
2. yes Grads does have
interpolation functions, but I did not try them (not really sure they would do what I want as I had the impression the functions deal with data on an already
regular grid).
I feel deeply indebted to
your effort.
Zilore Mumba


On Monday, July 28, 2014 9:33 PM, Dennis Shea <shea at ucar.edu> wrote:
 


I ttook a look at this.

[1]
Obviously, there are not many data points. Further, they are not well distributed. Unless there is a physical basis to guide extrapolating values beyond the data boundaries, you should go by the rule: All data extrapolation is dangerous and should be avoided. Use of extrapolated values on subsequent analysis tasks contaminates the results. In particular by people who do not know the original random data distribution.

[2]

Different interpolation algorithms, will yield different results depending of what method (eg, splines) are being used.

[3]

You mention "writing to binary and then contour in grads with which am more familiar.". I am sure GrADS has interpolation alogrithms for randomly based data. Not sure why these were not used.


Anyway, 'writing in binary' ... GrADS can read flat binary (access=direct) or fortran sequential (fortran default).

Did you go to NCL's IO functions? [Under Functions: Click Category; then, File Input/Output] You would see NCL's suite of IO functions. The attached script uses fbinrecwrite (fortran sequential)


The attached script shows results from several NCL interpolating (regridding) functions. The ESMF is very strict in the sense it will not extrapolate beyond data boundaries. All othe points are set to _Fillvalue.


Respond only to ncl-talk.

===

http://www.ncl.ucar.edu/Document/Manuals/

Download/Read: Mini-Language Manual


Good luck








On Sun, Jul 27, 2014 at 2:32 AM, zilore mumba <zmumba at yahoo.com> wrote:

Dave,
>Once more thanks very much for your effort and time. You have moved me closer to the solution. Please see, in the attachment, the output I get from the script you sent me.
>I will work with this and see if I can move. I have seen the ESMF gridding examples, they can take me ages to decipher what to do.
>
>
>
>On Sunday, July 27, 2014 3:13 AM, Dave Allured - NOAA Affiliate <dave.allured at noaa.gov> wrote:
> 
>
>
>Zilore,
>
>Sorry, that example #1 is not set up correctly for your kind of data.  Try the attached script.  This is another triangular mesh example that does use need extra coordinate arrays.
>
>If you still want to regrid, then I found that ESMF regridding example works easily with your sample data.
>
>http://www.ncl.ucar.edu/Applications/ESMF.shtml#ex21
>
>--Dave
>
>
>
>On Sat, Jul 26, 2014 at 5:24 PM, Dave Allured - NOAA Affiliate <dave.allured at noaa.gov> wrote:
>>
>> Zilore,
>>
>> Please look at the first example on the Station Data example page:
>> http://www.ncl.ucar.edu/Applications/station.shtml
>>
>> You said that you wanted to plot contours.  This simple example plots contours WITHOUT first putting data on a regular grid.  It uses a triangular mesh plotting technique.  For irregular coordinates, this technique will actually make a more accurate contour map than one made from a regular grid.
>>
>> Will this example meet your needs?  My apologies if this was already discussed previously.
>>
>> --Dave
>>
>>
>> On Sat, Jul 26, 2014 at 4:40 PM, zilore mumba <zmumba at yahoo.com> wrote:
>>>
>>> I have x,y,z data on an irregularly spaced geographical grid, which I want to put on a regular grid to be able to plot contours.
>>> My data is below (id, long., lat., rainfall).
>>> 01  28.92  -2.47  286.5
>>> 02  29.02  -2.68  168.8
>>> 03  29.25  -1.67  243.4
>>> 04  29.42  -2.07  204.9
>>> 05  29.55  -1.58  286.9
>>> 06  29.57  -2.48  230.
>>> 07  29.6   -1.5   177.5
>>> 08  29.72  -2.18  290.
>>> 09  30.05  -1.6   206.5
>>> 10  30.13  -1.97  178.1
>>> 11  30.5   -2.15  156.7
>>> My sincere apologies because this is a question I already asked more than 6 months ago and I still have not found a solution.
>>> The question is: Is it possible to do what I want to do in ncl?
>>> 1. I have tried 2dgrid.ncl which seems to but am not able to figure out how to write output to file, and the z values all seem to be above 370 (well above what I have in my file).
>>> 2. I have try the Fortran single precision linear interpolation at Natgrid Examples and run the fortran program with ncargf77 filename I get the errors below:
>>> Advice will be appreciated.
>>>
>>> ncargf77 natgrid.f
>>> gfortran -fPIC -fno-second-underscore -fno-range-check -fopenmp -O natgrid.f -L/usr/local/lib -L/usr/X11R6/lib64 -lncarg -lncarg_gks -lncarg_c -lX11 -lXext -lcairo -lfontconfig -lpixman-1 -lfreetype -lexpat -lpng -lz -liconv -lXrender -lbz2
>>> /usr/bin/ld: cannot find -lX11
>>> /usr/bin/ld: cannot find -lXext
>>> /usr/bin/ld: cannot find -lcairo
>>> /usr/bin/ld: cannot find -lfontconfig
>>> /usr/bin/ld: cannot find -lpixman-1
>>> /usr/bin/ld: cannot find -lfreetype
>>> /usr/bin/ld: cannot find -lexpat
>>> /usr/bin/ld: cannot find -liconv
>>> /usr/bin/ld: cannot find -lXrender
>>> /usr/bin/ld: cannot find -lbz2
>>> collect2: error: ld returned 1 exit status
>>>
>>>  
>>>  
>>>  
>>>  
>>>  
>>>  
>>> Natgrid Examples
>>> Natgrid examples Overview This module contains source codes for all of the examples referenced by the other modules in the documentation. Links to all of the example plots are provided.
>>> View on w3.pppl.gov
>>> Preview by Yahoo
>
>
>
>
>_______________________________________________
>ncl-talk mailing list
>List instructions, subscriber options, unsubscribe:
>http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140728/bf0cec1c/attachment.html 


More information about the ncl-talk mailing list