[ncl-talk] Plotting station data as contour

MeteoBB info at meteo-bb.de
Tue Feb 5 19:44:11 MST 2019


Thanks for your answer.
I tried to regrid the data with ESMF. I'm happy with the results. Find 
attached pic ("regrid.png").
I think best result is the third plot (regrid with patch). Or what do 
you think?
Maybe also plot 2, because the patch-plot lost some data information 
when it "smoothes" the contour (see in the middle "-11.2").
All plots use "AreaFill"-mode.

Lastly, I wanted to test "*natgrid*", which fails. My code is as follows:

numxout = 50     ; Define output grid for call to "natgrids"
numyout = 50
xmin    = min(lon)
xmax    = max(lon)
ymin    = min(lat)
ymax    = max(lat)
xc      = (xmax-xmin)/(numxout-1)
yc      = (ymax-ymin)/(numyout-1)
xi      = xmin + ispan(0,numxout-1,1)*xc
yi      = ymin + ispan(0,numyout-1,1)*yc

zgrd = *natgrid*(lon, lat, data, xi, yi)
znat = transpose(zgrd)

znat at lat1d = yi
znat at lon1d = xi

plot = gsn_csm_contour_map(wks,znat,res)

My problem is that natgrid creates a 2D-Array with the new data values. 
No idea how how to pass "znat" to the contour function?
Can you help.

Regards,
MeteoBB

Am 05.02.2019 um 21:09 schrieb Dennis Shea:
> interpolation For plotting, interpolation to a grid is *NOT* necessary.
>
> *http://www.ncl.ucar.edu/Applications/station.shtml*
> Example 1
> ============
> *http://www.ncl.ucar.edu/Applications/contour1d.shtml*
> Examples 1 & 3
> ===============================================
> Keep in mind, *if you do not have physics to guide you*
>
> (1) there is *no substitute* for lots of data points.
> (2) extrapolation is *always* dangerous
> ================================================
> *Unstructured to Grid:*
>
> *https://www.ncl.ucar.edu/Applications/ESMF.shtml
> *
> Example 21
> =====
> *http://www.ncl.ucar.edu/Applications/contour1d.shtml*
>
> Some *interpolation* functions that may be of use.
> *
> *
> *http://www.ncl.ucar.edu/Document/Functions/Contributed/cssgrid_Wrap.shtml*
> *http://www.ncl.ucar.edu/Document/Functions/Contributed/obj_anal_ic_Wrap.shtml*
> *https://www.ncl.ucar.edu/Document/Functions/Contributed/triple2grid_Wrap.shtml*
>
> *See Examples 3 & 4*
> *https://www.ncl.ucar.edu/Applications/rdm2grid.shtml#ex3*
>
> On Tue, Feb 5, 2019 at 11:53 AM MeteoBB <info at meteo-bb.de 
> <mailto:info at meteo-bb.de>> wrote:
>
>     Thx Rick for your quick response.
>
>     Playing a little bit with the smooth-Parameter of the cn-resources
>     yields the plot attached.
>
>     *res at cnSmoothingOn        = True**
>     **res at cnSmoothingDistanceF = 0.005 ;(usw 0.005 ... 0.03)*
>
>     An area left is getting colored. (there is no station!)
>     This is risky i think, if I set the parameter (hardcoded). I never
>     know what the graphics will look like.
>
>     Do you think i should try interpolate the station data from my
>     unstructured grid to a rectilinear grid using *natgrid*?
>
>     MeteoBB
>
>     Am 05.02.2019 um 19:04 schrieb Rick Brownrigg:
>>     You might take a look at the several resources associated with
>>     "*cnSmoothingOn"
>>     *
>>
>>     HTH...Rick
>>     **
>>
>>     On Tue, Feb 5, 2019 at 10:22 AM MeteoBB <info at meteo-bb.de
>>     <mailto:info at meteo-bb.de>> wrote:
>>
>>         Hello,
>>
>>         I tried to plot station data of surface temperature on a map
>>         as a contour plot. I'm not satisfied with the result (see
>>         attached picture AreaFill.png).
>>         It all seems so angular. My grid is not regular because of
>>         the station data.
>>
>>         Switching from AreaFill to RasterFill results in a litte
>>         better plot (smooth contours) as you can see in the picture
>>         attached (RasterFill.png).
>>         *res at cnFillMode = "AreaFill"
>>         res at cnFillMode = "RasterFill"*
>>
>>         I tried to regrid the triangular mesh (unstructured) station
>>         data to a structured grid using *natgrid*?
>>         But it fails ...
>>
>>         Do you have any ideas for a better plot? Or what is the
>>         correct way to plot such station data as contour?
>>
>>         Regards
>>         MeteoBB
>>         _______________________________________________
>>         ncl-talk mailing list
>>         ncl-talk at ucar.edu <mailto: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 <mailto:ncl-talk at ucar.edu>
>     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/20190206/7ddb437e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: regrid.png
Type: image/png
Size: 123501 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190206/7ddb437e/attachment.png>


More information about the ncl-talk mailing list