[GRASS-user] Questions on TGRASS; t.rast.gapfill , GRASS 71

sajid pareeth spareeth at gmail.com
Mon Feb 16 07:38:30 PST 2015


Hi Soeren

Thank you for the great addition; I tested with the test data and it works
as expected.
I will let you know if I find something unusual when I apply the command on
my data.


On the related topic, I have another query;
When I do t.rast.list with "method=gran" the "where" condition is not
working. With all the other methods it works.

Based on the same demo data;

> t.rast.list input=mapT3 column=name,start_time method=gran
> where="start_time > '2012-08-30 00:00:00'"
> id|name|mapset|start_time|end_time|interval_length|distance_from_begin
> map1 at ecmwf|map1|ecmwf|2012-08-20 00:00:00|2012-08-21 00:00:00|1.0|0.0
> gap_10_1 at ecmwf|gap_10_1|ecmwf|2012-08-21 00:00:00|2012-08-22
> 00:00:00|1.0|1.0
> map2 at ecmwf|map2|ecmwf|2012-08-22 00:00:00|2012-08-23 00:00:00|1.0|2.0
> gap_11_1 at ecmwf|gap_11_1|ecmwf|2012-08-23 00:00:00|2012-08-24
> 00:00:00|1.0|3.0
> gap_11_2 at ecmwf|gap_11_2|ecmwf|2012-08-24 00:00:00|2012-08-25
> 00:00:00|1.0|4.0
> map3 at ecmwf|map3|ecmwf|2012-08-25 00:00:00|2012-08-26 00:00:00|1.0|5.0
> gap_12_1 at ecmwf|gap_12_1|ecmwf|2012-08-26 00:00:00|2012-08-27
> 00:00:00|1.0|6.0
> gap_12_2 at ecmwf|gap_12_2|ecmwf|2012-08-27 00:00:00|2012-08-28
> 00:00:00|1.0|7.0
> gap_12_3 at ecmwf|gap_12_3|ecmwf|2012-08-28 00:00:00|2012-08-29
> 00:00:00|1.0|8.0
> map4 at ecmwf|map4|ecmwf|2012-08-29 00:00:00|2012-08-30 00:00:00|1.0|9.0
> gap_13_1 at ecmwf|gap_13_1|ecmwf|2012-08-30 00:00:00|2012-08-31
> 00:00:00|1.0|10.0
> gap_13_2 at ecmwf|gap_13_2|ecmwf|2012-08-31 00:00:00|2012-09-01
> 00:00:00|1.0|11.0
> gap_13_3 at ecmwf|gap_13_3|ecmwf|2012-09-01 00:00:00|2012-09-02
> 00:00:00|1.0|12.0
> gap_13_4 at ecmwf|gap_13_4|ecmwf|2012-09-02 00:00:00|2012-09-03
> 00:00:00|1.0|13.0
> map5 at ecmwf|map5|ecmwf|2012-09-03 00:00:00|2012-09-04 00:00:00|1.0|14.0
>

But when I change the method to any other type, say delta, it works

t.rast.list input=mapT3 column=name,start_time method=delta
> where="start_time > '2012-08-30 00:00:00'"
> id|name|mapset|start_time|end_time|interval_length|distance_from_begin
> gap_13_2 at ecmwf|gap_13_2|ecmwf|2012-08-31 00:00:00|2012-09-01
> 00:00:00|1.0|0.0
> gap_13_3 at ecmwf|gap_13_3|ecmwf|2012-09-01 00:00:00|2012-09-02
> 00:00:00|1.0|1.0
> gap_13_4 at ecmwf|gap_13_4|ecmwf|2012-09-02 00:00:00|2012-09-03
> 00:00:00|1.0|2.0
> map5 at ecmwf|map5|ecmwf|2012-09-03 00:00:00|2012-09-04 00:00:00|1.0|3.0
>
>
Regards

Sajid




On Mon, Feb 16, 2015 at 3:51 PM, Sören Gebbert <soerengebbert at googlemail.com
> wrote:

