Hi -
For this you need the polygon command. The script polymark.jnl makes
it easy to set up and plot a set of points. To see how to call it, type
GO/HELP polymark:
yes? go/help polymark
...
! Yes? GO polymark polygon_command xpts ypts [values] [shape] [scale]
The arguments to polymark are two lists of locations xpts and ypts, and
optionally values which will color the marks, the shape and size. Your
data is on a grid, so you need to get the locations of the stations
from the grid. If your data is in a netCDF file, and the variable is
called stations, then
yes? use my_data.nc
! mask variable is 1 where there is a station, and a
! missing-data flag everywhere else
yes? let mask = if stations then 1
! Define variables with the grid locations:
! xx is the X location of each grid point
! yy is the Y location of each grid point
yes? let xx = x[gx=stations] + 0*y[gy=stations]
yes? let yy = 0*x[gx=stations] + y[gy=stations]
! Now mask let each location according to whether a
! station is there
yes? let xxmask = mask* xx
yes? let yymask = mask* yy
! Form simple lists with the x and y locations
yes? let xpts = xsequence(xxmask)
yes? let ypts = xsequence(yymask)
! If the value of the station variable has something
! meaningful in it, you can color the polygons according
! to the station value. Make a list of all the stations
yes? let spts = xsequence(stations)
! You'll probably want a map underneath the polygons. The
! basemap script will draw you a map. (See GO/HELP basemap.jnl)
yes? GO basemap x=140w:360 y=-5:40 20
! Now call the polymark script to draw polygons. See POLYGON
! for more options like color, outline, and see polymark for
! the choices of shapes.
yes? GO polymark polygon/over/key xpts,ypts,spts,square,0.2
! Or, if the station variable is not meaningful, just leave it out:
yes? GO polymark polygon/over/key xpts,ypts,,square,0.2
yadu pokhrel wrote:
Dear all,
I have a gridded data set of observation stations. There are values
where there are observation stations and other cells are no-value. I
want to put some symbols (circle , square ets.) on the cells containing
the stations.
Can anyone suggest me how? Reference on the user's guide or FAQ
could be fine; I don't know the key words to search on the web.
Thanks in advance.
Pokhrel
On Mon, Feb 25, 2008 at 7:57 PM, Peter Szabo
< szabpet83@xxxxxxxxx>
wrote:
Hello
Ferret Users,
I have ascii files containing lines like this one (date, temp1, temp2,
temp3, precip):
1961-01-01 1.0 2.3 0.0 1.0
These different files correspond to different cities (different lat-lon
coordinates). I would like to make a netcdf file containg an
interpolated grid to this database.
A. I tried with this:
1. making a netcdf file for every city with these commands:
define axis/x=19.1:19.1/npoints=1 lon
define axis/y=47.3:47.3/npoints=1 lat
define axis/t=1:14610:1/npoints=14610/units=days time
define grid/x=lon/y=lat/t=time grid
file/ez/VARIABLES="datum1,datum2,t8,tx,tn,r"/grid=grid
"/home/szabop/moall/budapest.txt"
save/file="/home/szabop/moall/bu.nc" t8,tx,tn,r
and so on...
2. after this worked i tried to call all the files i made and
interpolate them onto a region, but did not succeed:
use "/home/szabop/moall/bu.nc"
...
define axis/x=16.0:23.0:0.1 newx !this is the region i want to
interpolate the "scattered" data
define axis/y=45.7:48.6:0.1 newy
let t8grid=SCAT2GRIDGAUSS_XY(x,y,t8,x[gx=newx],y[gy=newy],2,2,2,2)
save/file ...
B. I also tried with not writing out the ascii files to different
netcdf files, but trying to save them with the correct coordinates to
one big netcdf then i would be able to use the scat2gridgauss_xy
function! This worked neither.
define axis/x=19.1:19.1/npoints=1 lon
define axis/y=47.3:47.3/npoints=1 lat
define axis/t=1:14610:1/npoints=14610/units=days time
define grid/x=lon/y=lat/t=time grid
file/ez/VARIABLES="datum1,datum2,t8,tx,tn,r"/grid=grid
"/home/szabop/moall/budapest.txt"
save/file="/home/szabop/moall/6100.nc"/append/clobber/ILIMITS=16.0:23.0/JLIMITS=45.7:48.6
t8
cancel data/all
define axis/x=21.4:21.4/npoints=1 lon
and so on...
Anyone could help me?
Peter Szabo, HMS
|