Hello<br><br>Where do I get the output file which contains all the output for the script below, the actual file name under my Mapset? <br><br>----------------------------------------------------------------------------------------------------------------------<br>
#!/bin/sh<br><br>#variable to customize:<br># path to GRASS software main directory<br>GISBASE=/usr/lib/grass<br># path to GRASS database<br>GISDBASE=$HOME/grassgis<br><br>LOCATION_NAME=SRTMDEM<br>MAPSET=PERMANENT<br><br>
# nothing to change below<br>MAP=$1<br>LOCATION=$2<br><br><br># generate temporal LOCATION:<br>TEMPDIR=FLOODS<br>mkdir -p $GISDBASE/$LOCATION_NAME/$MAPSET<br><br># save existing $HOME/.grassrc6<br>if test -e $HOME/.grassrc6 ; then<br>
mv $HOME/.grassrc6 /tmp/$TEMPDIR.grassrc6<br>fi<br><br>echo &quot;LOCATION_NAME: $LOCATION_NAME&quot; &gt; $HOME/.grassrc6<br>echo &quot;MAPSET:$MAPSET&quot;                &gt;&gt; $HOME/.grassrc6<br>echo &quot;DIGITIZER: none&quot;               &gt;&gt; $HOME/.grassrc6<br>
echo &quot;GISDBASE: $GISDBASE&quot;           &gt;&gt; $HOME/.grassrc6<br>export GISBASE=$GISBASE<br><br># Create a WIND file with minimal information and no projection:<br>echo &quot;proj: 3 <br>zone:       0<br>north:      1<br>
south:      0<br>east:       1<br>west:       0<br>cols:       1<br>rows:       1<br>e-w resol:  1<br>n-s resol:  1<br>top:        1<br>bottom:     0<br>cols3:      1<br>rows3:      1<br>depths:     1<br>e-w resol3: 1<br>
n-s resol3: 1<br>t-b resol:  1<br>&quot; &gt; $GISDBASE/$LOCATION_NAME/$MAPSET/WIND<br><br># Copy WIND-file to DEFAULT_WIND:<br>cp $GISDBASE/$LOCATION_NAME/$MAPSET/WIND \<br> $GISDBASE/$LOCATION_NAME/$MAPSET/DEFAULT_WIND<br>
<br><br>echo &quot;name:      Latitude-Longitude<br>datum:           wgs84<br>towgs84:         0.000,0.000,0.000<br>proj:            ll<br>ellps:             wgs84<br>&quot;&gt; $GISDBASE/$LOCATION_NAME/$MAPSET/PROJ_INFO <br>
<br>echo &quot;unit: degree<br>ubits:      degrees<br>meters:     1.0<br>&quot;&gt; $GISDBASE/$LOCATION_NAME/$MAPSET/PROJ_UNITS<br><br><br><br>export PATH=$GISBASE/bin:$GISBASE/scripts:$PATH<br>export LD_LIBRARY_PATH=$GISBASE/lib:$LD_LIBRARY_PATH<br>
export GIS_LOCK=$$<br>export GISRC=$HOME/.grassrc6<br><br><br># this should print GRASS version used:<br>g.version<br># other calculations go here....<br><br># import rainfall data set.<br> cd $HOME/grassgis<br><br><br><br>
# DEM and Rainfall data sets.<br>r.in.gdal --o input=$HOME/grassgis/dem1.tif output=dem1<br># r.in.gdal --o input=$HOME/grassgis/dem2.tif output=dem2<br># r.in.gdal --o input=$HOME/grassgis/dem3.tif output=dem3<br># r.in.gdal --o input=$HOME/grassgis/dem4.tif output=dem4<br>
r.in.gdal --o input=$HOME/grassgis/Rainfall.tif output=rainfall<br><br># set region resolution to be the dem<br>g.region rast=dem1 -p<br><br># create MASK to the dem<br>r.mask input=dem1@PERMANENT &#39;maskcats=1 thru 10000&#39;<br>
<br># calculate rainfall resolution to be the dem resolution.<br>r.mapcalculator amap=rainfall formula=A*1.0 help=- outfile=rain1<br><br># creating set of maps indicating flow acc, drainage dir, streams<br>r.watershed --o elevation=dem1@PERMANENT drainage=flow1_direction basin=catch1 stream=str1 accumulation=acc1 threshold=1000<br>
<br># convert catch raster to polygon vector<br>r.to.vect in=catch1 out=catchments1 feature=area<br><br># Calculate univariate statistics<br>v.rast.stats vector=catchments1 raster=rain1 colpre=precip<br><br># view results<br>
<a href="http://v.info">v.info</a> -c catchments1<br>v.db.select catchments1<br><br># remove existing mask<br>r.mask -r input=dem1@PERMANENT &#39;maskcats=1 thru 10000&#39;<br>-------------------------------------------------------------------------------------------------------------------------------------------------------------<br clear="all">
<br>-- <br><span style="color: rgb(0, 0, 153);"></span><span style="color: rgb(0, 0, 153);">Kind Regards</span><br style="color: rgb(0, 0, 153);"><font size="1"><span style="color: rgb(0, 0, 153);">TS Gumede | CSIR | Meraka Institute | ICT4EO Research Group</span><br style="color: rgb(0, 0, 153);">
<span style="color: rgb(0, 0, 153);">Office Tel: 012 841 2606 | mobile : 072 258 1650</span></font><br><i style="color: rgb(102, 102, 102);">&quot;Work like a slave in order to live like a King&quot; ~ Unknown</i><br><br>