[GRASS-user] Re: v.rast.stats

Micha wrote:

The only unusual thing I notice above is that the resolution settings
for the raster are different N-S and E-W. This came from the original
tiff (see below) which also has rectangular pixels,

that is perfectly normal for a lat/lon map away from the equator.
longitude scales a cos(lat).

(the v.rast.stats module creates a temp raster at the *current region's
resolution* settings, which might be different from this rainfall
raster's rectangular resolution...)

the results of:

g.region -p rast=mapname
r.univar mapname

could help.

Hamish

Hi
If I run g.region rast=rainfall -p, I get:

projection: 3 (Latitude-Longitude)
zone: 0
datum: wgs84
ellipsoid: wgs84
north: 33:40:46.49916S
south: 34:20:55.49928S
west: 18:17:55.50036E
east: 19:10:16.50036E
nsres: 0:00:05.01875
ewres: 0:00:02.18125
rows: 480
cols: 1440
cells: 691200

and If I run r.univar rainfall, I get the following output:

100%
total null and non-null cells: 691200
total null cells: 0

Of the non-null cells:

n: 691200
minimum: 0
maximum: 3094
range: 3094
mean: 22.0228
mean of absolute values: 22.0228
standard deviation: 76.1639
variance: 5800.94
variation coefficient: 345.841 %
sum: 15222164

On Tue, Jun 15, 2010 at 12:22 PM, Hamish <hamish_b@yahoo.com> wrote:

Micha wrote:

The only unusual thing I notice above is that the resolution settings
for the raster are different N-S and E-W. This came from the original
tiff (see below) which also has rectangular pixels,

that is perfectly normal for a lat/lon map away from the equator.
longitude scales a cos(lat).

(the v.rast.stats module creates a temp raster at the current region’s
resolution
settings, which might be different from this rainfall
raster’s rectangular resolution…)

the results of:

g.region -p rast=mapname
r.univar mapname

could help.

Hamish


Kind Regards
TS Gumede
CSIR, Meraka Institute
072 258 1650

Hi
If I run g.region rast=rainfall -p, I get:

OK, what you’ve done here is change the current region to match the raster “rainfall”.
Can you now try:
v.rast.stats -c vect=catchments rast=rainfall pref=precip

···
-- 
Micha Silver
[http://www.surfaces.co.il/](http://www.surfaces.co.il/)
Arava Development Co.  +972-52-3665918

Hi

It is still giving me -NULL value error.

Do you think maybe its the way I downloaded my rainfall data? This is the site where I downloaded my data sets ftp://trmmopen.gsfc.nasa.gov/pub/gis/ and this data covers the whole world, the only thing I did was to clip a specific region (using coordinates) that is in South Africa to do my analysis. I used a bash script to download and project the data, see below:

#!/bin/bash

wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tif
wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tfw

gdal_translate -of GTiff -co “PROFILE=GeoTIFF” -co “INTERLEAVE=PIXEL” -co “COMPRESS=LZW” -co “TILED=YES” -a_srs EPSG:4326 -a_ullr 18.2987501 -33.6795831 19.1712501 -34.3487498 3B42RT.2010032900.1day.tif TRMMLast1day.tif

2010/6/15 Micha Silver <micha@arava.co.il>

On 15/06/2010 14:35, Sandile Gumede wrote:

Hi
If I run g.region rast=rainfall -p, I get:

OK, what you’ve done here is change the current region to match the raster “rainfall”.
Can you now try:
v.rast.stats -c vect=catchments rast=rainfall pref=precip

projection: 3 (Latitude-Longitude)
zone: 0
datum: wgs84
ellipsoid: wgs84
north: 33:40:46.49916S
south: 34:20:55.49928S
west: 18:17:55.50036E
east: 19:10:16.50036E
nsres: 0:00:05.01875
ewres: 0:00:02.18125
rows: 480
cols: 1440
cells: 691200

and If I run r.univar rainfall, I get the following output:

100%
total null and non-null cells: 691200
total null cells: 0

Of the non-null cells:

n: 691200
minimum: 0
maximum: 3094
range: 3094
mean: 22.0228
mean of absolute values: 22.0228
standard deviation: 76.1639
variance: 5800.94
variation coefficient: 345.841 %
sum: 15222164

On Tue, Jun 15, 2010 at 12:22 PM, Hamish <hamish_b@yahoo.com> wrote:

Micha wrote:

The only unusual thing I notice above is that the resolution settings
for the raster are different N-S and E-W. This came from the original
tiff (see below) which also has rectangular pixels,

that is perfectly normal for a lat/lon map away from the equator.
longitude scales a cos(lat).

(the v.rast.stats module creates a temp raster at the current region’s
resolution
settings, which might be different from this rainfall
raster’s rectangular resolution…)

the results of:

g.region -p rast=mapname
r.univar mapname

could help.

Hamish


Kind Regards
TS Gumede
CSIR, Meraka Institute
072 258 1650

This mail was received via Mail-SeCure System.

-- 
Micha Silver
[http://www.surfaces.co.il/](http://www.surfaces.co.il/)
Arava Development Co.  +972-52-3665918


Kind Regards
TS Gumede
CSIR, Meraka Institute
072 258 1650

Hi

It is still giving me -NULL value error.

Do you think maybe its the way I downloaded my rainfall data? This is the site where I downloaded my data sets ftp://trmmopen.gsfc.nasa.gov/pub/gis/ and this data covers the whole world, the only thing I did was to clip a specific region (using coordinates) that is in South Africa to do my analysis. I used a bash script to download and project the data, see below:

#!/bin/bash

wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tif
wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tfw

gdal_translate -of GTiff -co “PROFILE=GeoTIFF” -co “INTERLEAVE=PIXEL” -co “COMPRESS=LZW” -co “TILED=YES” -a_srs EPSG:4326 -a_ullr 18.2987501 -33.6795831 19.1712501 -34.3487498 3B42RT.2010032900.1day.tif TRMMLast1day.tif

On Thu, Jun 17, 2010 at 8:41 AM, Sandile Gumede <akasandile@gmail.com> wrote:

Hi

It is still giving me -NULL value error.

Do you think maybe its the way I downloaded my rainfall data? This is the site where I downloaded my data sets ftp://trmmopen.gsfc.nasa.gov/pub/gis/ and this data covers the whole world, the only thing I did was to clip a specific region (using coordinates) that is in South Africa to do my analysis. I used a bash script to download and project the data, see below:

#!/bin/bash

wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tif
wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tfw

gdal_translate -of GTiff -co “PROFILE=GeoTIFF” -co “INTERLEAVE=PIXEL” -co “COMPRESS=LZW” -co “TILED=YES” -a_srs EPSG:4326 -a_ullr 18.2987501 -33.6795831 19.1712501 -34.3487498 3B42RT.2010032900.1day.tif TRMMLast1day.tif

2010/6/15 Micha Silver <micha@arava.co.il>

On 15/06/2010 14:35, Sandile Gumede wrote:

Hi
If I run g.region rast=rainfall -p, I get:

OK, what you’ve done here is change the current region to match the raster “rainfall”.
Can you now try:
v.rast.stats -c vect=catchments rast=rainfall pref=precip

projection: 3 (Latitude-Longitude)
zone: 0
datum: wgs84
ellipsoid: wgs84
north: 33:40:46.49916S
south: 34:20:55.49928S
west: 18:17:55.50036E
east: 19:10:16.50036E
nsres: 0:00:05.01875
ewres: 0:00:02.18125
rows: 480
cols: 1440
cells: 691200

and If I run r.univar rainfall, I get the following output:

100%
total null and non-null cells: 691200
total null cells: 0

Of the non-null cells:

n: 691200
minimum: 0
maximum: 3094
range: 3094
mean: 22.0228
mean of absolute values: 22.0228
standard deviation: 76.1639
variance: 5800.94
variation coefficient: 345.841 %
sum: 15222164

On Tue, Jun 15, 2010 at 12:22 PM, Hamish <hamish_b@yahoo.com> wrote:

Micha wrote:

The only unusual thing I notice above is that the resolution settings
for the raster are different N-S and E-W. This came from the original
tiff (see below) which also has rectangular pixels,

that is perfectly normal for a lat/lon map away from the equator.
longitude scales a cos(lat).

(the v.rast.stats module creates a temp raster at the current region’s
resolution
settings, which might be different from this rainfall
raster’s rectangular resolution…)

the results of:

g.region -p rast=mapname
r.univar mapname

could help.

Hamish


Kind Regards
TS Gumede
CSIR, Meraka Institute
072 258 1650

This mail was received via Mail-SeCure System.

-- 
Micha Silver
[http://www.surfaces.co.il/](http://www.surfaces.co.il/)
Arava Development Co.  +972-52-3665918


Kind Regards
TS Gumede
CSIR, Meraka Institute
072 258 1650


Kind Regards
TS Gumede
CSIR, Meraka Institute
072 258 1650

Hello Sandile:
I tried to duplicate your steps and it seems to work for me.
Here’s what I did:

wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tif
wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tfw

gdalinfo 3B42RT.2010032900.1day.tif
Driver: GTiff/GeoTIFF
Files: 3B42RT.2010032900.1day.tif
3B42RT.2010032900.1day.tfw
Size is 1440, 480
Coordinate System is `’
Origin = (-180.000000000000000,60.000000000000000)
Pixel Size = (0.250000000000000,-0.250000000000000)

---- Note: no projection info above ----

---- Now I use the -projwin option of gdal_translate to select a small window
gdal_translate -a_srs EPSG:4326 -projwin 34.0 33.0 36.0 29.0 3B42RT.2010032900.1day.tif rainfall_il.tif

---- GEOGCS entry now shows 4326 ----

g.mapset map=ASTER_DEM loc=WGS84
----- A location setup as EPSG:4326----

r.in.gdal israel.tif out=rainfall_il

r.univar rainfall_il
100%
total null and non-null cells: 77760000
total null cells: 0

Of the non-null cells:

···
-- 
Micha Silver
Arava Development Co. +972-52-3665918
[http://surfaces.co.il](http://surfaces.co.il)

Thanks, I finally got the results.

Now the question I would like to ask is that, from these columns I got the values but which unit are these values are measured? Is it (mm) or ?

On Sat, Jun 19, 2010 at 9:57 PM, Micha Silver <micha@arava.co.il> wrote:

Hello Sandile:
I tried to duplicate your steps and it seems to work for me.
Here’s what I did:

wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tif
wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tfw

gdalinfo 3B42RT.2010032900.1day.tif
Driver: GTiff/GeoTIFF
Files: 3B42RT.2010032900.1day.tif
3B42RT.2010032900.1day.tfw
Size is 1440, 480
Coordinate System is `’
Origin = (-180.000000000000000,60.000000000000000)
Pixel Size = (0.250000000000000,-0.250000000000000)

---- Note: no projection info above ----

---- Now I use the -projwin option of gdal_translate to select a small window
gdal_translate -a_srs EPSG:4326 -projwin 34.0 33.0 36.0 29.0 3B42RT.2010032900.1day.tif rainfall_il.tif

---- GEOGCS entry now shows 4326 ----

g.mapset map=ASTER_DEM loc=WGS84
----- A location setup as EPSG:4326----

r.in.gdal israel.tif out=rainfall_il

r.univar rainfall_il
100%
total null and non-null cells: 77760000

total null cells: 0

Of the non-null cells:

n: 77760000
minimum: 0
maximum: 34
range: 34
mean: 0.364583
mean of absolute values: 0.364583
standard deviation: 3.45241
variance: 11.9192
variation coefficient: 946.948 %
sum: 28350000

----- Now using an existing catchment vector map ----
v.rast.stats vect=arava_wsheds rast=rainfall_il colpre=precip
v.info -c arava_wsheds
Displaying column types/names for database connection of layer 1:
INTEGER|cat
CHARACTER|label
DOUBLE PRECISION|area_km
INTEGER|precip_n
DOUBLE PRECISION|precip_min
DOUBLE PRECISION|precip_max
DOUBLE PRECISION|precip_range
DOUBLE PRECISION|precip_mean
DOUBLE PRECISION|precip_stddev
DOUBLE PRECISION|precip_variance
DOUBLE PRECISION|precip_cf_var
DOUBLE PRECISION|precip_sum

---- and some values ----

v.db.select arava_wsheds
cat|label|area_km|precip_n|precip_min|precip_max|precip_range|precip_mean|precip_stddev|precip_variance|precip_cf_var|precip_sum
21|Jordan|1055.231692|2|0|0|0|0|0|0||0
19|Hidan|987.811979|2|0|0|0|0|0|0||0
28|Og|124.122969|||||||||
36|Zarqa|273.606213|||||||||
24|Kidron|122.460114|||||||||
9|Darga|289.012122|||||||||
6|Arugot|236.365116|1|0|0|0|0|0|0||0
26|Mujib|1277.546513|2|0|0|0|0|0|0||0

---- (Many catchments have 0 or no value because of the small region I chose. The global data is 1/4 degree resolution and my region is only 2 deg E-W.)----

HTH…

Micha

On 06/17/2010 12:50 PM, Sandile Gumede wrote:

Hi

It is still giving me -NULL value error.

Do you think maybe its the way I downloaded my rainfall data? This is the site where I downloaded my data sets ftp://trmmopen.gsfc.nasa.gov/pub/gis/ and this data covers the whole world, the only thing I did was to clip a specific region (using coordinates) that is in South Africa to do my analysis. I used a bash script to download and project the data, see below:

#!/bin/bash

wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tif
wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tfw

gdal_translate -of GTiff -co “PROFILE=GeoTIFF” -co “INTERLEAVE=PIXEL” -co “COMPRESS=LZW” -co “TILED=YES” -a_srs EPSG:4326 -a_ullr 18.2987501 -33.6795831 19.1712501 -34.3487498 3B42RT.2010032900.1day.tif TRMMLast1day.tif

On Thu, Jun 17, 2010 at 8:41 AM, Sandile Gumede <akasandile@gmail.com> wrote:

Hi

It is still giving me -NULL value error.

Do you think maybe its the way I downloaded my rainfall data? This is the site where I downloaded my data sets ftp://trmmopen.gsfc.nasa.gov/pub/gis/ and this data covers the whole world, the only thing I did was to clip a specific region (using coordinates) that is in South Africa to do my analysis. I used a bash script to download and project the data, see below:

#!/bin/bash

wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tif
wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tfw

gdal_translate -of GTiff -co “PROFILE=GeoTIFF” -co “INTERLEAVE=PIXEL” -co “COMPRESS=LZW” -co “TILED=YES” -a_srs EPSG:4326 -a_ullr 18.2987501 -33.6795831 19.1712501 -34.3487498 3B42RT.2010032900.1day.tif TRMMLast1day.tif

2010/6/15 Micha Silver <micha@arava.co.il>

On 15/06/2010 14:35, Sandile Gumede wrote:

Hi
If I run g.region rast=rainfall -p, I get:

OK, what you’ve done here is change the current region to match the raster “rainfall”.
Can you now try:
v.rast.stats -c vect=catchments rast=rainfall pref=precip

projection: 3 (Latitude-Longitude)
zone: 0
datum: wgs84
ellipsoid: wgs84
north: 33:40:46.49916S
south: 34:20:55.49928S
west: 18:17:55.50036E
east: 19:10:16.50036E
nsres: 0:00:05.01875
ewres: 0:00:02.18125
rows: 480
cols: 1440
cells: 691200

and If I run r.univar rainfall, I get the following output:

100%
total null and non-null cells: 691200
total null cells: 0

Of the non-null cells:

n: 691200
minimum: 0
maximum: 3094
range: 3094
mean: 22.0228
mean of absolute values: 22.0228
standard deviation: 76.1639
variance: 5800.94
variation coefficient: 345.841 %
sum: 15222164

On Tue, Jun 15, 2010 at 12:22 PM, Hamish <hamish_b@yahoo.com> wrote:

Micha wrote:

The only unusual thing I notice above is that the resolution settings
for the raster are different N-S and E-W. This came from the original
tiff (see below) which also has rectangular pixels,

that is perfectly normal for a lat/lon map away from the equator.
longitude scales a cos(lat).

(the v.rast.stats module creates a temp raster at the current region’s
resolution
settings, which might be different from this rainfall
raster’s rectangular resolution…)

the results of:

g.region -p rast=mapname
r.univar mapname

could help.

Hamish


Kind Regards
TS Gumede
CSIR, Meraka Institute
072 258 1650

This mail was received via Mail-SeCure System.

-- 
Micha Silver
[http://www.surfaces.co.il/](http://www.surfaces.co.il/)
Arava Development Co.  +972-52-3665918
      


Kind Regards
TS Gumede
CSIR, Meraka Institute
072 258 1650


Kind Regards
TS Gumede
CSIR, Meraka Institute
072 258 1650

This mail was received via Mail-SeCure System.

-- 
Micha Silver
Arava Development Co. +972-52-3665918
[http://surfaces.co.il](http://surfaces.co.il)


Kind Regards
TS Gumede
CSIR, Meraka Institute
072 258 1650

Thanks, I finally got the results.

Now the question I would like to ask is that, from these columns I got the values but which unit are these values are measured? Is it (mm) or ?

On Tue, Jun 22, 2010 at 12:08 PM, Sandile Gumede <akasandile@gmail.com> wrote:

Thanks, I finally got the results.

Now the question I would like to ask is that, from these columns I got the values but which unit are these values are measured? Is it (mm) or ?

On Sat, Jun 19, 2010 at 9:57 PM, Micha Silver <micha@arava.co.il> wrote:

Hello Sandile:
I tried to duplicate your steps and it seems to work for me.
Here’s what I did:

wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tif
wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tfw

gdalinfo 3B42RT.2010032900.1day.tif
Driver: GTiff/GeoTIFF
Files: 3B42RT.2010032900.1day.tif
3B42RT.2010032900.1day.tfw
Size is 1440, 480
Coordinate System is `’
Origin = (-180.000000000000000,60.000000000000000)
Pixel Size = (0.250000000000000,-0.250000000000000)

---- Note: no projection info above ----

---- Now I use the -projwin option of gdal_translate to select a small window
gdal_translate -a_srs EPSG:4326 -projwin 34.0 33.0 36.0 29.0 3B42RT.2010032900.1day.tif rainfall_il.tif

---- GEOGCS entry now shows 4326 ----

g.mapset map=ASTER_DEM loc=WGS84
----- A location setup as EPSG:4326----

r.in.gdal israel.tif out=rainfall_il

r.univar rainfall_il
100%
total null and non-null cells: 77760000

total null cells: 0

Of the non-null cells:

n: 77760000
minimum: 0
maximum: 34
range: 34
mean: 0.364583
mean of absolute values: 0.364583
standard deviation: 3.45241
variance: 11.9192
variation coefficient: 946.948 %
sum: 28350000

----- Now using an existing catchment vector map ----
v.rast.stats vect=arava_wsheds rast=rainfall_il colpre=precip
v.info -c arava_wsheds
Displaying column types/names for database connection of layer 1:
INTEGER|cat
CHARACTER|label
DOUBLE PRECISION|area_km
INTEGER|precip_n
DOUBLE PRECISION|precip_min
DOUBLE PRECISION|precip_max
DOUBLE PRECISION|precip_range
DOUBLE PRECISION|precip_mean
DOUBLE PRECISION|precip_stddev
DOUBLE PRECISION|precip_variance
DOUBLE PRECISION|precip_cf_var
DOUBLE PRECISION|precip_sum

---- and some values ----

v.db.select arava_wsheds
cat|label|area_km|precip_n|precip_min|precip_max|precip_range|precip_mean|precip_stddev|precip_variance|precip_cf_var|precip_sum
21|Jordan|1055.231692|2|0|0|0|0|0|0||0
19|Hidan|987.811979|2|0|0|0|0|0|0||0
28|Og|124.122969|||||||||
36|Zarqa|273.606213|||||||||
24|Kidron|122.460114|||||||||
9|Darga|289.012122|||||||||
6|Arugot|236.365116|1|0|0|0|0|0|0||0
26|Mujib|1277.546513|2|0|0|0|0|0|0||0

---- (Many catchments have 0 or no value because of the small region I chose. The global data is 1/4 degree resolution and my region is only 2 deg E-W.)----

HTH…

Micha

On 06/17/2010 12:50 PM, Sandile Gumede wrote:

Hi

It is still giving me -NULL value error.

Do you think maybe its the way I downloaded my rainfall data? This is the site where I downloaded my data sets ftp://trmmopen.gsfc.nasa.gov/pub/gis/ and this data covers the whole world, the only thing I did was to clip a specific region (using coordinates) that is in South Africa to do my analysis. I used a bash script to download and project the data, see below:

#!/bin/bash

wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tif
wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tfw

gdal_translate -of GTiff -co “PROFILE=GeoTIFF” -co “INTERLEAVE=PIXEL” -co “COMPRESS=LZW” -co “TILED=YES” -a_srs EPSG:4326 -a_ullr 18.2987501 -33.6795831 19.1712501 -34.3487498 3B42RT.2010032900.1day.tif TRMMLast1day.tif

On Thu, Jun 17, 2010 at 8:41 AM, Sandile Gumede <akasandile@gmail.com> wrote:

Hi

It is still giving me -NULL value error.

Do you think maybe its the way I downloaded my rainfall data? This is the site where I downloaded my data sets ftp://trmmopen.gsfc.nasa.gov/pub/gis/ and this data covers the whole world, the only thing I did was to clip a specific region (using coordinates) that is in South Africa to do my analysis. I used a bash script to download and project the data, see below:

#!/bin/bash

wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tif
wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tfw

gdal_translate -of GTiff -co “PROFILE=GeoTIFF” -co “INTERLEAVE=PIXEL” -co “COMPRESS=LZW” -co “TILED=YES” -a_srs EPSG:4326 -a_ullr 18.2987501 -33.6795831 19.1712501 -34.3487498 3B42RT.2010032900.1day.tif TRMMLast1day.tif

2010/6/15 Micha Silver <micha@arava.co.il>

On 15/06/2010 14:35, Sandile Gumede wrote:

Hi
If I run g.region rast=rainfall -p, I get:

OK, what you’ve done here is change the current region to match the raster “rainfall”.
Can you now try:
v.rast.stats -c vect=catchments rast=rainfall pref=precip

projection: 3 (Latitude-Longitude)
zone: 0
datum: wgs84
ellipsoid: wgs84
north: 33:40:46.49916S
south: 34:20:55.49928S
west: 18:17:55.50036E
east: 19:10:16.50036E
nsres: 0:00:05.01875
ewres: 0:00:02.18125
rows: 480
cols: 1440
cells: 691200

and If I run r.univar rainfall, I get the following output:

100%
total null and non-null cells: 691200
total null cells: 0

Of the non-null cells:

n: 691200
minimum: 0
maximum: 3094
range: 3094
mean: 22.0228
mean of absolute values: 22.0228
standard deviation: 76.1639
variance: 5800.94
variation coefficient: 345.841 %
sum: 15222164

On Tue, Jun 15, 2010 at 12:22 PM, Hamish <hamish_b@yahoo.com> wrote:

Micha wrote:

The only unusual thing I notice above is that the resolution settings
for the raster are different N-S and E-W. This came from the original
tiff (see below) which also has rectangular pixels,

that is perfectly normal for a lat/lon map away from the equator.
longitude scales a cos(lat).

(the v.rast.stats module creates a temp raster at the current region’s
resolution
settings, which might be different from this rainfall
raster’s rectangular resolution…)

the results of:

g.region -p rast=mapname
r.univar mapname

could help.

Hamish


Kind Regards
TS Gumede
CSIR, Meraka Institute
072 258 1650

This mail was received via Mail-SeCure System.

-- 
Micha Silver
[http://www.surfaces.co.il/](http://www.surfaces.co.il/)
Arava Development Co.  +972-52-3665918
      


Kind Regards
TS Gumede
CSIR, Meraka Institute
072 258 1650


Kind Regards
TS Gumede
CSIR, Meraka Institute
072 258 1650

This mail was received via Mail-SeCure System.

-- 
Micha Silver
Arava Development Co. +972-52-3665918
[http://surfaces.co.il](http://surfaces.co.il)


Kind Regards
TS Gumede
CSIR, Meraka Institute
072 258 1650


Kind Regards
TS Gumede
CSIR, Meraka Institute
072 258 1650

Thanks, I finally got the results.

That’s good to hear.

Now the question I would like to ask is that, from these columns I got the values but which unit are these values are measured? Is it (mm) or ?

Well, that depends on the units of the raster. If the raster values are mm. then each column represents mm per raster cell. So if you have a rainfall raster with values in mm., and resolution of 10 meters, then the numbers in the columns are mm/100sq.m.

···
-- 
Micha Silver
[http://www.surfaces.co.il/](http://www.surfaces.co.il/)
Arava Development Co.  +972-52-3665918

It’s in mm/hr.

Are these values normal, to me it seems like big values because they are ranging from 2000-4500, see below I just copied a few:

120795|4076||1|4076|4076|0|4076|0|0|0|4076
120796|4080||1|4080|4080|0|4080|0|0|0|4080
120797|4084||1|4084|4084|0|4084|0|0|0|4084
120798|4088||1|4088|4088|0|4088|0|0|0|4088
120799|4092||1|4092|4092|0|4092|0|0|0|4092
120800|4096||1|4096|4096|0|4096|0|0|0|4096
120801|4100||1|4100|4100|0|4100|0|0|0|4100
120802|4104||1|4104|4104|0|4104|0|0|0|4104
120803|4108||1|4108|4108|0|4108|0|0|0|4108
120804|4112||1|4112|4112|0|4112|0|0|0|4112
120805|4116||1|4116|4116|0|4116|0|0|0|4116
120806|4120||1|4120|4120|0|4120|0|0|0|4120
120807|4124||1|4124|4124|0|4124|0|0|0|4124
120808|4128||1|4128|4128|0|4128|0|0|0|4128
120809|4144||1|4144|4144|0|4144|0|0|0|4144
120810|4148||1|4148|4148|0|4148|0|0|0|4148
120811|4152||1|4152|4152|0|4152|0|0|0|4152
120812|4156||1|4156|4156|0|4156|0|0|0|4156

2010/6/22 Micha Silver <micha@arava.co.il>

On 22/06/2010 13:08, Sandile Gumede wrote:

Thanks, I finally got the results.

That’s good to hear.

Now the question I would like to ask is that, from these columns I got the values but which unit are these values are measured? Is it (mm) or ?

Well, that depends on the units of the raster. If the raster values are mm. then each column represents mm per raster cell. So if you have a rainfall raster with values in mm., and resolution of 10 meters, then the numbers in the columns are mm/100sq.m.

Micha

On Sat, Jun 19, 2010 at 9:57 PM, Micha Silver <micha@arava.co.il> wrote:

Hello Sandile:
I tried to duplicate your steps and it seems to work for me.
Here’s what I did:

wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tif
wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tfw

gdalinfo 3B42RT.2010032900.1day.tif
Driver: GTiff/GeoTIFF
Files: 3B42RT.2010032900.1day.tif
3B42RT.2010032900.1day.tfw
Size is 1440, 480
Coordinate System is `’
Origin = (-180.000000000000000,60.000000000000000)
Pixel Size = (0.250000000000000,-0.250000000000000)

---- Note: no projection info above ----

---- Now I use the -projwin option of gdal_translate to select a small window
gdal_translate -a_srs EPSG:4326 -projwin 34.0 33.0 36.0 29.0 3B42RT.2010032900.1day.tif rainfall_il.tif

---- GEOGCS entry now shows 4326 ----

g.mapset map=ASTER_DEM loc=WGS84
----- A location setup as EPSG:4326----

r.in.gdal israel.tif out=rainfall_il

r.univar rainfall_il
100%
total null and non-null cells: 77760000

total null cells: 0

Of the non-null cells:

n: 77760000
minimum: 0
maximum: 34
range: 34
mean: 0.364583
mean of absolute values: 0.364583
standard deviation: 3.45241
variance: 11.9192
variation coefficient: 946.948 %
sum: 28350000

----- Now using an existing catchment vector map ----
v.rast.stats vect=arava_wsheds rast=rainfall_il colpre=precip
v.info -c arava_wsheds
Displaying column types/names for database connection of layer 1:
INTEGER|cat
CHARACTER|label
DOUBLE PRECISION|area_km
INTEGER|precip_n
DOUBLE PRECISION|precip_min
DOUBLE PRECISION|precip_max
DOUBLE PRECISION|precip_range
DOUBLE PRECISION|precip_mean
DOUBLE PRECISION|precip_stddev
DOUBLE PRECISION|precip_variance
DOUBLE PRECISION|precip_cf_var
DOUBLE PRECISION|precip_sum

---- and some values ----

v.db.select arava_wsheds
cat|label|area_km|precip_n|precip_min|precip_max|precip_range|precip_mean|precip_stddev|precip_variance|precip_cf_var|precip_sum
21|Jordan|1055.231692|2|0|0|0|0|0|0||0
19|Hidan|987.811979|2|0|0|0|0|0|0||0
28|Og|124.122969|||||||||
36|Zarqa|273.606213|||||||||
24|Kidron|122.460114|||||||||
9|Darga|289.012122|||||||||
6|Arugot|236.365116|1|0|0|0|0|0|0||0
26|Mujib|1277.546513|2|0|0|0|0|0|0||0

---- (Many catchments have 0 or no value because of the small region I chose. The global data is 1/4 degree resolution and my region is only 2 deg E-W.)----

HTH…

Micha

On 06/17/2010 12:50 PM, Sandile Gumede wrote:

Hi

It is still giving me -NULL value error.

Do you think maybe its the way I downloaded my rainfall data? This is the site where I downloaded my data sets ftp://trmmopen.gsfc.nasa.gov/pub/gis/ and this data covers the whole world, the only thing I did was to clip a specific region (using coordinates) that is in South Africa to do my analysis. I used a bash script to download and project the data, see below:

#!/bin/bash

wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tif
wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tfw

gdal_translate -of GTiff -co “PROFILE=GeoTIFF” -co “INTERLEAVE=PIXEL” -co “COMPRESS=LZW” -co “TILED=YES” -a_srs EPSG:4326 -a_ullr 18.2987501 -33.6795831 19.1712501 -34.3487498 3B42RT.2010032900.1day.tif TRMMLast1day.tif

On Thu, Jun 17, 2010 at 8:41 AM, Sandile Gumede <akasandile@gmail.com> wrote:

Hi

It is still giving me -NULL value error.

Do you think maybe its the way I downloaded my rainfall data? This is the site where I downloaded my data sets ftp://trmmopen.gsfc.nasa.gov/pub/gis/ and this data covers the whole world, the only thing I did was to clip a specific region (using coordinates) that is in South Africa to do my analysis. I used a bash script to download and project the data, see below:

#!/bin/bash

wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tif
wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tfw

gdal_translate -of GTiff -co “PROFILE=GeoTIFF” -co “INTERLEAVE=PIXEL” -co “COMPRESS=LZW” -co “TILED=YES” -a_srs EPSG:4326 -a_ullr 18.2987501 -33.6795831 19.1712501 -34.3487498 3B42RT.2010032900.1day.tif TRMMLast1day.tif

2010/6/15 Micha Silver <micha@arava.co.il>

On 15/06/2010 14:35, Sandile Gumede wrote:

Hi
If I run g.region rast=rainfall -p, I get:

OK, what you’ve done here is change the current region to match the raster “rainfall”.
Can you now try:
v.rast.stats -c vect=catchments rast=rainfall pref=precip

projection: 3 (Latitude-Longitude)
zone: 0
datum: wgs84
ellipsoid: wgs84
north: 33:40:46.49916S
south: 34:20:55.49928S
west: 18:17:55.50036E
east: 19:10:16.50036E
nsres: 0:00:05.01875
ewres: 0:00:02.18125
rows: 480
cols: 1440
cells: 691200

and If I run r.univar rainfall, I get the following output:

100%
total null and non-null cells: 691200
total null cells: 0

Of the non-null cells:

n: 691200
minimum: 0
maximum: 3094
range: 3094
mean: 22.0228
mean of absolute values: 22.0228
standard deviation: 76.1639
variance: 5800.94
variation coefficient: 345.841 %
sum: 15222164

On Tue, Jun 15, 2010 at 12:22 PM, Hamish <hamish_b@yahoo.com> wrote:

Micha wrote:

The only unusual thing I notice above is that the resolution settings
for the raster are different N-S and E-W. This came from the original
tiff (see below) which also has rectangular pixels,

that is perfectly normal for a lat/lon map away from the equator.
longitude scales a cos(lat).

(the v.rast.stats module creates a temp raster at the current region’s
resolution
settings, which might be different from this rainfall
raster’s rectangular resolution…)

the results of:

g.region -p rast=mapname
r.univar mapname

could help.

Hamish


Kind Regards
TS Gumede
CSIR, Meraka Institute
072 258 1650

This mail was received via Mail-SeCure System.

-- 
Micha Silver
[http://www.surfaces.co.il/](http://www.surfaces.co.il/)
Arava Development Co.  +972-52-3665918
      


Kind Regards
TS Gumede
CSIR, Meraka Institute
072 258 1650


Kind Regards
TS Gumede
CSIR, Meraka Institute
072 258 1650

This mail was received via Mail-SeCure System.

-- 
Micha Silver
Arava Development Co. +972-52-3665918
[http://surfaces.co.il](http://surfaces.co.il)

    


Kind Regards
TS Gumede
CSIR, Meraka Institute
072 258 1650

This mail was received via Mail-SeCure System.

-- 
Micha Silver
[http://www.surfaces.co.il/](http://www.surfaces.co.il/)
Arava Development Co.  +972-52-3665918


Kind Regards
TS Gumede
CSIR, Meraka Institute
072 258 1650

The raster resolution for the rainfall data was 0.25 degrees, or about 27 km. per pixel. So each pixel covers about 750 sq.km. The column with the precip_sum will be mm/raster cell, or mm over an area of 750,000,000 sq.m.
Does that make more sense?

···
-- 
Micha Silver
[http://www.surfaces.co.il/](http://www.surfaces.co.il/)
Arava Development Co.  +972-52-3665918

Hello Micha,

Can you please put all the steps including the steps for the DEM because I tried to duplicate your steps and when I get to the step of

v.rast.stats, I get an error saying

No categories found in raster map.

I tried even to match region resolutions of the two raster maps with g.region rast=rainfall res=0:00:03

here is a step-by-step:

r.in.gdal input=$HOME/grassdata/Cape_Town/Dem_CF.tif output=dem
g.region rast=dem -p

Projection of input dataset and current location appear to match
100%
r.in.gdal complete. Raster map created.
projection: 3 (Latitude-Longitude)
zone: 0
datum: wgs84
ellipsoid: wgs84
north: 33:40:46.499215S
south: 34:00:52.499215S
west: 18:17:55.500436E
east: 19:10:16.500436E
nsres: 0:00:03
ewres: 0:00:03
rows: 402
cols: 1047
cells: 420894

r.watershed --o elevation=dem@PERMANENT drainage=flow_direction basin=catch accumulation=acc threshold=1 memory=300 stream=str

SECTION 1a (of 5): Initiating Memory.
SECTION 1b (of 5): Determining Offmap Flow.
100%
SECTION 2: A * Search.
100%
SECTION 3: Accumulating Surface Flow.
100%
SECTION 4: Watershed determination.
100%
SECTION 5: Closing Maps.
WARNING: Default driver / database set to:
driver: dbf
database: $GISDBASE/$LOCATION_NAME/$MAPSET/dbf/
Extracting areas…
100%
100%

r.to.vect in=catch out=catchments feature=area

Building topology for vector map …
Registering primitives…
1259867 primitives registered
2100907 vertices registered
Building areas…
100%
418835 areas built
1 isles built
Attaching islands…
100%
Attaching centroids…
100%
Number of nodes: 841033
Number of primitives: 1259867
Number of points: 0
Number of lines: 0
Number of boundaries: 841032
Number of centroids: 418835
Number of areas: 418835
Number of isles: 1
r.to.vect complete.

r.in.gdal input=$HOME/grassdata/Cape_Town/TRMMLast1day.tif target=SRTMDEM output=rainfall

Projection of input dataset and current location appear to match
100%
r.in.gdal complete. Raster map created.
100%

g.region rast=rainfall res=0:00:03

r.univar rainfall

total null and non-null cells: 270000
total null cells: 0

Of the non-null cells:

n: 270000
minimum: 0
maximum: 232
range: 232
mean: 109.667
mean of absolute values: 109.667
standard deviation: 95.1362
variance: 9050.89
variation coefficient: 86.7503 %
sum: 29610000

v.rast.stats vector=catchments raster=rainfall colpre=precp

ERROR: No categories found in raster map

On Sat, Jun 19, 2010 at 9:57 PM, Micha Silver <micha@arava.co.il> wrote:

Hello Sandile:
I tried to duplicate your steps and it seems to work for me.
Here’s what I did:

wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tif
wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tfw

gdalinfo 3B42RT.2010032900.1day.tif
Driver: GTiff/GeoTIFF
Files: 3B42RT.2010032900.1day.tif
3B42RT.2010032900.1day.tfw
Size is 1440, 480
Coordinate System is `’
Origin = (-180.000000000000000,60.000000000000000)
Pixel Size = (0.250000000000000,-0.250000000000000)

---- Note: no projection info above ----

---- Now I use the -projwin option of gdal_translate to select a small window
gdal_translate -a_srs EPSG:4326 -projwin 34.0 33.0 36.0 29.0 3B42RT.2010032900.1day.tif rainfall_il.tif

---- GEOGCS entry now shows 4326 ----

g.mapset map=ASTER_DEM loc=WGS84
----- A location setup as EPSG:4326----

r.in.gdal israel.tif out=rainfall_il

r.univar rainfall_il
100%
total null and non-null cells: 77760000

total null cells: 0

Of the non-null cells:

n: 77760000
minimum: 0
maximum: 34
range: 34
mean: 0.364583
mean of absolute values: 0.364583
standard deviation: 3.45241
variance: 11.9192
variation coefficient: 946.948 %
sum: 28350000

----- Now using an existing catchment vector map ----
v.rast.stats vect=arava_wsheds rast=rainfall_il colpre=precip
v.info -c arava_wsheds
Displaying column types/names for database connection of layer 1:
INTEGER|cat
CHARACTER|label
DOUBLE PRECISION|area_km
INTEGER|precip_n
DOUBLE PRECISION|precip_min
DOUBLE PRECISION|precip_max
DOUBLE PRECISION|precip_range
DOUBLE PRECISION|precip_mean
DOUBLE PRECISION|precip_stddev
DOUBLE PRECISION|precip_variance
DOUBLE PRECISION|precip_cf_var
DOUBLE PRECISION|precip_sum

---- and some values ----

v.db.select arava_wsheds
cat|label|area_km|precip_n|precip_min|precip_max|precip_range|precip_mean|precip_stddev|precip_variance|precip_cf_var|precip_sum
21|Jordan|1055.231692|2|0|0|0|0|0|0||0
19|Hidan|987.811979|2|0|0|0|0|0|0||0
28|Og|124.122969|||||||||
36|Zarqa|273.606213|||||||||
24|Kidron|122.460114|||||||||
9|Darga|289.012122|||||||||
6|Arugot|236.365116|1|0|0|0|0|0|0||0
26|Mujib|1277.546513|2|0|0|0|0|0|0||0

---- (Many catchments have 0 or no value because of the small region I chose. The global data is 1/4 degree resolution and my region is only 2 deg E-W.)----

HTH…

Micha

On 06/17/2010 12:50 PM, Sandile Gumede wrote:

Hi

It is still giving me -NULL value error.

Do you think maybe its the way I downloaded my rainfall data? This is the site where I downloaded my data sets ftp://trmmopen.gsfc.nasa.gov/pub/gis/ and this data covers the whole world, the only thing I did was to clip a specific region (using coordinates) that is in South Africa to do my analysis. I used a bash script to download and project the data, see below:

#!/bin/bash

wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tif
wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tfw

gdal_translate -of GTiff -co “PROFILE=GeoTIFF” -co “INTERLEAVE=PIXEL” -co “COMPRESS=LZW” -co “TILED=YES” -a_srs EPSG:4326 -a_ullr 18.2987501 -33.6795831 19.1712501 -34.3487498 3B42RT.2010032900.1day.tif TRMMLast1day.tif

On Thu, Jun 17, 2010 at 8:41 AM, Sandile Gumede <akasandile@gmail.com> wrote:

Hi

It is still giving me -NULL value error.

Do you think maybe its the way I downloaded my rainfall data? This is the site where I downloaded my data sets ftp://trmmopen.gsfc.nasa.gov/pub/gis/ and this data covers the whole world, the only thing I did was to clip a specific region (using coordinates) that is in South Africa to do my analysis. I used a bash script to download and project the data, see below:

#!/bin/bash

wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tif
wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tfw

gdal_translate -of GTiff -co “PROFILE=GeoTIFF” -co “INTERLEAVE=PIXEL” -co “COMPRESS=LZW” -co “TILED=YES” -a_srs EPSG:4326 -a_ullr 18.2987501 -33.6795831 19.1712501 -34.3487498 3B42RT.2010032900.1day.tif TRMMLast1day.tif

2010/6/15 Micha Silver <micha@arava.co.il>

On 15/06/2010 14:35, Sandile Gumede wrote:

Hi
If I run g.region rast=rainfall -p, I get:

OK, what you’ve done here is change the current region to match the raster “rainfall”.
Can you now try:
v.rast.stats -c vect=catchments rast=rainfall pref=precip

projection: 3 (Latitude-Longitude)
zone: 0
datum: wgs84
ellipsoid: wgs84
north: 33:40:46.49916S
south: 34:20:55.49928S
west: 18:17:55.50036E
east: 19:10:16.50036E
nsres: 0:00:05.01875
ewres: 0:00:02.18125
rows: 480
cols: 1440
cells: 691200

and If I run r.univar rainfall, I get the following output:

100%
total null and non-null cells: 691200
total null cells: 0

Of the non-null cells:

n: 691200
minimum: 0
maximum: 3094
range: 3094
mean: 22.0228
mean of absolute values: 22.0228
standard deviation: 76.1639
variance: 5800.94
variation coefficient: 345.841 %
sum: 15222164

On Tue, Jun 15, 2010 at 12:22 PM, Hamish <hamish_b@yahoo.com> wrote:

Micha wrote:

The only unusual thing I notice above is that the resolution settings
for the raster are different N-S and E-W. This came from the original
tiff (see below) which also has rectangular pixels,

that is perfectly normal for a lat/lon map away from the equator.
longitude scales a cos(lat).

(the v.rast.stats module creates a temp raster at the current region’s
resolution
settings, which might be different from this rainfall
raster’s rectangular resolution…)

the results of:

g.region -p rast=mapname
r.univar mapname

could help.

Hamish


Kind Regards
TS Gumede
CSIR, Meraka Institute
072 258 1650

This mail was received via Mail-SeCure System.

-- 
Micha Silver
[http://www.surfaces.co.il/](http://www.surfaces.co.il/)
Arava Development Co.  +972-52-3665918
      


Kind Regards
TS Gumede
CSIR, Meraka Institute
072 258 1650


Kind Regards
TS Gumede
CSIR, Meraka Institute
072 258 1650

This mail was received via Mail-SeCure System.

-- 
Micha Silver
Arava Development Co. +972-52-3665918
[http://surfaces.co.il](http://surfaces.co.il)


Kind Regards
TS Gumede
CSIR, Meraka Institute
072 258 1650

Hi Micha

Which DEM data you used to test this rainfall data?

Can I have it?

On Sat, Jun 19, 2010 at 9:57 PM, Micha Silver <micha@arava.co.il> wrote:

Hello Sandile:
I tried to duplicate your steps and it seems to work for me.
Here’s what I did:

wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tif
wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tfw

gdalinfo 3B42RT.2010032900.1day.tif
Driver: GTiff/GeoTIFF
Files: 3B42RT.2010032900.1day.tif
3B42RT.2010032900.1day.tfw
Size is 1440, 480
Coordinate System is `’
Origin = (-180.000000000000000,60.000000000000000)
Pixel Size = (0.250000000000000,-0.250000000000000)

---- Note: no projection info above ----

---- Now I use the -projwin option of gdal_translate to select a small window
gdal_translate -a_srs EPSG:4326 -projwin 34.0 33.0 36.0 29.0 3B42RT.2010032900.1day.tif rainfall_il.tif

---- GEOGCS entry now shows 4326 ----

g.mapset map=ASTER_DEM loc=WGS84
----- A location setup as EPSG:4326----

r.in.gdal israel.tif out=rainfall_il

r.univar rainfall_il
100%
total null and non-null cells: 77760000

total null cells: 0

Of the non-null cells:

n: 77760000
minimum: 0
maximum: 34
range: 34
mean: 0.364583
mean of absolute values: 0.364583
standard deviation: 3.45241
variance: 11.9192
variation coefficient: 946.948 %
sum: 28350000

----- Now using an existing catchment vector map ----
v.rast.stats vect=arava_wsheds rast=rainfall_il colpre=precip
v.info -c arava_wsheds
Displaying column types/names for database connection of layer 1:
INTEGER|cat
CHARACTER|label
DOUBLE PRECISION|area_km
INTEGER|precip_n
DOUBLE PRECISION|precip_min
DOUBLE PRECISION|precip_max
DOUBLE PRECISION|precip_range
DOUBLE PRECISION|precip_mean
DOUBLE PRECISION|precip_stddev
DOUBLE PRECISION|precip_variance
DOUBLE PRECISION|precip_cf_var
DOUBLE PRECISION|precip_sum

---- and some values ----

v.db.select arava_wsheds
cat|label|area_km|precip_n|precip_min|precip_max|precip_range|precip_mean|precip_stddev|precip_variance|precip_cf_var|precip_sum
21|Jordan|1055.231692|2|0|0|0|0|0|0||0
19|Hidan|987.811979|2|0|0|0|0|0|0||0
28|Og|124.122969|||||||||
36|Zarqa|273.606213|||||||||
24|Kidron|122.460114|||||||||
9|Darga|289.012122|||||||||
6|Arugot|236.365116|1|0|0|0|0|0|0||0
26|Mujib|1277.546513|2|0|0|0|0|0|0||0

---- (Many catchments have 0 or no value because of the small region I chose. The global data is 1/4 degree resolution and my region is only 2 deg E-W.)----

HTH…

Micha

On 06/17/2010 12:50 PM, Sandile Gumede wrote:

Hi

It is still giving me -NULL value error.

Do you think maybe its the way I downloaded my rainfall data? This is the site where I downloaded my data sets ftp://trmmopen.gsfc.nasa.gov/pub/gis/ and this data covers the whole world, the only thing I did was to clip a specific region (using coordinates) that is in South Africa to do my analysis. I used a bash script to download and project the data, see below:

#!/bin/bash

wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tif
wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tfw

gdal_translate -of GTiff -co “PROFILE=GeoTIFF” -co “INTERLEAVE=PIXEL” -co “COMPRESS=LZW” -co “TILED=YES” -a_srs EPSG:4326 -a_ullr 18.2987501 -33.6795831 19.1712501 -34.3487498 3B42RT.2010032900.1day.tif TRMMLast1day.tif

On Thu, Jun 17, 2010 at 8:41 AM, Sandile Gumede <akasandile@gmail.com> wrote:

Hi

It is still giving me -NULL value error.

Do you think maybe its the way I downloaded my rainfall data? This is the site where I downloaded my data sets ftp://trmmopen.gsfc.nasa.gov/pub/gis/ and this data covers the whole world, the only thing I did was to clip a specific region (using coordinates) that is in South Africa to do my analysis. I used a bash script to download and project the data, see below:

#!/bin/bash

wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tif
wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tfw

gdal_translate -of GTiff -co “PROFILE=GeoTIFF” -co “INTERLEAVE=PIXEL” -co “COMPRESS=LZW” -co “TILED=YES” -a_srs EPSG:4326 -a_ullr 18.2987501 -33.6795831 19.1712501 -34.3487498 3B42RT.2010032900.1day.tif TRMMLast1day.tif

2010/6/15 Micha Silver <micha@arava.co.il>

On 15/06/2010 14:35, Sandile Gumede wrote:

Hi
If I run g.region rast=rainfall -p, I get:

OK, what you’ve done here is change the current region to match the raster “rainfall”.
Can you now try:
v.rast.stats -c vect=catchments rast=rainfall pref=precip

projection: 3 (Latitude-Longitude)
zone: 0
datum: wgs84
ellipsoid: wgs84
north: 33:40:46.49916S
south: 34:20:55.49928S
west: 18:17:55.50036E
east: 19:10:16.50036E
nsres: 0:00:05.01875
ewres: 0:00:02.18125
rows: 480
cols: 1440
cells: 691200

and If I run r.univar rainfall, I get the following output:

100%
total null and non-null cells: 691200
total null cells: 0

Of the non-null cells:

n: 691200
minimum: 0
maximum: 3094
range: 3094
mean: 22.0228
mean of absolute values: 22.0228
standard deviation: 76.1639
variance: 5800.94
variation coefficient: 345.841 %
sum: 15222164

On Tue, Jun 15, 2010 at 12:22 PM, Hamish <hamish_b@yahoo.com> wrote:

Micha wrote:

The only unusual thing I notice above is that the resolution settings
for the raster are different N-S and E-W. This came from the original
tiff (see below) which also has rectangular pixels,

that is perfectly normal for a lat/lon map away from the equator.
longitude scales a cos(lat).

(the v.rast.stats module creates a temp raster at the current region’s
resolution
settings, which might be different from this rainfall
raster’s rectangular resolution…)

the results of:

g.region -p rast=mapname
r.univar mapname

could help.

Hamish


Kind Regards
TS Gumede
CSIR, Meraka Institute
072 258 1650

This mail was received via Mail-SeCure System.

-- 
Micha Silver
[http://www.surfaces.co.il/](http://www.surfaces.co.il/)
Arava Development Co.  +972-52-3665918
      


Kind Regards
TS Gumede
CSIR, Meraka Institute
072 258 1650


Kind Regards
TS Gumede
CSIR, Meraka Institute
072 258 1650

This mail was received via Mail-SeCure System.

-- 
Micha Silver
Arava Development Co. +972-52-3665918
[http://surfaces.co.il](http://surfaces.co.il)


Kind Regards
TS Gumede
CSIR, Meraka Institute
072 258 1650

Hi Micha

Which DEM data you used to test this rainfall data?

Can I have it?

Can you also post the steps you did, maybe I’m missing something?

On Sat, Jun 19, 2010 at 9:57 PM, Micha Silver <micha@arava.co.il> wrote:

Hello Sandile:
I tried to duplicate your steps and it seems to work for me.
Here’s what I did:

wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tif
wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tfw

gdalinfo 3B42RT.2010032900.1day.tif
Driver: GTiff/GeoTIFF
Files: 3B42RT.2010032900.1day.tif
3B42RT.2010032900.1day.tfw

Size is 1440, 480
Coordinate System is `’
Origin = (-180.000000000000000,60.000000000000000)
Pixel Size = (0.250000000000000,-0.250000000000000)

---- Note: no projection info above ----

---- Now I use the -projwin option of gdal_translate to select a small window
gdal_translate -a_srs EPSG:4326 -projwin 34.0 33.0 36.0 29.0 3B42RT.2010032900.1day.tif rainfall_il.tif

---- GEOGCS entry now shows 4326 ----

g.mapset map=ASTER_DEM loc=WGS84
----- A location setup as EPSG:4326----

r.in.gdal israel.tif out=rainfall_il

r.univar rainfall_il

100%
total null and non-null cells: 77760000

total null cells: 0

Of the non-null cells:

n: 77760000
minimum: 0
maximum: 34
range: 34
mean: 0.364583
mean of absolute values: 0.364583
standard deviation: 3.45241
variance: 11.9192
variation coefficient: 946.948 %
sum: 28350000

----- Now using an existing catchment vector map ----
v.rast.stats vect=arava_wsheds rast=rainfall_il colpre=precip
v.info -c arava_wsheds
Displaying column types/names for database connection of layer 1:
INTEGER|cat
CHARACTER|label
DOUBLE PRECISION|area_km
INTEGER|precip_n
DOUBLE PRECISION|precip_min
DOUBLE PRECISION|precip_max
DOUBLE PRECISION|precip_range
DOUBLE PRECISION|precip_mean
DOUBLE PRECISION|precip_stddev
DOUBLE PRECISION|precip_variance
DOUBLE PRECISION|precip_cf_var
DOUBLE PRECISION|precip_sum

---- and some values ----

v.db.select arava_wsheds
cat|label|area_km|precip_n|precip_min|precip_max|precip_range|precip_mean|precip_stddev|precip_variance|precip_cf_var|precip_sum
21|Jordan|1055.231692|2|0|0|0|0|0|0||0
19|Hidan|987.811979|2|0|0|0|0|0|0||0
28|Og|124.122969|||||||||
36|Zarqa|273.606213|||||||||
24|Kidron|122.460114|||||||||
9|Darga|289.012122|||||||||
6|Arugot|236.365116|1|0|0|0|0|0|0||0
26|Mujib|1277.546513|2|0|0|0|0|0|0||0

---- (Many catchments have 0 or no value because of the small region I chose. The global data is 1/4 degree resolution and my region is only 2 deg E-W.)----

HTH…

Micha

On 06/17/2010 12:50 PM, Sandile Gumede wrote:

Hi

It is still giving me -NULL value error.

Do you think maybe its the way I downloaded my rainfall data? This is the site where I downloaded my data sets ftp://trmmopen.gsfc.nasa.gov/pub/gis/ and this data covers the whole world, the only thing I did was to clip a specific region (using coordinates) that is in South Africa to do my analysis. I used a bash script to download and project the data, see below:

#!/bin/bash

wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tif
wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tfw

gdal_translate -of GTiff -co “PROFILE=GeoTIFF” -co “INTERLEAVE=PIXEL” -co “COMPRESS=LZW” -co “TILED=YES” -a_srs EPSG:4326 -a_ullr 18.2987501 -33.6795831 19.1712501 -34.3487498 3B42RT.2010032900.1day.tif TRMMLast1day.tif

On Thu, Jun 17, 2010 at 8:41 AM, Sandile Gumede <akasandile@gmail.com> wrote:

Hi

It is still giving me -NULL value error.

Do you think maybe its the way I downloaded my rainfall data? This is the site where I downloaded my data sets ftp://trmmopen.gsfc.nasa.gov/pub/gis/ and this data covers the whole world, the only thing I did was to clip a specific region (using coordinates) that is in South Africa to do my analysis. I used a bash script to download and project the data, see below:

#!/bin/bash

wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tif
wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tfw

gdal_translate -of GTiff -co “PROFILE=GeoTIFF” -co “INTERLEAVE=PIXEL” -co “COMPRESS=LZW” -co “TILED=YES” -a_srs EPSG:4326 -a_ullr 18.2987501 -33.6795831 19.1712501 -34.3487498 3B42RT.2010032900.1day.tif TRMMLast1day.tif

2010/6/15 Micha Silver <micha@arava.co.il>

On 15/06/2010 14:35, Sandile Gumede wrote:

Hi
If I run g.region rast=rainfall -p, I get:

OK, what you’ve done here is change the current region to match the raster “rainfall”.
Can you now try:
v.rast.stats -c vect=catchments rast=rainfall pref=precip

projection: 3 (Latitude-Longitude)
zone: 0
datum: wgs84
ellipsoid: wgs84
north: 33:40:46.49916S
south: 34:20:55.49928S
west: 18:17:55.50036E
east: 19:10:16.50036E
nsres: 0:00:05.01875
ewres: 0:00:02.18125
rows: 480
cols: 1440
cells: 691200

and If I run r.univar rainfall, I get the following output:

100%
total null and non-null cells: 691200
total null cells: 0

Of the non-null cells:

n: 691200
minimum: 0
maximum: 3094
range: 3094
mean: 22.0228
mean of absolute values: 22.0228
standard deviation: 76.1639
variance: 5800.94
variation coefficient: 345.841 %
sum: 15222164

On Tue, Jun 15, 2010 at 12:22 PM, Hamish <hamish_b@yahoo.com> wrote:

Micha wrote:

The only unusual thing I notice above is that the resolution settings
for the raster are different N-S and E-W. This came from the original
tiff (see below) which also has rectangular pixels,

that is perfectly normal for a lat/lon map away from the equator.
longitude scales a cos(lat).

(the v.rast.stats module creates a temp raster at the current region’s
resolution
settings, which might be different from this rainfall
raster’s rectangular resolution…)

the results of:

g.region -p rast=mapname
r.univar mapname

could help.

Hamish


Kind Regards
TS Gumede
CSIR, Meraka Institute
072 258 1650

This mail was received via Mail-SeCure System.

-- 
Micha Silver
[http://www.surfaces.co.il/](http://www.surfaces.co.il/)
Arava Development Co.  +972-52-3665918
      


Kind Regards
TS Gumede
CSIR, Meraka Institute
072 258 1650


Kind Regards
TS Gumede
CSIR, Meraka Institute
072 258 1650

This mail was received via Mail-SeCure System.

-- 
Micha Silver
Arava Development Co. +972-52-3665918
[http://surfaces.co.il](http://surfaces.co.il)


Kind Regards
TS Gumede
CSIR, Meraka Institute
072 258 1650

Hi Micha

Which DEM data you used to test this rainfall data?

Can I have it?

I did the exercise below based on the ASTER DEM data from the US JPL program.
You can download data for anywhere in the world, at 30 m. resolution, from:
https://wist.echo.nasa.gov/~wist/api/imswelcome/
It requires registering, then after you manage to login, type ASTER DEM in the keyword search. Next scroll down to the Search Area section, and select one of the methods to mark the region you want. Eventually you’ll be able to finish the query and they send you an email that the search has completed, with a download link to get the data.

···
-- 
Micha Silver
[http://www.surfaces.co.il/](http://www.surfaces.co.il/)
Arava Development Co.  +972-52-3665918

Hello Micha,

Can you please put all the steps you did here?

On Sat, Jun 19, 2010 at 9:57 PM, Micha Silver <micha@arava.co.il> wrote:

Hello Sandile:
I tried to duplicate your steps and it seems to work for me.
Here’s what I did:

wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tif
wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tfw

gdalinfo 3B42RT.2010032900.1day.tif
Driver: GTiff/GeoTIFF
Files: 3B42RT.2010032900.1day.tif
3B42RT.2010032900.1day.tfw
Size is 1440, 480
Coordinate System is `’
Origin = (-180.000000000000000,60.000000000000000)

Pixel Size = (0.250000000000000,-0.250000000000000)

---- Note: no projection info above ----

---- Now I use the -projwin option of gdal_translate to select a small window
gdal_translate -a_srs EPSG:4326 -projwin 34.0 33.0 36.0 29.0 3B42RT.2010032900.1day.tif rainfall_il.tif

---- GEOGCS entry now shows 4326 ----

g.mapset map=ASTER_DEM loc=WGS84
----- A location setup as EPSG:4326----

r.in.gdal israel.tif out=rainfall_il

r.univar rainfall_il
100%
total null and non-null cells: 77760000

total null cells: 0

Of the non-null cells:

n: 77760000
minimum: 0
maximum: 34
range: 34
mean: 0.364583
mean of absolute values: 0.364583
standard deviation: 3.45241
variance: 11.9192
variation coefficient: 946.948 %
sum: 28350000

----- Now using an existing catchment vector map ----
v.rast.stats vect=arava_wsheds rast=rainfall_il colpre=precip
v.info -c arava_wsheds
Displaying column types/names for database connection of layer 1:
INTEGER|cat
CHARACTER|label
DOUBLE PRECISION|area_km
INTEGER|precip_n
DOUBLE PRECISION|precip_min
DOUBLE PRECISION|precip_max
DOUBLE PRECISION|precip_range
DOUBLE PRECISION|precip_mean
DOUBLE PRECISION|precip_stddev
DOUBLE PRECISION|precip_variance
DOUBLE PRECISION|precip_cf_var
DOUBLE PRECISION|precip_sum

---- and some values ----

v.db.select arava_wsheds
cat|label|area_km|precip_n|precip_min|precip_max|precip_range|precip_mean|precip_stddev|precip_variance|precip_cf_var|precip_sum
21|Jordan|1055.231692|2|0|0|0|0|0|0||0
19|Hidan|987.811979|2|0|0|0|0|0|0||0
28|Og|124.122969|||||||||
36|Zarqa|273.606213|||||||||
24|Kidron|122.460114|||||||||
9|Darga|289.012122|||||||||
6|Arugot|236.365116|1|0|0|0|0|0|0||0
26|Mujib|1277.546513|2|0|0|0|0|0|0||0

---- (Many catchments have 0 or no value because of the small region I chose. The global data is 1/4 degree resolution and my region is only 2 deg E-W.)----

HTH…

Micha

On 06/17/2010 12:50 PM, Sandile Gumede wrote:

Hi

It is still giving me -NULL value error.

Do you think maybe its the way I downloaded my rainfall data? This is the site where I downloaded my data sets ftp://trmmopen.gsfc.nasa.gov/pub/gis/ and this data covers the whole world, the only thing I did was to clip a specific region (using coordinates) that is in South Africa to do my analysis. I used a bash script to download and project the data, see below:

#!/bin/bash

wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tif
wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tfw

gdal_translate -of GTiff -co “PROFILE=GeoTIFF” -co “INTERLEAVE=PIXEL” -co “COMPRESS=LZW” -co “TILED=YES” -a_srs EPSG:4326 -a_ullr 18.2987501 -33.6795831 19.1712501 -34.3487498 3B42RT.2010032900.1day.tif TRMMLast1day.tif

On Thu, Jun 17, 2010 at 8:41 AM, Sandile Gumede <akasandile@gmail.com> wrote:

Hi

It is still giving me -NULL value error.

Do you think maybe its the way I downloaded my rainfall data? This is the site where I downloaded my data sets ftp://trmmopen.gsfc.nasa.gov/pub/gis/ and this data covers the whole world, the only thing I did was to clip a specific region (using coordinates) that is in South Africa to do my analysis. I used a bash script to download and project the data, see below:

#!/bin/bash

wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tif
wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tfw

gdal_translate -of GTiff -co “PROFILE=GeoTIFF” -co “INTERLEAVE=PIXEL” -co “COMPRESS=LZW” -co “TILED=YES” -a_srs EPSG:4326 -a_ullr 18.2987501 -33.6795831 19.1712501 -34.3487498 3B42RT.2010032900.1day.tif TRMMLast1day.tif

2010/6/15 Micha Silver <micha@arava.co.il>

On 15/06/2010 14:35, Sandile Gumede wrote:

Hi
If I run g.region rast=rainfall -p, I get:

OK, what you’ve done here is change the current region to match the raster “rainfall”.
Can you now try:
v.rast.stats -c vect=catchments rast=rainfall pref=precip

projection: 3 (Latitude-Longitude)
zone: 0
datum: wgs84
ellipsoid: wgs84
north: 33:40:46.49916S
south: 34:20:55.49928S
west: 18:17:55.50036E
east: 19:10:16.50036E
nsres: 0:00:05.01875
ewres: 0:00:02.18125
rows: 480
cols: 1440
cells: 691200

and If I run r.univar rainfall, I get the following output:

100%
total null and non-null cells: 691200
total null cells: 0

Of the non-null cells:

n: 691200
minimum: 0
maximum: 3094
range: 3094
mean: 22.0228
mean of absolute values: 22.0228
standard deviation: 76.1639
variance: 5800.94
variation coefficient: 345.841 %
sum: 15222164

On Tue, Jun 15, 2010 at 12:22 PM, Hamish <hamish_b@yahoo.com> wrote:

Micha wrote:

The only unusual thing I notice above is that the resolution settings
for the raster are different N-S and E-W. This came from the original
tiff (see below) which also has rectangular pixels,

that is perfectly normal for a lat/lon map away from the equator.
longitude scales a cos(lat).

(the v.rast.stats module creates a temp raster at the current region’s
resolution
settings, which might be different from this rainfall
raster’s rectangular resolution…)

the results of:

g.region -p rast=mapname
r.univar mapname

could help.

Hamish


Kind Regards
TS Gumede
CSIR, Meraka Institute
072 258 1650

This mail was received via Mail-SeCure System.

-- 
Micha Silver
[http://www.surfaces.co.il/](http://www.surfaces.co.il/)
Arava Development Co.  +972-52-3665918
      


Kind Regards
TS Gumede
CSIR, Meraka Institute
072 258 1650


Kind Regards
TS Gumede
CSIR, Meraka Institute
072 258 1650

This mail was received via Mail-SeCure System.

-- 
Micha Silver
Arava Development Co. +972-52-3665918
[http://surfaces.co.il](http://surfaces.co.il)


Kind Regards
TS Gumede
CSIR, Meraka Institute
072 258 1650

Hello Micha,

Can you please put all the steps you did here?

I think all the steps are already below.

···
-- 
Micha Silver
Arava Development Co. +972-52-3665918
[http://surfaces.co.il](http://surfaces.co.il)