> Hi Sajid,
> until today, t.rast.gapfill did not support interpolation by granularity.
> However, please try revision r64651 in grass7.1 trunk. This feature
> has now been implemented and should work as you would expect.
> Of course, heavily testing is still needed.
>
> I am still investigating the case when no gaps are found using the
> where condition.
>
> Best regards
> Soeren
>
> 2015-02-05 19:23 GMT+01:00 sajid pareeth <spareeth at gmail.com>:
> > Hi
> > I am trying to use the module "t.rast.gapfill" to fill the gaps in my
> > temporal datasets. I have couple of doubts on getting my tasks done.
> >
> > I am using GRASS 71 svn, latest.
> >
> > ##Q1:
> >
> > In my temporal data , there are multiple continuous gaps. In this case,
> I am
> > not getting the interpolated results. Please check the below work flow:
> >
> > r.mapcalc expr="map1 = 1" --o
> > r.mapcalc expr="map2 = 3" --o
> > r.mapcalc expr="map3 = 5" --o
> > r.mapcalc expr="map4 = 7" --o
> > r.mapcalc expr="map5 = 9" --o
> > t.register type=raster maps=map1 start=2012-08-20 end=2012-08-21 --o
> > t.register type=raster maps=map2 start=2012-08-22 end=2012-08-23 --o
> > t.register type=raster maps=map3 start=2012-08-25 end=2012-08-26 --o
> > t.register type=raster maps=map4 start=2012-08-29 end=2012-08-30 --o
> > t.register type=raster maps=map5 start=2012-09-03 end=2012-09-04 --o
> > t.create type=strds temporaltype=absolute output=mapT1 title="test for
> all
> > the gaps filled together" description="test for all the gaps filled
> > together"
> > t.register type=raster input=mapT1 maps=map1,map2,map3,map4,map5 --o
> > t.rast.list input=mapT1 columns=name,start_time,min,max
> > t.rast.list input=mapT1 method=gran
> > id|name|mapset|start_time|end_time|interval_length|distance_from_begin
> > map1 at testtgrass|map1|testtgrass|2012-08-20 00:00:00|2012-08-21
> > 00:00:00|1.0|0.0
> > None|None|None|2012-08-21 00:00:00|2012-08-22 00:00:00|1.0|1.0
> > map2 at testtgrass|map2|testtgrass|2012-08-22 00:00:00|2012-08-23
> > 00:00:00|1.0|2.0
> > None|None|None|2012-08-23 00:00:00|2012-08-24 00:00:00|1.0|3.0
> > None|None|None|2012-08-24 00:00:00|2012-08-25 00:00:00|1.0|4.0
> > map3 at testtgrass|map3|testtgrass|2012-08-25 00:00:00|2012-08-26
> > 00:00:00|1.0|5.0
> > None|None|None|2012-08-26 00:00:00|2012-08-27 00:00:00|1.0|6.0
> > None|None|None|2012-08-27 00:00:00|2012-08-28 00:00:00|1.0|7.0
> > None|None|None|2012-08-28 00:00:00|2012-08-29 00:00:00|1.0|8.0
> > map4 at testtgrass|map4|testtgrass|2012-08-29 00:00:00|2012-08-30
> > 00:00:00|1.0|9.0
> > None|None|None|2012-08-30 00:00:00|2012-08-31 00:00:00|1.0|10.0
> > None|None|None|2012-08-31 00:00:00|2012-09-01 00:00:00|1.0|11.0
> > None|None|None|2012-09-01 00:00:00|2012-09-02 00:00:00|1.0|12.0
> > None|None|None|2012-09-02 00:00:00|2012-09-03 00:00:00|1.0|13.0
> > map5 at testtgrass|map5|testtgrass|2012-09-03 00:00:00|2012-09-04
> > 00:00:00|1.0|14.0
> >
> > # Doing the gapfill:
> > t.rast.gapfill input=mapT1 base=gap
> > t.rast.list input=mapT1 method=gran
> > id|name|mapset|start_time|end_time|interval_length|distance_from_begin
> > map1 at testtgrass|map1|testtgrass|2012-08-20 00:00:00|2012-08-21
> > 00:00:00|1.0|0.0
> > gap_10 at testtgrass|gap_10|testtgrass|2012-08-21 00:00:00|2012-08-22
> > 00:00:00|1.0|1.0
> > map2 at testtgrass|map2|testtgrass|2012-08-22 00:00:00|2012-08-23
> > 00:00:00|1.0|2.0
> > gap_11 at testtgrass|gap_11|testtgrass|2012-08-23 00:00:00|2012-08-24
> > 00:00:00|1.0|3.0
> > gap_11 at testtgrass|gap_11|testtgrass|2012-08-24 00:00:00|2012-08-25
> > 00:00:00|1.0|4.0
> > map3 at testtgrass|map3|testtgrass|2012-08-25 00:00:00|2012-08-26
> > 00:00:00|1.0|5.0
> > gap_12 at testtgrass|gap_12|testtgrass|2012-08-26 00:00:00|2012-08-27
> > 00:00:00|1.0|6.0
> > gap_12 at testtgrass|gap_12|testtgrass|2012-08-27 00:00:00|2012-08-28
> > 00:00:00|1.0|7.0
> > gap_12 at testtgrass|gap_12|testtgrass|2012-08-28 00:00:00|2012-08-29
> > 00:00:00|1.0|8.0
> > map4 at testtgrass|map4|testtgrass|2012-08-29 00:00:00|2012-08-30
> > 00:00:00|1.0|9.0
> > gap_13 at testtgrass|gap_13|testtgrass|2012-08-30 00:00:00|2012-08-31
> > 00:00:00|1.0|10.0
> > gap_13 at testtgrass|gap_13|testtgrass|2012-08-31 00:00:00|2012-09-01
> > 00:00:00|1.0|11.0
> > gap_13 at testtgrass|gap_13|testtgrass|2012-09-01 00:00:00|2012-09-02
> > 00:00:00|1.0|12.0
> > gap_13 at testtgrass|gap_13|testtgrass|2012-09-02 00:00:00|2012-09-03
> > 00:00:00|1.0|13.0
> > map5 at testtgrass|map5|testtgrass|2012-09-03 00:00:00|2012-09-04
> > 00:00:00|1.0|14.0
> >
> > For example; between 2012-08-29 and 2012-09-03 there are 4 days of gap,
> but
> > the gap filling is providing the same image at all the 4 gaps. It seems
> to
> > be generating only one image between two valid temporal images, no matter
> > how long the gap is!!
> >
> > So is the gap filling will work only for one gap between 2 valid temporal
> > images?
> >
> >
> > ###2.
> >
> > When I try to do gap fill with the "where" condition, I am getting no
> > results in some cases.
> > For example when I try:
> >
> > t.rast.gapfill input=mapT1 where="start_time = '2012-08-21 00:00:00'"
> > base=gap
> > No gaps found
> >
> > OR when I try;
> >
> > t.rast.gapfill input=mapT1 where="start_time > '2012-08-20 00:00:00'"
> > base=gap
> >
> > It misses the first gap and fills the other gap, see below:
> >
> > t.rast.list input=mapT1 method=gran
> > id|name|mapset|start_time|end_time|interval_length|distance_from_begin
> > map1 at testtgrass|map1|testtgrass|2012-08-20 00:00:00|2012-08-21
> > 00:00:00|1.0|0.0
> > None|None|None|2012-08-21 00:00:00|2012-08-22 00:00:00|1.0|1.0
> > map2 at testtgrass|map2|testtgrass|2012-08-22 00:00:00|2012-08-23
> > 00:00:00|1.0|2.0
> > gap_8 at testtgrass|gap_8|testtgrass|2012-08-23 00:00:00|2012-08-24
> > 00:00:00|1.0|3.0
> > gap_8 at testtgrass|gap_8|testtgrass|2012-08-24 00:00:00|2012-08-25
> > 00:00:00|1.0|4.0
> > map3 at testtgrass|map3|testtgrass|2012-08-25 00:00:00|2012-08-26
> > 00:00:00|1.0|5.0
> > gap_9 at testtgrass|gap_9|testtgrass|2012-08-26 00:00:00|2012-08-27
> > 00:00:00|1.0|6.0
> > gap_9 at testtgrass|gap_9|testtgrass|2012-08-27 00:00:00|2012-08-28
> > 00:00:00|1.0|7.0
> > gap_9 at testtgrass|gap_9|testtgrass|2012-08-28 00:00:00|2012-08-29
> > 00:00:00|1.0|8.0
> > map4 at testtgrass|map4|testtgrass|2012-08-29 00:00:00|2012-08-30
> > 00:00:00|1.0|9.0
> > gap_10 at testtgrass|gap_10|testtgrass|2012-08-30 00:00:00|2012-08-31
> > 00:00:00|1.0|10.0
> > gap_10 at testtgrass|gap_10|testtgrass|2012-08-31 00:00:00|2012-09-01
> > 00:00:00|1.0|11.0
> > gap_10 at testtgrass|gap_10|testtgrass|2012-09-01 00:00:00|2012-09-02
> > 00:00:00|1.0|12.0
> > gap_10 at testtgrass|gap_10|testtgrass|2012-09-02 00:00:00|2012-09-03
> > 00:00:00|1.0|13.0
> > map5 at testtgrass|map5|testtgrass|2012-09-03 00:00:00|2012-09-04
> > 00:00:00|1.0|14.0
> >
> > Here it works if I give one day before the actual valid temporal image in
> > the where condition. So if I give "start_time > '2012-08-19 00:00:00'",
> the
> > first gap will also get filled. But It would be great if we can query on
> the
> > missing dates/time.
> >
> > All suggestions welcome.
> >
> > Thanks in advance
> >
> > Regards
> >
> > Sajid
> >
> > --
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20150216/849d3578/attachment.html>


More information about the grass-user mailing list