[GRASS-user] Possible bug in r.sum and in r.stats?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi

I get the following output as seen on the screenshot.

My setup:

one mapset PERMANENT (linked), one mapset in which the map is,
executed from mapset ANALYSIS.

$R@$MS is
HSericea_seedsPlant_2037@HakSim.279.edited.tar.gz.CapePeninsula.CapePeninsula.none-12

Look at the number of cells in r.stats, compared to total cells as
given by r.info (which is correct).

Any ideas what is happening? I want to calculate the sum of the same
map in 500 different mapsets, so I am using this approach.

Any input welcome,

Rainer

- --
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel : +33 - (0)9 53 10 27 44
Cell: +33 - (0)6 85 62 59 98
Fax : +33 - (0)9 58 10 27 44

Fax (D): +49 - (0)3 21 21 25 22 44

email: Rainer@krugs.de

Skype: RMkrug
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9WKTgACgkQoYgNqgF2egp6swCeOstKZfNu31bjam578AZWrXNi
+nMAnRP9HD5yhh2/BotB44ZUjPxnCh2n
=MQEU
-----END PGP SIGNATURE-----

(attachments)

screen.png
screen.png.sig (72 Bytes)

Rainer M Krug wrote:

I get the following output as seen on the screenshot.

In future, please copy/paste the text rather than using a screenshot.

Look at the number of cells in r.stats, compared to total cells as
given by r.info (which is correct).

Any ideas what is happening?

Does the current region match the raster? r.info displays statistics
for the underlying raster; the data which r.stats uses is resampled
and cropped/padded according to the current region.

--
Glynn Clements <glynn@gclements.plus.com>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 07/03/12 21:20, Glynn Clements wrote:

Rainer M Krug wrote:

I get the following output as seen on the screenshot.

In future, please copy/paste the text rather than using a screenshot.

I wanted to, but it was completely garbled due to line breaks:
I now changed the wraplength setting (thunderbird -
http://forums.mozillazine.org/viewtopic.php?f=29&t=1598995), and it would have looked fine.

Look at the number of cells in r.stats, compared to total cells as given by r.info (which is
correct).

Any ideas what is happening?

Does the current region match the raster? r.info displays statistics for the underlying raster;
the data which r.stats uses is resampled and cropped/padded according to the current region.

Thanks a lot - that is the problem - the wind file was different. Fixed it and it is working now.

As some commands do use the region and mask, while others don't, it might be a good idea to make
this clear in the manual - I know, it is stated if they do, but not if they don't.

An sub-section under the Description might be an option?

Cheers,

Rainer

- --
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys.
(Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel : +33 - (0)9 53 10 27 44
Cell: +33 - (0)6 85 62 59 98
Fax : +33 - (0)9 58 10 27 44

Fax (D): +49 - (0)3 21 21 25 22 44

email: Rainer@krugs.de

Skype: RMkrug
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9Yf0wACgkQoYgNqgF2egq6mgCfb6AzJXqW9nSVnDOc9JdH31dR
D+gAn37fhHZp/Jkfn/TJEZvy0CqTKmoI
=dbyd
-----END PGP SIGNATURE-----

On 08/03/2012 10:43, Rainer M Krug wrote:

As some commands do use the region and mask, while others don't, it might be a good idea to make
this clear in the manual - I know, it is stated if they do, but not if they don't.

An sub-section under the Description might be an option?

This question does indeed come up occasionally. You could perhaps have a look at [1], then go to Next message > Next message > ...

Hermann

[1] http://lists.osgeo.org/pipermail/grass-user/2010-September/057988.html

On Thu, Mar 8, 2012 at 11:34 AM, Hermann Peifer <peifer@gmx.eu> wrote:

On 08/03/2012 10:43, Rainer M Krug wrote:

As some commands do use the region and mask, while others don't, it might
be a good idea to make
this clear in the manual - I know, it is stated if they do, but not if
they don't.

An sub-section under the Description might be an option?

I am always ready to improve the documentation but in this file should
additions go?

This question does indeed come up occasionally. You could perhaps have a
look at [1], then go to Next message > Next message > ...

Hermann

[1] http://lists.osgeo.org/pipermail/grass-user/2010-September/057988.html

Fine - just let me know where to add stuff.

thanks
Markus

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 08/03/12 12:20, Markus Neteler wrote:

On Thu, Mar 8, 2012 at 11:34 AM, Hermann Peifer <peifer@gmx.eu> wrote:

On 08/03/2012 10:43, Rainer M Krug wrote:

As some commands do use the region and mask, while others don't, it might be a good idea to
make this clear in the manual - I know, it is stated if they do, but not if they don't.

An sub-section under the Description might be an option?

I am always ready to improve the documentation but in this file should additions go?

I looked at it again - there are effectively two solutions I could think of:

1) on raster.html, the list of raster commands could be split into two lists, one "respecting
region and MASK", one "not respecting region and MASK" (or similar).

2) on the respective site of the module (e.g. r.mapcalc.html), under DESCRIPTION,

add a standard sentence as a last paragraph :

"This module *respects* the region settings and the MASK"
or
"This module *does not respect* the region settings and the MASK"

In addition, it should actually also be added to the output of the --help of the modules...

This question does indeed come up occasionally. You could perhaps have a look at [1], then go
to Next message > Next message > ...

Hermann

[1] http://lists.osgeo.org/pipermail/grass-user/2010-September/057988.html

Interesting read - clarified a few things for me.

Cheers,

Rainer

Fine - just let me know where to add stuff.

thanks Markus _______________________________________________ grass-user mailing list
grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user

- --
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys.
(Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel : +33 - (0)9 53 10 27 44
Cell: +33 - (0)6 85 62 59 98
Fax : +33 - (0)9 58 10 27 44

Fax (D): +49 - (0)3 21 21 25 22 44

email: Rainer@krugs.de

Skype: RMkrug
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9Ym8oACgkQoYgNqgF2egonpgCfXkAVzKP078owa1X0lhFTfb9B
o6kAn30mo/Nlp6Loimqr6Ti4rRJ5RNXp
=TLRH
-----END PGP SIGNATURE-----

Rainer M Krug wrote:

As some commands do use the region and mask, while others don't, it might be a good idea to make
this clear in the manual - I know, it is stated if they do, but not if they don't.

I would expect it to be the other way around. Most raster modules
respect the current region and mask, because it happens automatically.
Modules which don't want to use the current region have to explicitly
set the working region (typically based upon an input map); modules
which don't want inputs to be masked have to explicitly disable
masking.

As a general guideline, you should expect any module which actually
processes raster data to honour the current region and mask (r.info
isn't such a module; it just display's the map's metadata).

--
Glynn Clements <glynn@gclements.plus.com>

On 09/03/2012 00:16, Glynn Clements wrote:

I would expect it to be the other way around. Most raster modules
respect the current region and mask, because it happens automatically.
Modules which don't want to use the current region have to explicitly
set the working region (typically based upon an input map); modules
which don't want inputs to be masked have to explicitly disable
masking.

Just a thought, not sure if it really makes sense:
Raster modules that ignore the current region and/or mask could issue some sort of warning, in analogy to "[Raster MASK present]" which comes up all the time if I have a MASK map somewhere in the visible mapsets.

Hermann

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 09/03/12 00:16, Glynn Clements wrote:

Rainer M Krug wrote:

As some commands do use the region and mask, while others don't, it might be a good idea to
make this clear in the manual - I know, it is stated if they do, but not if they don't.

I would expect it to be the other way around.

I might remember reading in the manual of a module that it uses the region and MASK - but in
general it might be the other way round.

Most raster modules respect the current region and mask, because it happens automatically.

So the default behaviour is: all r. modules respect the region and MASK, with some exceptions.

Modules which don't want to use the current region have to explicitly set the working region
(typically based upon an input map); modules which don't want inputs to be masked have to
explicitly disable masking.

Makes sense.

As a general guideline, you should expect any module which actually processes raster data to
honour the current region and mask (r.info isn't such a module; it just display's the map's
metadata).

Based on what you say, I think it might be a good idea to

a) state this on the manual page about the raster modules, and

b) separate the list of raster modules into the ones which
  - respect region and MASK
  - respect region only
  - respect MASK only (I don't thik there are any)
  - use the region of the map and don't use MASK

I think this would clarify things a lot.

Cheers,

Rainer

- --
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys.
(Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel : +33 - (0)9 53 10 27 44
Cell: +33 - (0)6 85 62 59 98
Fax : +33 - (0)9 58 10 27 44

Fax (D): +49 - (0)3 21 21 25 22 44

email: Rainer@krugs.de

Skype: RMkrug
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9ZwFoACgkQoYgNqgF2egr4jACfad9tQFKGhHeUKDwrhWLhzaAQ
raAAn1yv3Uu2PzgD+hjDRWAIZgSskPm2
=VNgR
-----END PGP SIGNATURE-----

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 09/03/12 09:05, Hermann Peifer wrote:

On 09/03/2012 00:16, Glynn Clements wrote:

I would expect it to be the other way around. Most raster modules respect the current region
and mask, because it happens automatically. Modules which don't want to use the current
region have to explicitly set the working region (typically based upon an input map);
modules which don't want inputs to be masked have to explicitly disable masking.

Just a thought, not sure if it really makes sense: Raster modules that ignore the current
region and/or mask could issue some sort of warning, in analogy to "[Raster MASK present]"
which comes up all the time if I have a MASK map somewhere in the visible mapsets.

I think that's a good idea - something along the lines of:

"[region ignored for this command]"
and
"[MASK ignored for this command]"

Rainer

Hermann

- --
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys.
(Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel : +33 - (0)9 53 10 27 44
Cell: +33 - (0)6 85 62 59 98
Fax : +33 - (0)9 58 10 27 44

Fax (D): +49 - (0)3 21 21 25 22 44

email: Rainer@krugs.de

Skype: RMkrug
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9ZwawACgkQoYgNqgF2egoTHACbBb6vogFXiJdH8pPUiV7/msop
2/QAn3mkiSltkoradtmuhjxnND7c3lvy
=w4PR
-----END PGP SIGNATURE-----