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@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@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@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@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@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@testtgrass|map1|testtgrass|2012-08-20 00:00:00|2012-08-21 00:00:00|1.0|0.0
gap_10@testtgrass|gap_10|testtgrass|2012-08-21 00:00:00|2012-08-22 00:00:00|1.0|1.0
map2@testtgrass|map2|testtgrass|2012-08-22 00:00:00|2012-08-23 00:00:00|1.0|2.0
gap_11@testtgrass|gap_11|testtgrass|2012-08-23 00:00:00|2012-08-24 00:00:00|1.0|3.0
gap_11@testtgrass|gap_11|testtgrass|2012-08-24 00:00:00|2012-08-25 00:00:00|1.0|4.0
map3@testtgrass|map3|testtgrass|2012-08-25 00:00:00|2012-08-26 00:00:00|1.0|5.0
gap_12@testtgrass|gap_12|testtgrass|2012-08-26 00:00:00|2012-08-27 00:00:00|1.0|6.0
gap_12@testtgrass|gap_12|testtgrass|2012-08-27 00:00:00|2012-08-28 00:00:00|1.0|7.0
gap_12@testtgrass|gap_12|testtgrass|2012-08-28 00:00:00|2012-08-29 00:00:00|1.0|8.0
map4@testtgrass|map4|testtgrass|2012-08-29 00:00:00|2012-08-30 00:00:00|1.0|9.0
gap_13@testtgrass|gap_13|testtgrass|2012-08-30 00:00:00|2012-08-31 00:00:00|1.0|10.0
gap_13@testtgrass|gap_13|testtgrass|2012-08-31 00:00:00|2012-09-01 00:00:00|1.0|11.0
gap_13@testtgrass|gap_13|testtgrass|2012-09-01 00:00:00|2012-09-02 00:00:00|1.0|12.0
gap_13@testtgrass|gap_13|testtgrass|2012-09-02 00:00:00|2012-09-03 00:00:00|1.0|13.0
map5@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@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@testtgrass|map2|testtgrass|2012-08-22 00:00:00|2012-08-23 00:00:00|1.0|2.0
gap_8@testtgrass|gap_8|testtgrass|2012-08-23 00:00:00|2012-08-24 00:00:00|1.0|3.0
gap_8@testtgrass|gap_8|testtgrass|2012-08-24 00:00:00|2012-08-25 00:00:00|1.0|4.0
map3@testtgrass|map3|testtgrass|2012-08-25 00:00:00|2012-08-26 00:00:00|1.0|5.0
gap_9@testtgrass|gap_9|testtgrass|2012-08-26 00:00:00|2012-08-27 00:00:00|1.0|6.0
gap_9@testtgrass|gap_9|testtgrass|2012-08-27 00:00:00|2012-08-28 00:00:00|1.0|7.0
gap_9@testtgrass|gap_9|testtgrass|2012-08-28 00:00:00|2012-08-29 00:00:00|1.0|8.0
map4@testtgrass|map4|testtgrass|2012-08-29 00:00:00|2012-08-30 00:00:00|1.0|9.0
gap_10@testtgrass|gap_10|testtgrass|2012-08-30 00:00:00|2012-08-31 00:00:00|1.0|10.0
gap_10@testtgrass|gap_10|testtgrass|2012-08-31 00:00:00|2012-09-01 00:00:00|1.0|11.0
gap_10@testtgrass|gap_10|testtgrass|2012-09-01 00:00:00|2012-09-02 00:00:00|1.0|12.0
gap_10@testtgrass|gap_10|testtgrass|2012-09-02 00:00:00|2012-09-03 00:00:00|1.0|13.0
map5@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
···
http://gis.cri.fmach.it/pareeth/
Fondazione Edmund Mach
Research and Innovation Centre
GIS and Remote Sensing Unit/Limnology and River ecology
Via Mach 1, 38010 San Michele all’Adige (TN) - Italy
Phone +39 461 615 669
spareeth@gmail.com
sajid.pareeth@fmach.it
skype: spareeth