![]() ![]() Lon = np.random.uniform(low=lllon+2, high=urlon-2, size=n) Lat = np.random.uniform(low=lllat+2, high=urlat-2, size=n) # Make some toy data, random points + corners It can be greatly improved by creating a mask from a shapefile and, as mentioned, a sensitive use of interpolation method. I think that GIS would be the first approach, but as you asked for some Python commands, here is a sloppy example of how to use Python, basemap and scipy for your application. Probably, you'd like to spend some effort on picking the right interpolation method and make sure that your grid is the best estimate for the actual values. GMT should also able to make what you need and there is a python interface, at least under development. ![]() There are some tutorials that can put you on the right track. You can also use R, that might be a smart solution if you intend to do some more demanding statistical analysis later. For more complicated spatial processes (clip a raster from a vector polygon e.g.) GDAL is a great library. numpy and scipy are good packages for interpolation and all array processes. Python is also free and there is a great community at SE and elsewhere. This will somehow give you more control of your workflow. cities or extract the interpolated temperature for a location.Īlternatively (according to your updated question), you can use Python. With a GIS option, it is easy to also plot e.g. ![]() A few searches at GIS SE can help you out if you get stuck. Download a free coastline vector and clip your raster with the coastline. Add delimited text layer and try raster interpolation. The easiest solution for this simple task would be to use a GIS software, e.g. I suggest you play with each to see what yields the best result for your dataset. Besides linear, this can also be cubic or nearest. Notice also the method argument to griddata. You should replace this mask with the landmask on your grid. This example includes a simple way to mask the field. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |