[GRASSLIST:2633] interpolation of area precipitation with s.surf.idw

Dear GRASS users,

I'm trying to interpolate area precipitation maps with s.surf.idw in
5-minute-steps. I have rain gage data in 5-minute steps for several
stations. Unfortunately not every station has recorded the whole time I'm
interested in. Is it possible to fill these gaps with something like "no
data" and/or is there an option for s.surf.idw which excludes the stations
with no recorded data at this time step. Any suggestions? Thank you in
advance for any help.

Hello

On Mon, 16 Feb 2004, Alexander Fritz wrote:

Dear GRASS users,

I'm trying to interpolate area precipitation maps with s.surf.idw in
5-minute-steps. I have rain gage data in 5-minute steps for several
stations. Unfortunately not every station has recorded the whole time I'm
interested in.

Is it possible to fill these gaps with something like "no
data" and/or is there an option for s.surf.idw which excludes the stations
with no recorded data at this time step. Any suggestions?

The whole purpose of interpolation is to fill regions with no recorded
data by interpolating from the surrounding data points. So the concept of
a 'no-data' area in the output doesn't really make sense, IMHO.

Maybe try to define more clearly what you need and think about how you
would define the area with no data. Perhaps s.voronoi and v.to.rast; use
that as a MASK? I presume you have a different sites file for each 5
minute interval and each has all the sites in it but some of them have
missing attributes? In that case, does s.surf.idw not simply ignore the
sites that have missing attributes and interpolate from the rest? (if it
doesn't, please report it as a bug and I might have time too look at it.) You
could run it like this and then mask your output using the results from
s.voronoi or something like that.

But I would think about how best to define your 'no-data' area for each
time interval and if it really makes sense to do that.

Hello,

I ran into the same problem last week, but using daily
data. Some stations did not have data for a specific
day and so forth, that means, depending on the day,
you have a different set of data. The problem is that,
you can't put zero for a station with no observation
since 0 rainfall is different from no data!!!

What I did is, using postgree, I get only the rainfall
that contain observations for one day, create a
separate sites file for that day and, interpolate and
then move to the next day. All this can be done using
a very simple bash script.

Of course, if there where a nodata value for sites, we
could use only one site file for all data, but I don't
know if there is such thing...

--- Alexander Fritz <Alex_Fritz@gmx.net> wrote:

Dear GRASS users,

I'm trying to interpolate area precipitation maps
with s.surf.idw in
5-minute-steps. I have rain gage data in 5-minute
steps for several
stations. Unfortunately not every station has
recorded the whole time I'm
interested in. Is it possible to fill these gaps
with something like "no
data" and/or is there an option for s.surf.idw which
excludes the stations
with no recorded data at this time step. Any
suggestions? Thank you in
advance for any help.

__________________________________
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html

Hello Daniel

On Mon, 16 Feb 2004, Daniel Victoria wrote:

Of course, if there where a nodata value for sites, we
could use only one site file for all data, but I don't
know if there is such thing...

Well, you can make a line in the site_lists file that has only an easting
and northing and no attribute, something like:

1|1| %2
1|2|
2|1| %2
2|2| %2

where the site at easting=1 northing=2 has no data, but the way it is
treated will depend on the GRASS module used.

The following patch to s.surf.idw will allow it to continue on past the
missing data line and read all the sites:

Index: read_sites.c

RCS file: /grassrepository/grass/src/sites/s.surf.idw/cmd/read_sites.c,v
retrieving revision 1.4
diff -u -r1.4 read_sites.c
--- read_sites.c 10 Apr 2003 13:08:20 -0000 1.4
+++ read_sites.c 16 Feb 2004 12:22:17 -0000
@@ -50,7 +50,7 @@
       G_warning("I'm finding records that do not have a floating point attributes (fields prefixed with '%').");
     }

