[GRASS-SVN] r50468 - in grass/trunk/temporal: t.sample tr.extract
tr.import tr.out.vtk tr.to.rast3 tr3.list tv.what.rast
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Jan 26 08:33:55 EST 2012
Author: huhabla
Date: 2012-01-26 05:33:55 -0800 (Thu, 26 Jan 2012)
New Revision: 50468
Modified:
grass/trunk/temporal/t.sample/test.t.sample.sh
grass/trunk/temporal/tr.extract/test.tr.extract.sh
grass/trunk/temporal/tr.import/test.tr.import.sh
grass/trunk/temporal/tr.out.vtk/test.tr.out.vtk.sh
grass/trunk/temporal/tr.out.vtk/tr.out.vtk.py
grass/trunk/temporal/tr.to.rast3/test.tr.to.rast3.sh
grass/trunk/temporal/tr3.list/test.tr3.list.sh
grass/trunk/temporal/tv.what.rast/test.tv.what.rast.layer.sh
Log:
Test update and bug fixing
Modified: grass/trunk/temporal/t.sample/test.t.sample.sh
===================================================================
--- grass/trunk/temporal/t.sample/test.t.sample.sh 2012-01-26 12:23:09 UTC (rev 50467)
+++ grass/trunk/temporal/t.sample/test.t.sample.sh 2012-01-26 13:33:55 UTC (rev 50468)
@@ -27,7 +27,7 @@
n2=`g.tempfile pid=2 -d`
n3=`g.tempfile pid=3 -d`
-cat > $n1 << EOF
+cat > "${n1}" << EOF
prec_1
prec_2
prec_3
@@ -36,12 +36,12 @@
prec_6
EOF
-cat > $n2 << EOF
+cat > "${n2}" << EOF
pnts1|2001-01-01|2001-03-01
pnts2|2001-05-01|2001-07-01
EOF
-cat > $n3 << EOF
+cat > "${n3}" << EOF
pnts3|2001-01-01|2001-01-05
pnts4|2001-01-05|2001-01-10
pnts5|2001-01-10|2001-01-15
@@ -55,11 +55,11 @@
t.create --o type=stvds temporaltype=absolute output=pnts_abs0 title="A test with vector input files" descr="A test with vector input files"
t.create --o type=stvds temporaltype=absolute output=pnts_abs1 title="A test with vector input files" descr="A test with vector input files"
-tr.register -i input=precip_abs0 file="$n1" start="2001-01-01" increment="1 months"
+tr.register -i input=precip_abs0 file="${n1}" start="2001-01-01" increment="1 months"
tr.list precip_abs0 -h
-tv.register input=pnts_abs0 file="$n2" start=file end=file
+tv.register input=pnts_abs0 file="${n2}" start=file end=file
tv.list pnts_abs0 -h
-tv.register input=pnts_abs1 file="$n3" start=file end=file
+tv.register input=pnts_abs1 file="${n3}" start=file end=file
tv.list pnts_abs1 -h
# The @test
@@ -71,7 +71,7 @@
# Test with temporal point data
-tr.register input=precip_abs0 file="$n1" start="2001-01-01" increment="1 months"
+tr.register input=precip_abs0 file="${n1}" start="2001-01-01" increment="1 months"
tr.list precip_abs0 -h
t.sample input=precip_abs0 samtype=stvds sample=pnts_abs0 -h
t.sample input=precip_abs0 samtype=stvds sample=pnts_abs1 -h
Modified: grass/trunk/temporal/tr.extract/test.tr.extract.sh
===================================================================
--- grass/trunk/temporal/tr.extract/test.tr.extract.sh 2012-01-26 12:23:09 UTC (rev 50467)
+++ grass/trunk/temporal/tr.extract/test.tr.extract.sh 2012-01-26 13:33:55 UTC (rev 50468)
@@ -20,9 +20,13 @@
# The first @test
# We create the space time raster inputs and register the raster maps with absolute time interval
-tr.extract --o input=precip_abs1 output=precip_abs2 where="start_time > '2001-06-01'" expression=" if(precip_abs1 > 400, precip_abs1, null())" base=new_prec
-
+tr.extract --o input=precip_abs1 output=precip_abs2 where="start_time > '2001-06-01'" \
+ expression=" if(precip_abs1 > 400, precip_abs1, null())" base=new_prec
t.info type=strds input=precip_abs2
+tr.extract --o -n input=precip_abs1 output=precip_abs3 where="start_time > '2001-06-01'" \
+ expression=" if(precip_abs1 > 400, precip_abs1, null())" base=new_prec
+t.info type=strds input=precip_abs3
+
t.remove type=rast input=prec_1,prec_2,prec_3,prec_4,prec_5,prec_6
-t.remove type=strds input=precip_abs1,precip_abs2
+t.remove type=strds input=precip_abs1,precip_abs2,precip_abs3
Modified: grass/trunk/temporal/tr.import/test.tr.import.sh
===================================================================
--- grass/trunk/temporal/tr.import/test.tr.import.sh 2012-01-26 12:23:09 UTC (rev 50467)
+++ grass/trunk/temporal/tr.import/test.tr.import.sh 2012-01-26 13:33:55 UTC (rev 50468)
@@ -17,7 +17,7 @@
n1=`g.tempfile pid=1 -d`
-cat > $n1 << EOF
+cat > "${n1}" << EOF
prec_1|2001-01-01|2001-07-01
prec_2|2001-02-01|2001-04-01
prec_3|2001-03-01|2001-04-01
@@ -29,7 +29,7 @@
t.create --o type=strds temporaltype=absolute output=precip_abs1 title="A test with input files" descr="A test with input files"
# The first @test
-tr.register -i input=precip_abs1 file="$n1" start="2001-01-01" increment="1 months"
+tr.register -i input=precip_abs1 file="${n1}" start="2001-01-01" increment="1 months"
tr.export input=precip_abs1 output=strds_export.tar.bz2 compression=bzip2 workdir=test
tr.import --o input=strds_export.tar.bz2 output=precip_abs1 extrdir=test\
Modified: grass/trunk/temporal/tr.out.vtk/test.tr.out.vtk.sh
===================================================================
--- grass/trunk/temporal/tr.out.vtk/test.tr.out.vtk.sh 2012-01-26 12:23:09 UTC (rev 50467)
+++ grass/trunk/temporal/tr.out.vtk/test.tr.out.vtk.sh 2012-01-26 13:33:55 UTC (rev 50468)
@@ -16,7 +16,7 @@
n1=`g.tempfile pid=1 -d`
-cat > $n1 << EOF
+cat > "${n1}" << EOF
prec_1|2001-01-01|2001-02-01
prec_2|2001-02-01|2001-03-01
prec_3|2001-03-01|2001-04-01
@@ -31,17 +31,17 @@
# The first @test
mkdir /tmp/test1
-tr.register -i input=precip_abs1 file=$n1 start=file end=file
+tr.register -i input=precip_abs1 file="${n1}" start=file end=file
tr.out.vtk input=precip_abs1 expdir=/tmp/test1
ls -al /tmp/test1
mkdir /tmp/test2
-tr.register -i input=precip_abs2 file=$n1
+tr.register -i input=precip_abs2 file="${n1}"
tr.out.vtk input=precip_abs2 expdir=/tmp/test2 elevation=elevation
ls -al /tmp/test2
mkdir /tmp/test3
-tr.register -i input=precip_abs3 file=$n1
+tr.register -i input=precip_abs3 file="${n1}"
tr.out.vtk -g input=precip_abs3 expdir=/tmp/test3 elevation=elevation
ls -al /tmp/test3
Modified: grass/trunk/temporal/tr.out.vtk/tr.out.vtk.py
===================================================================
--- grass/trunk/temporal/tr.out.vtk/tr.out.vtk.py 2012-01-26 12:23:09 UTC (rev 50467)
+++ grass/trunk/temporal/tr.out.vtk/tr.out.vtk.py 2012-01-26 13:33:55 UTC (rev 50468)
@@ -122,6 +122,7 @@
sp.select()
if use_granularity:
+ # Attention: A list of lists of maps will be returned
maps = sp.get_registered_maps_as_objects_by_granularity()
# Create a NULL map in case of granularity support
null_map = "temporary_null_map_%i" % os.getpid()
@@ -135,7 +136,10 @@
count = 0
if maps:
for map in maps:
- id = map.get_id()
+ if use_granularity:
+ id = map[0].get_map_id()
+ else:
+ id = map.get_map_id()
# None ids will be replaced by NULL maps
if id == None:
id = null_map
Modified: grass/trunk/temporal/tr.to.rast3/test.tr.to.rast3.sh
===================================================================
--- grass/trunk/temporal/tr.to.rast3/test.tr.to.rast3.sh 2012-01-26 12:23:09 UTC (rev 50467)
+++ grass/trunk/temporal/tr.to.rast3/test.tr.to.rast3.sh 2012-01-26 13:33:55 UTC (rev 50468)
@@ -29,5 +29,5 @@
t.remove type=rast input=prec_1,prec_2,prec_3,prec_4,prec_5,prec_6
t.remove type=strds input=precip_abs
-r3.info prec_sum
+r3.info preciptiation
g.region s=0 n=80 w=0 e=120 b=0 t=1 res=10 res3=1
Modified: grass/trunk/temporal/tr3.list/test.tr3.list.sh
===================================================================
--- grass/trunk/temporal/tr3.list/test.tr3.list.sh 2012-01-26 12:23:09 UTC (rev 50467)
+++ grass/trunk/temporal/tr3.list/test.tr3.list.sh 2012-01-26 13:33:55 UTC (rev 50468)
@@ -19,7 +19,7 @@
n4=`g.tempfile pid=4 -d`
n5=`g.tempfile pid=5 -d`
-cat > $n1 << EOF
+cat > "${n1}" << EOF
vol_1
vol_2
vol_3
@@ -28,7 +28,7 @@
vol_6
EOF
-cat > $n2 << EOF
+cat > "${n2}" << EOF
vol_1|2001-01-01
vol_2|2001-02-01
vol_3|2001-03-01
@@ -37,7 +37,7 @@
vol_6|2001-06-01
EOF
-cat > $n3 << EOF
+cat > "${n3}" << EOF
vol_1|2001-01-01|2001-04-01
vol_2|2001-05-01|2001-07-01
vol_3|2001-08-01|2001-10-01
@@ -46,7 +46,7 @@
vol_6|2002-05-01|2002-07-01
EOF
-cat > $n4 << EOF
+cat > "${n4}" << EOF
vol_1|2001-01-01|2001-07-01
vol_2|2001-02-01|2001-04-01
vol_3|2001-03-01|2001-04-01
@@ -55,7 +55,7 @@
vol_6|2001-06-01|2001-07-01
EOF
-cat > $n5 << EOF
+cat > "${n5}" << EOF
vol_1|2001-01-01|2001-03-11
vol_2|2001-02-01|2001-04-01
vol_3|2001-03-01|2001-06-02
@@ -71,31 +71,31 @@
t.create --o type=str3ds temporaltype=absolute output=volume_abs5 title="A test with input files" descr="A test with input files"
# The first @test
-tr3.register input=volume_abs1 file=$n1 start="2001-01-01" increment="1 months"
+tr3.register input=volume_abs1 file="${n1}" start="2001-01-01" increment="1 months"
tr3.list fs=" | " method=comma input=volume_abs1
tr3.list -h input=volume_abs1
tr3.list -h fs=" | " method=cols input=volume_abs1
tr3.list -h fs=" | " method=delta input=volume_abs1
tr3.list -h fs=" | " method=deltagaps input=volume_abs1
-tr3.register -i input=volume_abs2 file=$n2 start=file
+tr3.register -i input=volume_abs2 file="${n2}" start=file
tr3.list fs=" | " method=comma input=volume_abs2
tr3.list -h input=volume_abs2
tr3.list -h fs=" | " method=cols input=volume_abs2
tr3.list -h fs=" | " method=delta input=volume_abs2
tr3.list -h fs=" | " method=deltagaps input=volume_abs2
-tr3.register -i input=volume_abs3 file=$n3 start=file end=file
+tr3.register -i input=volume_abs3 file="${n3}" start=file end=file
tr3.list fs=" | " method=comma input=volume_abs3
tr3.list -h fs=" | " method=delta input=volume_abs3
tr3.list -h fs=" | " method=deltagaps input=volume_abs3
-tr3.register -i input=volume_abs4 file=$n4 start=file end=file
+tr3.register -i input=volume_abs4 file="${n4}" start=file end=file
tr3.list fs=" | " method=comma input=volume_abs4
tr3.list -h fs=" | " method=delta input=volume_abs4
tr3.list -h fs=" | " method=deltagaps input=volume_abs4
-tr3.register -i input=volume_abs5 file=$n5 start=file end=file
+tr3.register -i input=volume_abs5 file="${n5}" start=file end=file
tr3.list fs=" | " method=comma input=volume_abs5
tr3.list -h input=volume_abs5
tr3.list -h fs=" | " method=cols input=volume_abs5
Modified: grass/trunk/temporal/tv.what.rast/test.tv.what.rast.layer.sh
===================================================================
--- grass/trunk/temporal/tv.what.rast/test.tv.what.rast.layer.sh 2012-01-26 12:23:09 UTC (rev 50467)
+++ grass/trunk/temporal/tv.what.rast/test.tv.what.rast.layer.sh 2012-01-26 13:33:55 UTC (rev 50468)
@@ -13,7 +13,7 @@
r.mapcalc --o expr="sand_frac_5 = 65.0"
r.mapcalc --o expr="sand_frac_6 = 75.0"
# The vector map
-v.random --o -z seed=1 output=soil_orig n=20 zmin=0 zmax=100 column=sand
+v.random --o -z seed=1 output=soil_orig n=5 zmin=0 zmax=100 column=sand
# Adding new layer with categories
v.category input=soil_orig out=soils option=transfer layer=1,1 --o
v.category input=soils out=soil_orig option=transfer layer=1,2 --o
@@ -67,7 +67,7 @@
v.db.select map=soils layer=5
v.db.select map=soils layer=6
-tv.what.rast --v input=soil_abs strds=sand_frac_abs_2 sampling=equal column=sand_frac
+tv.what.rast --v input=soil_abs strds=sand_frac_abs_2 sampling=equal
v.db.select map=soils layer=1
v.db.select map=soils layer=2
v.db.select map=soils layer=3
More information about the grass-commit
mailing list