[ncl-talk] Error with natgrid

Mary Haley haley at ucar.edu
Wed Oct 17 09:49:30 MDT 2018


Dear Mario,

Welcome to ncl-talk!

First, to fill the areas in your map, you don't want to set:

    res at mpFillOn                  = False

because this turns *off* map fill.  If you comment that line out or set it
to True, then your land will be filled in gray by default. You can change
the color of the land with:

  res at mpLandFillColor = "green"     ; or whatever color you want

For more information on graphics in NCL, I highly recommend two things:

1. Look over the examples on the Applications page:

http://www.ncl.ucar.edu/Applications/

In particular, this page has lots of examples on how to control your map
outlines and change the fill color:

http://www.ncl.ucar.edu/Applications/maponly.shtml


2. Read the NCL User Guide, which has an excellent tutorial for people just
starting out with NCL graphics:

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

The warnings you are getting likely come from your lat/lon coordinate
arrays not have a units of "degrees_north" and "degrees_east". In order to
correctly plot data on a map, NCL requires that the lat/lon coordinate
arrays attached to your data have these units.

You can verify whether your coordinates have the correct units by adding
these two lines to your script:

printVarSummary(TDAY2013&lon)
printVarSummary(TDAY2013&lat)

If the units don't look correct, then you can fix them with:

TDAY2013&lon at units = "degrees_north"
TDAY2013&lon at units = "degrees_east"

BTW, If you ever get an NCL error message you don't understand, then you
can go to the NCL home page:

http://www.ncl.ucar.edu

and hover your mouse over on "Support" in the black bar. This brings up a
pull-down menu that has "Error messages".  On that page, you will find
several common error messages, what causes them, and how to fix them.

Lastly, we have an examples page on plotting data on a map that is useful
for beginners.  It is also part of the Application suite of examples:

http://www.ncl.ucar.edu/Applications/plot_data_on_map.shtml

Hope this helps you get started!

--Mary





On Tue, Oct 16, 2018 at 2:37 PM, Mario Rossi <yashi4891 at hotmail.com> wrote:

> Hi all,
>
> this if my first post and i'm quit new to ncl.
> I'm trying to plot weather station data of my network (about 95 weather
> stations).
> I started with this example https://www.ncl.ucar.
> edu/Applications/station.shtml using my data (a .dat file with 4 coulumn:
> id,lat,lon,temperature).
>
> I correclty plot the data and i can see the map but i still have some
> concerne that i do not catch very well:
>
> -How can i "fill" the map with data till the coastline, or in general,
> fill an entire region of a country? (attached image)
>
> Once i will understand how to fix the point above,i would like to make a
> further step, interpolating the data using natgrid, so i started from the
> code used above and modified it but i have the following error:
>
> (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' 'de
> greesE' 'deg east'
>
>
> Attached you will find the code that return this error containing the
> interpolation code with natgrid (test.ncl)
>
> Any help will be very appreciated.
> Thank you guys!
>
>
> _______________________________________________
> ncl-talk mailing list
> 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/20181017/153f809f/attachment.html>


More information about the ncl-talk mailing list