- while (G_site_get(fd, site) >= 0)
+ while (G_site_get(fd, site) != EOF)
     {
   newpoint(site->dbl_att[field],site->east,site->north);
         if(!(npoints%1000))

but I don't think it's the way forward; just a quick hack to get around
this problem. Maybe G_readsites_xyz() holds some clues to a better way to
read sites files. I have never really looked at it and must do so
some time.

Paul

Hi all,

This would work fine if I had only one attribute for
each site, but I have more than one so I'd need a
placeholder for the places with no data. Or, my
workaround was to use one sites file for each
attribute and not import the points with no data...
works fine...

But this is what I noticed.
Since I'm importing the sites into GRASS with
s.in.ascii, I tried - with no success - put a string
(NODATA) as a placeholder but s.in.ascii switched the
string around and put it at the end of the sites
attribute line... Is this normal behavior or am I
going crazy?

This is what happened. The text input file:
-60,-18,NULL,1995,1,1,852450,Santa cruz/el tromp

The sites file:
60W|18S|#1 %1995 %1 %1 %852450 @NULL ....

As you can see, the year became the first fiels and
the NULL whent to the end of the line

Daniel

--- Paul Kelly <paul-grass@stjohnspoint.co.uk> wrote:

Hello Daniel

On Mon, 16 Feb 2004, Daniel Victoria wrote:

> Of course, if there where a nodata value for
sites, we
> could use only one site file for all data, but I
don't
> know if there is such thing...

Well, you can make a line in the site_lists file
that has only an easting
and northing and no attribute, something like:

1|1| %2
1|2|
2|1| %2
2|2| %2

where the site at easting=1 northing=2 has no data,
but the way it is
treated will depend on the GRASS module used.

The following patch to s.surf.idw will allow it to
continue on past the
missing data line and read all the sites:

Index: read_sites.c

===================================================================

RCS file:

/grassrepository/grass/src/sites/s.surf.idw/cmd/read_sites.c,v

retrieving revision 1.4
diff -u -r1.4 read_sites.c
--- read_sites.c 10 Apr 2003 13:08:20 -0000 1.4
+++ read_sites.c 16 Feb 2004 12:22:17 -0000
@@ -50,7 +50,7 @@
       G_warning("I'm finding records that do not
have a floating point attributes (fields prefixed
with '%').");
     }

- while (G_site_get(fd, site) >= 0)
+ while (G_site_get(fd, site) != EOF)
     {

newpoint(site->dbl_att[field],site->east,site->north);

         if(!(npoints%1000))

but I don't think it's the way forward; just a quick
hack to get around
this problem. Maybe G_readsites_xyz() holds some
clues to a better way to
read sites files. I have never really looked at it
and must do so
some time.

Paul

__________________________________
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html

Hello I'm not very familar with postgre. Does that mean that I have to set
up an SQL database?

-----Original Message-----
From: daniel_victoria@yahoo.com [mailto:daniel_victoria@yahoo.com]
Sent: Monday, February 16, 2004 1:09 PM
To: Alexander Fritz; 'GRASS_list'
Subject: Re: [GRASSLIST:2633] interpolation of area precipitation with
s.surf.idw

Hello,

I ran into the same problem last week, but using daily
data. Some stations did not have data for a specific
day and so forth, that means, depending on the day,
you have a different set of data. The problem is that,
you can't put zero for a station with no observation
since 0 rainfall is different from no data!!!

What I did is, using postgree, I get only the rainfall
that contain observations for one day, create a
separate sites file for that day and, interpolate and
then move to the next day. All this can be done using
a very simple bash script.

Of course, if there where a nodata value for sites, we
could use only one site file for all data, but I don't
know if there is such thing...

--- Alexander Fritz <Alex_Fritz@gmx.net> wrote:

Dear GRASS users,

I'm trying to interpolate area precipitation maps
with s.surf.idw in
5-minute-steps. I have rain gage data in 5-minute
steps for several
stations. Unfortunately not every station has
recorded the whole time I'm
interested in. Is it possible to fill these gaps
with something like "no
data" and/or is there an option for s.surf.idw which
excludes the stations
with no recorded data at this time step. Any
suggestions? Thank you in
advance for any help.

__________________________________
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html

Well,

That was my solution to the problem and, even though
not perfect, it works...

Setting the postgre is very simple, I had no clue as
to how it workd until last week...

If you need any help just send me an e-mail

Cheers

Daniel
--- Alexander Fritz <Alex_Fritz@gmx.net> wrote:

Hello I'm not very familar with postgre. Does that
mean that I have to set
up an SQL database?

-----Original Message-----
From: daniel_victoria@yahoo.com
[mailto:daniel_victoria@yahoo.com]
Sent: Monday, February 16, 2004 1:09 PM
To: Alexander Fritz; 'GRASS_list'
Subject: Re: [GRASSLIST:2633] interpolation of area
precipitation with
s.surf.idw

Hello,

I ran into the same problem last week, but using
daily
data. Some stations did not have data for a specific
day and so forth, that means, depending on the day,
you have a different set of data. The problem is
that,
you can't put zero for a station with no observation
since 0 rainfall is different from no data!!!

What I did is, using postgree, I get only the
rainfall
that contain observations for one day, create a
separate sites file for that day and, interpolate
and
then move to the next day. All this can be done
using
a very simple bash script.

Of course, if there where a nodata value for sites,
we
could use only one site file for all data, but I
don't
know if there is such thing...

--- Alexander Fritz <Alex_Fritz@gmx.net> wrote:
> Dear GRASS users,
>
> I'm trying to interpolate area precipitation maps
> with s.surf.idw in
> 5-minute-steps. I have rain gage data in 5-minute
> steps for several
> stations. Unfortunately not every station has
> recorded the whole time I'm
> interested in. Is it possible to fill these gaps
> with something like "no
> data" and/or is there an option for s.surf.idw
which
> excludes the stations
> with no recorded data at this time step. Any
> suggestions? Thank you in
> advance for any help.
>

__________________________________
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing
online.
http://taxes.yahoo.com/filing.html

__________________________________
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html