[GRASSLIST:4054] Re: sites handling specialist ?

Thomas Dewez thomas.dewez at brunel.ac.uk
Mon Jul 8 14:12:21 EDT 2002


Thanks,

I tried an option slightly different than the one you proposed. I had not
realized that site data was always stored as an ASCII.

Here is the single line command I executed


paste file1 file2 | awk -F"|" '{if ($3!=-9999) print $1"|"$2"|"$3"|"$6}' >
outfile

The test on $3 is simply to remove the NULL values from my sites file. It
took a while to process on an Sun Ultra10 440MHz but it did the trick (huge
file).

Thomas
----- Original Message -----
From: "Crudeli" <crudeli at mail.nauta.it>
To: <GRASSLIST at baylor.edu>
Sent: Saturday, July 06, 2002 1:18 PM
Subject: [GRASSLIST:4043] Re: sites handling specialist ?


> >Dear list,
> >
> >Pardon me to insist with this issue. Does any of you know how to append
> >attributes to sites coverages?
> >I have two raster coverage, one providing the elevation of the sites, the
> >second providing the precision of their elevation. I would like to use
the
> >precision to tune the smoothing parameter of the RST. I understand that I
> >have to have one coverage containing both field in order to proceed to
the
> >interpolation. Is this correct?
> >If the conversion of raster to site format can only deal with one field
at a
> >time, how can I merge two sites coverages later on? It ought to be
> >possible... surely (???)
> >
> >By the way, I know I could simply create two ascii files and mess with
them
> >manually but is there a more elegant way?
>
> sure: you can use the shell "join" command:
> if your format is
> file1: x y z
> file2: x y precision
> and assuming that the (x,y) in the first file are the same as the
> ones in the second file,
> try
> _______________________________________________
> # the following is for avoiding mistakes between two sites
> #with the same x or y
>
> cat file1 | awk '{print $1"_"$2, $3 }' |sort>file1.xy
> cat file2 | awk '{print $1"_"$2, $3 }' |sort>file2.xy
>
> join file1.xy file2.xy | tr "_" " " > file.xyzP
> s.in.ascii fs=space file.xyzP
> rm -f file1.xy, file2.xy
> _______________________________________________
>
> you then have to set the proper "d" switch to the s.in.ascii.
>
> BTW, if you don't have the original ascii files (file1 and file2),
> used to interpolate your rasters, or their (x,y) are not
> corresponding, you can always use s.sample on both maps with the same
> sites. For istance:
> _______________________________________________
> s.sample sitesfile XYZ_raster> file1
> s.sample sitesfile Precision_raster> file2
> _______________________________________________
>
> Hope this helps,
>
> RafDouglas CTC
>
> --
> __________________________________________
> RafDouglas Candidi Tommasi Crudeli
>
> ct at ehleng.com
>
> "To know, to will, to dare, to be silent."
>
>



More information about the grass-user mailing list