[GRASS-dev] [GRASS-user] execGRASS("r.diversity"): [Error 3] Cannot find path specified \\.grass7\\r.li

[CC to grass-dev]

Sandra MacFadyen wrote:

  File "C:/Program Files (x86)/GRASS GIS 7.0.0beta2/scripts/r.diversity.py",
line 116, in main
    os.mkdir(rlidir)
WindowsError: [Error 3] The system cannot find the path specified:
'D:/Bands_processed1\\.grass7\\r.li'

r.diversity.py is broken on Windows:

    home = os.path.expanduser('~')
    rlidir = os.path.join(home, '.grass7', 'r.li')

The script tries to create an r.li subdirectory, but fails because the
parent directory doesn't exist.

$HOME/.grass7 is correct for Unix, but on Windows it's
%APPDATA%\GRASS7. From lib/init/grass.py:

    # configuration directory
    grass_env_file = None # see check_shell()
    if sys.platform == 'win32':
        grass_config_dirname = "GRASS7"
        grass_config_dir = os.path.join(os.getenv('APPDATA'), grass_config_dirname)
    else:
        grass_config_dirname = ".grass7"
        grass_config_dir = os.path.join(os.getenv('HOME'), grass_config_dirname)

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

On Wed, May 21, 2014 at 7:38 PM, Glynn Clements
<glynn@gclements.plus.com> wrote:

[CC to grass-dev]

Sandra MacFadyen wrote:

  File "C:/Program Files (x86)/GRASS GIS 7.0.0beta2/scripts/r.diversity.py",
line 116, in main
    os.mkdir(rlidir)
WindowsError: [Error 3] The system cannot find the path specified:
'D:/Bands_processed1\\.grass7\\r.li'

r.diversity.py is broken on Windows:

    home = os.path.expanduser('~')
    rlidir = os.path.join(home, '.grass7', 'r.li')

The script tries to create an r.li subdirectory, but fails because the
parent directory doesn't exist.

$HOME/.grass7 is correct for Unix, but on Windows it's
%APPDATA%\GRASS7. From lib/init/grass.py:

    # configuration directory
    grass_env_file = None # see check_shell()
    if sys.platform == 'win32':
        grass_config_dirname = "GRASS7"
        grass_config_dir = os.path.join(os.getenv('APPDATA'), grass_config_dirname)
    else:
        grass_config_dirname = ".grass7"
        grass_config_dir = os.path.join(os.getenv('HOME'), grass_config_dirname)

I have added that in r60403.

Sandra, please try the updated version from Addons SVN.

Markus

Hi Markus,

Thank you for your reponse.
I have updated r.diversity.py and r.diversity.html

I now get the following error:

execGRASS("r.diversity",flags="overwrite", parameters=list(input="s1993_tm5_rad.1", prefix="s1993_tm5_rad_divers.1", alpha=0.5, size=5))

Error : XML content does not seem to be XML: ' File "C:/Program Files (x86)/GRASS GIS 7.1.svn/scripts/r.diversity.py", line 1
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;
    ^
SyntaxError: invalid syntax'
In addition: Warning message:
running command '"C:/Program Files (x86)/GRASS GIS 7.1.svn/extrabin/python.exe" "C:/Program Files (x86)/GRASS GIS 7.1.svn/scripts/"r.diversity.py --interface-description' had status 1
Error in parseGRASS(cmd, legacyExec = legacyExec) :
  r.diversity not parsed

Any ideas?

Thanks again
Sandra

-----Original Message-----
From: neteler.osgeo@gmail.com [mailto:neteler.osgeo@gmail.com] On Behalf Of Markus Neteler
Sent: 22 May 2014 08:53 AM
To: Glynn Clements
Cc: Sandra MacFadyen; GRASS user list; GRASS developers list
Subject: Re: [GRASS-dev] [GRASS-user] execGRASS("r.diversity"): [Error 3] Cannot find path specified \\.grass7\\r.li

On Wed, May 21, 2014 at 7:38 PM, Glynn Clements <glynn@gclements.plus.com> wrote:

[CC to grass-dev]

Sandra MacFadyen wrote:

  File "C:/Program Files (x86)/GRASS GIS
7.0.0beta2/scripts/r.diversity.py",
line 116, in main
    os.mkdir(rlidir)
WindowsError: [Error 3] The system cannot find the path specified:
'D:/Bands_processed1\\.grass7\\r.li'

r.diversity.py is broken on Windows:

    home = os.path.expanduser('~')
    rlidir = os.path.join(home, '.grass7', 'r.li')

The script tries to create an r.li subdirectory, but fails because the
parent directory doesn't exist.

$HOME/.grass7 is correct for Unix, but on Windows it's
%APPDATA%\GRASS7. From lib/init/grass.py:

    # configuration directory
    grass_env_file = None # see check_shell()
    if sys.platform == 'win32':
        grass_config_dirname = "GRASS7"
        grass_config_dir = os.path.join(os.getenv('APPDATA'), grass_config_dirname)
    else:
        grass_config_dirname = ".grass7"
        grass_config_dir = os.path.join(os.getenv('HOME'),
grass_config_dirname)

I have added that in r60403.

Sandra, please try the updated version from Addons SVN.

Markus

Woops!
Ignore that last message. Something went wrong during the file download.
I have the correct update of r.diversity.py in the correct directory but now I am getting an error, " Illegal areas disposition"

execGRASS("r.diversity",flags="overwrite", parameters=list(input="s1993_tm5_rad.1", prefix="s1993_tm5_rad_divers.1", alpha=0.5, size=5))

ERROR: Illegal areas disposition
ERROR: Illegal areas disposition
ERROR: Illegal areas disposition
ERROR: Illegal areas disposition
Done.

As replied to Glynn earlier. I created a configuration file using r.li.setup in this directory as follows:

"conf_diversity_5.0"
SAMPLINGFRAME 0|0|1|1
SAMPLEAREA -1|-1|0.010526315789473684|0.009487666034155597
MOVINGWINDOW

This file disappears after the error occurs above.

Thanks
Sandra

-----Original Message-----
From: Sandra MacFadyen [mailto:sandramf@live.co.za]
Sent: 22 May 2014 09:21 AM
To: 'Markus Neteler'; 'Glynn Clements'
Cc: 'GRASS user list'; 'GRASS developers list'
Subject: RE: [GRASS-dev] [GRASS-user] execGRASS("r.diversity"): [Error 3] Cannot find path specified \\.grass7\\r.li

Hi Markus,

Thank you for your reponse.
I have updated r.diversity.py and r.diversity.html

I now get the following error:

execGRASS("r.diversity",flags="overwrite",
parameters=list(input="s1993_tm5_rad.1",
prefix="s1993_tm5_rad_divers.1", alpha=0.5, size=5))

Error : XML content does not seem to be XML: ' File "C:/Program Files (x86)/GRASS GIS 7.1.svn/scripts/r.diversity.py", line 1
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;
    ^
SyntaxError: invalid syntax'
In addition: Warning message:
running command '"C:/Program Files (x86)/GRASS GIS 7.1.svn/extrabin/python.exe" "C:/Program Files (x86)/GRASS GIS 7.1.svn/scripts/"r.diversity.py --interface-description' had status 1 Error in parseGRASS(cmd, legacyExec = legacyExec) :
  r.diversity not parsed

Any ideas?

Thanks again
Sandra

-----Original Message-----
From: neteler.osgeo@gmail.com [mailto:neteler.osgeo@gmail.com] On Behalf Of Markus Neteler
Sent: 22 May 2014 08:53 AM
To: Glynn Clements
Cc: Sandra MacFadyen; GRASS user list; GRASS developers list
Subject: Re: [GRASS-dev] [GRASS-user] execGRASS("r.diversity"): [Error 3] Cannot find path specified \\.grass7\\r.li

On Wed, May 21, 2014 at 7:38 PM, Glynn Clements <glynn@gclements.plus.com> wrote:

[CC to grass-dev]

Sandra MacFadyen wrote:

  File "C:/Program Files (x86)/GRASS GIS
7.0.0beta2/scripts/r.diversity.py",
line 116, in main
    os.mkdir(rlidir)
WindowsError: [Error 3] The system cannot find the path specified:
'D:/Bands_processed1\\.grass7\\r.li'

r.diversity.py is broken on Windows:

    home = os.path.expanduser('~')
    rlidir = os.path.join(home, '.grass7', 'r.li')

The script tries to create an r.li subdirectory, but fails because the
parent directory doesn't exist.

$HOME/.grass7 is correct for Unix, but on Windows it's
%APPDATA%\GRASS7. From lib/init/grass.py:

    # configuration directory
    grass_env_file = None # see check_shell()
    if sys.platform == 'win32':
        grass_config_dirname = "GRASS7"
        grass_config_dir = os.path.join(os.getenv('APPDATA'), grass_config_dirname)
    else:
        grass_config_dirname = ".grass7"
        grass_config_dir = os.path.join(os.getenv('HOME'),
grass_config_dirname)

I have added that in r60403.

Sandra, please try the updated version from Addons SVN.

Markus

Hi Sandra,

(adding Luca Delucchi, author, in cc)

back to the full problem:

On Wed, May 21, 2014 at 12:08 PM, Sandra MacFadyen <sandramf@live.co.za> wrote:
...

I am new to GRASS and have a problem executing the r.diversity function via
R 3.1.0 and GRASS 7beta2:

When running the code:

# Calculate spectral diversity per band with windows size 5x5
execGRASS("r.diversity",flags="overwrite", parameters=list(input="name.1",
prefix="name_divers.1", alpha=0.5, size=5))

Could you run the command directly in GRASS (rather than R) for a test?

On Thu, May 22, 2014 at 9:31 AM, Sandra MacFadyen <sandramf@live.co.za> wrote:
...

I have the correct update of r.diversity.py in the correct directory but now I am getting an error, " Illegal areas disposition"

execGRASS("r.diversity",flags="overwrite", parameters=list(input="s1993_tm5_rad.1", prefix="s1993_tm5_rad_divers.1", alpha=0.5, size=5))

ERROR: Illegal areas disposition
ERROR: Illegal areas disposition
ERROR: Illegal areas disposition
ERROR: Illegal areas disposition
Done.

As replied to Glynn earlier. I created a configuration file using r.li.setup in this directory as follows:

The command r.diversity does not require the creation of a config
file. This is done automatically for the indices calculated by the
command (on the contrary to the r.li.* commands which do need such a
config file).

"conf_diversity_5.0"
SAMPLINGFRAME 0|0|1|1
SAMPLEAREA -1|-1|0.010526315789473684|0.009487666034155597
MOVINGWINDOW

This file disappears after the error occurs above.

You just named it by chance as the internal file name of the command.
@author: Perhaps a PID or something random (urandom?) might be added
to avoid this non-issue :slight_smile:

If you want to control everything, probably you need to pick the
r.li.* command of interest which accepts configuration files.

Best
Markus

Hi Markus,

No, when run directly in GRASS, I get the same error:

r.diversity --overwrite input=s1993_tm5_rad.1@test1 prefix=s1993_div_ alpha=0.5 size=5
ERROR: Illegal areas disposition
ERROR: Illegal areas disposition
ERROR: Illegal areas disposition
ERROR: Illegal areas disposition
Done.

I also doubled checked my projection as region settings, which appear fine:

execGRASS("g.proj", flags="p")

-PROJ_INFO-------------------------------------------------
name : Universal Transverse Mercator
proj : utm
datum : wgs84
ellps : wgs84
zone : 36
south : defined
no_defs : defined
-PROJ_EPSG-------------------------------------------------
epsg : 32736
-PROJ_UNITS------------------------------------------------
unit : meter
units : meters
meters : 1

execGRASS("g.region", flags=c("p","m"))

projection: 1 (UTM)
zone: -36
datum: wgs84
ellipsoid: wgs84
north: 7389715
south: 7179985
west: 272685
east: 506715
nsres: 30
ewres: 30
rows: 6991
cols: 7801
cells: 54536791

I removed the config files I created and still the same error :frowning:

If I run r.li.shannon instead, the text file is created but it's empty.

execGRASS("r.li.shannon", parameters=list(input="s1993_tm5_rad.1", config="conf_diversity_5.0", output="s1993_tm5_rad_shan.1"))

RLISHA~1 complete. Result written to text file
<C:\Users\LFoxcroft\AppData\Roaming\GRASS7\r.li\output\s1993_tm5_rad_shan.1>
Warning message:
running command 'r.li.shannon.exe input=s1993_tm5_rad.1 config=conf_diversity_5.0 output=s1993_tm5_rad_shan.1' had status 1

Thanks
Sandra

-----Original Message-----
From: neteler.osgeo@gmail.com [mailto:neteler.osgeo@gmail.com] On Behalf Of Markus Neteler
Sent: 22 May 2014 10:48 AM
To: Sandra MacFadyen
Cc: Glynn Clements; GRASS user list; Luca Delucchi
Subject: Re: [GRASS-dev] [GRASS-user] execGRASS("r.diversity"): [Error 3] Cannot find path specified \\.grass7\\r.li

Hi Sandra,

(adding Luca Delucchi, author, in cc)

back to the full problem:

On Wed, May 21, 2014 at 12:08 PM, Sandra MacFadyen <sandramf@live.co.za> wrote:
...

I am new to GRASS and have a problem executing the r.diversity
function via R 3.1.0 and GRASS 7beta2:

When running the code:

# Calculate spectral diversity per band with windows size 5x5
execGRASS("r.diversity",flags="overwrite",
parameters=list(input="name.1", prefix="name_divers.1", alpha=0.5,
size=5))

Could you run the command directly in GRASS (rather than R) for a test?

On Thu, May 22, 2014 at 9:31 AM, Sandra MacFadyen <sandramf@live.co.za> wrote:
...

I have the correct update of r.diversity.py in the correct directory but now I am getting an error, " Illegal areas disposition"

execGRASS("r.diversity",flags="overwrite",
parameters=list(input="s1993_tm5_rad.1",
prefix="s1993_tm5_rad_divers.1", alpha=0.5, size=5))

ERROR: Illegal areas disposition
ERROR: Illegal areas disposition
ERROR: Illegal areas disposition
ERROR: Illegal areas disposition
Done.

As replied to Glynn earlier. I created a configuration file using r.li.setup in this directory as follows:

The command r.diversity does not require the creation of a config file. This is done automatically for the indices calculated by the command (on the contrary to the r.li.* commands which do need such a config file).

"conf_diversity_5.0"
SAMPLINGFRAME 0|0|1|1
SAMPLEAREA -1|-1|0.010526315789473684|0.009487666034155597
MOVINGWINDOW

This file disappears after the error occurs above.

You just named it by chance as the internal file name of the command.
@author: Perhaps a PID or something random (urandom?) might be added to avoid this non-issue :slight_smile:

If you want to control everything, probably you need to pick the
r.li.* command of interest which accepts configuration files.

Best
Markus

Hi Luca,

Thank you very much for your reply.

With the north carolina dataset on image-band "lsat5_1987_10" I get the same error:

(Thu May 22 14:35:33 2014)
r.diversity input=lsat5_1987_10@landsat prefix=lsat5_1987_div_ alpha=0.5 size=5
ERROR: Illegal areas disposition
ERROR: Illegal areas disposition
ERROR: Illegal areas disposition
ERROR: Illegal areas disposition
Done.
(Thu May 22 14:35:34 2014) Command finished (0 sec)

When running "g.region rast=s1993_tm5_rad.1@test1 -ap", I get the same error:

execGRASS("g.region", flags=c("a", "p"), rast="s1993_tm5_rad.1")

projection: 1 (UTM)
zone: -36
datum: wgs84
ellipsoid: wgs84
north: 7389715
south: 7179985
west: 272685
east: 506715
nsres: 30
ewres: 30
rows: 6991
cols: 7801
cells: 54536791

execGRASS("r.diversity",flags="overwrite", parameters=list(input="s1993_tm5_rad.1", prefix="s1993_tm5_rad_divers.1", alpha=0.5, size=5))

ERROR: Illegal areas disposition
ERROR: Illegal areas disposition
ERROR: Illegal areas disposition
ERROR: Illegal areas disposition
Done.

I upgraded to GRASS GIS 7.1svn (60382), with the same results.

Thank you
Sandra

-----Original Message-----
From: Luca Delucchi [mailto:lucadeluge@gmail.com]
Sent: 22 May 2014 01:41 PM
To: Sandra MacFadyen
Cc: Markus Neteler; Glynn Clements; GRASS user list
Subject: Re: [GRASS-dev] [GRASS-user] execGRASS("r.diversity"): [Error 3] Cannot find path specified \\.grass7\\r.li

On 22 May 2014 12:06, Sandra MacFadyen <sandramf@live.co.za> wrote:

Hi Markus,

Hi Sandra

No, when run directly in GRASS, I get the same error:

r.diversity --overwrite input=s1993_tm5_rad.1@test1 prefix=s1993_div_
alpha=0.5 size=5
ERROR: Illegal areas disposition
ERROR: Illegal areas disposition
ERROR: Illegal areas disposition
ERROR: Illegal areas disposition
Done.

please could you make a test with north carolina dataset [0] with a landsat image?
I'm not able to replicate your problem....

I also doubled checked my projection as region settings, which appear fine:

execGRASS("g.proj", flags="p")

-PROJ_INFO-------------------------------------------------
name : Universal Transverse Mercator
proj : utm
datum : wgs84
ellps : wgs84
zone : 36
south : defined
no_defs : defined
-PROJ_EPSG-------------------------------------------------
epsg : 32736
-PROJ_UNITS------------------------------------------------
unit : meter
units : meters
meters : 1

execGRASS("g.region", flags=c("p","m"))

projection: 1 (UTM)
zone: -36
datum: wgs84
ellipsoid: wgs84
north: 7389715
south: 7179985
west: 272685
east: 506715
nsres: 30
ewres: 30
rows: 6991
cols: 7801
cells: 54536791

could you please run before "g.region rast=s1993_tm5_rad.1@test1 -ap"

I removed the config files I created and still the same error :frowning:

With r.diversity no text file will be created but the outputs are maps...

If I run r.li.shannon instead, the text file is created but it's empty.

execGRASS("r.li.shannon", parameters=list(input="s1993_tm5_rad.1",
config="conf_diversity_5.0", output="s1993_tm5_rad_shan.1"))

RLISHA~1 complete. Result written to text file
<C:\Users\LFoxcroft\AppData\Roaming\GRASS7\r.li\output\s1993_tm5_rad_s
han.1>
Warning message:
running command 'r.li.shannon.exe input=s1993_tm5_rad.1
config=conf_diversity_5.0 output=s1993_tm5_rad_shan.1' had status 1

This seems another problem....

[0] http://grass.osgeo.org/sampledata/north_carolina/nc_spm_08_grass7.tar.gz

Thanks
Sandra

--
ciao
Luca

http://gis.cri.fmach.it/delucchi/
www.lucadelu.org

Hi Sandra,

On Thu, May 22, 2014 at 2:45 PM, Sandra MacFadyen <sandramf@live.co.za> wrote:

Hi Luca,

Thank you very much for your reply.

With the north carolina dataset on image-band "lsat5_1987_10" I get the same error:

(Thu May 22 14:35:33 2014)
r.diversity input=lsat5_1987_10@landsat prefix=lsat5_1987_div_ alpha=0.5 size=5
ERROR: Illegal areas disposition
ERROR: Illegal areas disposition
ERROR: Illegal areas disposition
ERROR: Illegal areas disposition
Done.
(Thu May 22 14:35:34 2014) Command finished (0 sec)

But did you set the computation region to the map "lsat5_1987_10"
*before*? Just to be sure...

Markus

Hi Luca,

Yes, I set the region to "lsat5_1987_10" beforehand:

g.region -p
projection: 99 (Lambert Conformal Conic)
zone: 0
datum: nad83
ellipsoid: a=6378137 es=0.006694380022900787
north: 228513
south: 214975.5
west: 629992.5
east: 645012
nsres: 28.5
ewres: 28.5
rows: 475
cols: 527
cells: 250325

Cheers
Sandra

-----Original Message-----
From: neteler.osgeo@gmail.com [mailto:neteler.osgeo@gmail.com] On Behalf Of Markus Neteler
Sent: 24 May 2014 08:51 AM
To: Sandra MacFadyen
Cc: Luca Delucchi; Glynn Clements; GRASS user list
Subject: Re: [GRASS-dev] [GRASS-user] execGRASS("r.diversity"): [Error 3] Cannot find path specified \\.grass7\\r.li

Hi Sandra,

On Thu, May 22, 2014 at 2:45 PM, Sandra MacFadyen <sandramf@live.co.za> wrote:

Hi Luca,

Thank you very much for your reply.

With the north carolina dataset on image-band "lsat5_1987_10" I get the same error:

(Thu May 22 14:35:33 2014)
r.diversity input=lsat5_1987_10@landsat prefix=lsat5_1987_div_ alpha=0.5 size=5
ERROR: Illegal areas disposition
ERROR: Illegal areas disposition
ERROR: Illegal areas disposition
ERROR: Illegal areas disposition
Done.
(Thu May 22 14:35:34 2014) Command finished (0 sec)

But did you set the computation region to the map "lsat5_1987_10"
*before*? Just to be sure...

Markus

On Sat, May 24, 2014 at 9:16 AM, Sandra MacFadyen <sandramf@live.co.za> wrote:

Hi Luca,

Yes, I set the region to "lsat5_1987_10" beforehand:

g.region -p
projection: 99 (Lambert Conformal Conic)
zone: 0
datum: nad83
ellipsoid: a=6378137 es=0.006694380022900787
north: 228513
south: 214975.5
west: 629992.5
east: 645012
nsres: 28.5
ewres: 28.5
rows: 475
cols: 527
cells: 250325

ok - now let's make another test. First run

g.gisenv set="DEBUG=1"

then execute
r.diversity ... (your command line)

Please tell us what happens right before the error.

To switch the debug message off after that:
g.gisenv set="DEBUG=0"

Markus

Hi Markus,

Here are the results:

(Sat May 24 10:28:44 2014)
g.gisenv set=DEBUG=1
(Sat May 24 10:28:45 2014) Command finished (0 sec)
(Sat May 24 10:29:06 2014)
g.region rast=lsat5_1987_10@landsat
D1/1: G_find_raster2(): name=lsat5_1987_10@landsat mapset=
(Sat May 24 10:29:07 2014) Command finished (0 sec)
(Sat May 24 10:29:22 2014)
r.diversity input=lsat5_1987_10@landsat prefix=lsat5_1987_div_ alpha=0.5 size=5
D1/1: G_find_raster2(): name=lsat5_1987_10@landsat mapset=
D1/1: G_find_raster2(): name=lsat5_1987_10@landsat mapset=
D1/1: G_find_raster2(): name=lsat5_1987_10@landsat mapset=
D1/1: G_find_raster2(): name=lsat5_1987_10@landsat mapset=
D1/1: G_find_raster2(): name=lsat5_1987_10@landsat mapset=
D1/1: G_find_raster2(): name=lsat5_1987_10@landsat mapset=
D1/1: grass.script.core.start_command(): r.li.simpson --q
input=lsat5_1987_10@landsat conf=conf_diversity_5.0
output=lsat5_1987_div__simpson_size_5.0
D1/1: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D1/1: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D1/1: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D1/1: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D1/1: G_find_raster(): name=MASK mapset=landsat
D1/1: G_find_raster2(): name=lsat5_1987_10@landsat mapset=
D1/1: r.li.daemon pathSetup: [C:\Users\Sands\AppData\Roa
ming\GRASS7\r.li\conf_diversity_5.0]
ERROR: Illegal areas disposition
D1/1: grass.script.core.start_command(): r.li.shannon --q
input=lsat5_1987_10@landsat conf=conf_diversity_5.0
output=lsat5_1987_div__shannon_size_5.0
D1/1: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D1/1: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D1/1: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D1/1: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D1/1: G_find_raster(): name=MASK mapset=landsat
D1/1: G_find_raster2(): name=lsat5_1987_10@landsat mapset=
D1/1: r.li.daemon pathSetup: [C:\Users\Sands\AppData\Roa
ming\GRASS7\r.li\conf_diversity_5.0]
ERROR: Illegal areas disposition
D1/1: grass.script.core.start_command(): r.li.pielou --q
input=lsat5_1987_10@landsat conf=conf_diversity_5.0
output=lsat5_1987_div__pielou_size_5.0
D1/1: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D1/1: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D1/1: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D1/1: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D1/1: G_find_raster(): name=MASK mapset=landsat
D1/1: G_find_raster2(): name=lsat5_1987_10@landsat mapset=
D1/1: r.li.daemon pathSetup: [C:\Users\Sands\AppData\Roa
ming\GRASS7\r.li\conf_diversity_5.0]
ERROR: Illegal areas disposition
D1/1: grass.script.core.start_command(): r.li.renyi --q
output=lsat5_1987_div__renyi_size_5.0_alpha_0.5
input=lsat5_1987_10@landsat conf=conf_diversity_5.0
alpha=0.5
D1/1: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D1/1: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D1/1: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D1/1: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D1/1: G_find_raster(): name=MASK mapset=landsat
D1/1: G_find_raster2(): name=lsat5_1987_10@landsat mapset=
D1/1: r.li.daemon pathSetup: [C:\Users\Sands\AppData\Roa
ming\GRASS7\r.li\conf_diversity_5.0]
ERROR: Illegal areas disposition
D1/1: grass.script.core.start_command(): g.message
message=Done.
Done.
(Sat May 24 10:29:23 2014) Command finished (0 sec)
(Sat May 24 10:29:40 2014)
g.gisenv set=DEBUG=0
(Sat May 24 10:29:41 2014) Command finished (0 sec)

Looks like it wants the conf_diversity_5.0 file from C:\Users\Sands\AppData\Roa
ming\GRASS7\r.li\conf_diversity_5.0? Which is not there.

Thanks again for all your help.

Cheers
Sandra

-----Original Message-----
From: neteler.osgeo@gmail.com [mailto:neteler.osgeo@gmail.com] On Behalf Of Markus Neteler
Sent: 24 May 2014 10:13 AM
To: Sandra MacFadyen
Cc: Luca Delucchi; Glynn Clements; GRASS user list
Subject: Re: [GRASS-dev] [GRASS-user] execGRASS("r.diversity"): [Error 3] Cannot find path specified \\.grass7\\r.li

On Sat, May 24, 2014 at 9:16 AM, Sandra MacFadyen <sandramf@live.co.za> wrote:

Hi Luca,

Yes, I set the region to "lsat5_1987_10" beforehand:

g.region -p
projection: 99 (Lambert Conformal Conic)
zone: 0
datum: nad83
ellipsoid: a=6378137 es=0.006694380022900787
north: 228513
south: 214975.5
west: 629992.5
east: 645012
nsres: 28.5
ewres: 28.5
rows: 475
cols: 527
cells: 250325

ok - now let's make another test. First run

g.gisenv set="DEBUG=1"

then execute
r.diversity ... (your command line)

Please tell us what happens right before the error.

To switch the debug message off after that:
g.gisenv set="DEBUG=0"

Markus

P.S.

If I create conf_diversity_5.0 using g.gui.rlisetup as follows:

(Sat May 24 10:34:53 2014)
g.gui.rlisetup
D1/1: grass.script.core.start_command(): g.gisenv -n
(Sat May 24 10:35:04 2014) Command finished (10 sec)

I get the following conf_diversity_5.0 file content:

SAMPLINGFRAME 0|0|1|1
SAMPLEAREA -1|-1|0.010526315789473684|0.009487666034155597
MOVINGWINDOW

The sample area, shouldn't that be the bounding coordinates of lsat5_1987_10, in this case meters (lcc, nad83?)

-----Original Message-----
From: Sandra MacFadyen [mailto:sandramf@live.co.za]
Sent: 24 May 2014 10:32 AM
To: 'Markus Neteler'
Cc: 'Luca Delucchi'; 'Glynn Clements'; 'GRASS user list'
Subject: RE: [GRASS-dev] [GRASS-user] execGRASS("r.diversity"): [Error 3] Cannot find path specified \\.grass7\\r.li

Hi Markus,

Here are the results:

(Sat May 24 10:28:44 2014)
g.gisenv set=DEBUG=1
(Sat May 24 10:28:45 2014) Command finished (0 sec)
(Sat May 24 10:29:06 2014)
g.region rast=lsat5_1987_10@landsat
D1/1: G_find_raster2(): name=lsat5_1987_10@landsat mapset=
(Sat May 24 10:29:07 2014) Command finished (0 sec)
(Sat May 24 10:29:22 2014)
r.diversity input=lsat5_1987_10@landsat prefix=lsat5_1987_div_ alpha=0.5 size=5
D1/1: G_find_raster2(): name=lsat5_1987_10@landsat mapset=
D1/1: G_find_raster2(): name=lsat5_1987_10@landsat mapset=
D1/1: G_find_raster2(): name=lsat5_1987_10@landsat mapset=
D1/1: G_find_raster2(): name=lsat5_1987_10@landsat mapset=
D1/1: G_find_raster2(): name=lsat5_1987_10@landsat mapset=
D1/1: G_find_raster2(): name=lsat5_1987_10@landsat mapset=
D1/1: grass.script.core.start_command(): r.li.simpson --q input=lsat5_1987_10@landsat conf=conf_diversity_5.0
output=lsat5_1987_div__simpson_size_5.0
D1/1: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D1/1: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D1/1: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D1/1: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D1/1: G_find_raster(): name=MASK mapset=landsat
D1/1: G_find_raster2(): name=lsat5_1987_10@landsat mapset=
D1/1: r.li.daemon pathSetup: [C:\Users\Sands\AppData\Roa ming\GRASS7\r.li\conf_diversity_5.0]
ERROR: Illegal areas disposition
D1/1: grass.script.core.start_command(): r.li.shannon --q input=lsat5_1987_10@landsat conf=conf_diversity_5.0
output=lsat5_1987_div__shannon_size_5.0
D1/1: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D1/1: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D1/1: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D1/1: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D1/1: G_find_raster(): name=MASK mapset=landsat
D1/1: G_find_raster2(): name=lsat5_1987_10@landsat mapset=
D1/1: r.li.daemon pathSetup: [C:\Users\Sands\AppData\Roa ming\GRASS7\r.li\conf_diversity_5.0]
ERROR: Illegal areas disposition
D1/1: grass.script.core.start_command(): r.li.pielou --q input=lsat5_1987_10@landsat conf=conf_diversity_5.0
output=lsat5_1987_div__pielou_size_5.0
D1/1: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D1/1: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D1/1: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D1/1: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D1/1: G_find_raster(): name=MASK mapset=landsat
D1/1: G_find_raster2(): name=lsat5_1987_10@landsat mapset=
D1/1: r.li.daemon pathSetup: [C:\Users\Sands\AppData\Roa ming\GRASS7\r.li\conf_diversity_5.0]
ERROR: Illegal areas disposition
D1/1: grass.script.core.start_command(): r.li.renyi --q
output=lsat5_1987_div__renyi_size_5.0_alpha_0.5
input=lsat5_1987_10@landsat conf=conf_diversity_5.0
alpha=0.5
D1/1: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D1/1: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D1/1: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D1/1: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D1/1: G_find_raster(): name=MASK mapset=landsat
D1/1: G_find_raster2(): name=lsat5_1987_10@landsat mapset=
D1/1: r.li.daemon pathSetup: [C:\Users\Sands\AppData\Roa ming\GRASS7\r.li\conf_diversity_5.0]
ERROR: Illegal areas disposition
D1/1: grass.script.core.start_command(): g.message message=Done.
Done.
(Sat May 24 10:29:23 2014) Command finished (0 sec)
(Sat May 24 10:29:40 2014)
g.gisenv set=DEBUG=0
(Sat May 24 10:29:41 2014) Command finished (0 sec)

Looks like it wants the conf_diversity_5.0 file from C:\Users\Sands\AppData\Roa ming\GRASS7\r.li\conf_diversity_5.0? Which is not there.

Thanks again for all your help.

Cheers
Sandra

-----Original Message-----
From: neteler.osgeo@gmail.com [mailto:neteler.osgeo@gmail.com] On Behalf Of Markus Neteler
Sent: 24 May 2014 10:13 AM
To: Sandra MacFadyen
Cc: Luca Delucchi; Glynn Clements; GRASS user list
Subject: Re: [GRASS-dev] [GRASS-user] execGRASS("r.diversity"): [Error 3] Cannot find path specified \\.grass7\\r.li

On Sat, May 24, 2014 at 9:16 AM, Sandra MacFadyen <sandramf@live.co.za> wrote:

Hi Luca,

Yes, I set the region to "lsat5_1987_10" beforehand:

g.region -p
projection: 99 (Lambert Conformal Conic)
zone: 0
datum: nad83
ellipsoid: a=6378137 es=0.006694380022900787
north: 228513
south: 214975.5
west: 629992.5
east: 645012
nsres: 28.5
ewres: 28.5
rows: 475
cols: 527
cells: 250325

ok - now let's make another test. First run

g.gisenv set="DEBUG=1"

then execute
r.diversity ... (your command line)

Please tell us what happens right before the error.

To switch the debug message off after that:
g.gisenv set="DEBUG=0"

Markus

Maybe a silly question but: Is there a space in the path where there shouldn't be: C:\Users\Sands\AppData\Roa ming\GRASS7\r.li\conf_diversity_5.0
i.e. "\Roa ming\"?

-----Original Message-----
From: Sandra MacFadyen [mailto:sandramf@live.co.za]
Sent: 24 May 2014 10:39 AM
To: 'Markus Neteler'
Cc: 'Luca Delucchi'; 'Glynn Clements'; 'GRASS user list'
Subject: RE: [GRASS-dev] [GRASS-user] execGRASS("r.diversity"): [Error 3] Cannot find path specified \\.grass7\\r.li

P.S.

If I create conf_diversity_5.0 using g.gui.rlisetup as follows:

(Sat May 24 10:34:53 2014)
g.gui.rlisetup
D1/1: grass.script.core.start_command(): g.gisenv -n (Sat May 24 10:35:04 2014) Command finished (10 sec)

I get the following conf_diversity_5.0 file content:

SAMPLINGFRAME 0|0|1|1
SAMPLEAREA -1|-1|0.010526315789473684|0.009487666034155597
MOVINGWINDOW

The sample area, shouldn't that be the bounding coordinates of lsat5_1987_10, in this case meters (lcc, nad83?)

-----Original Message-----
From: Sandra MacFadyen [mailto:sandramf@live.co.za]
Sent: 24 May 2014 10:32 AM
To: 'Markus Neteler'
Cc: 'Luca Delucchi'; 'Glynn Clements'; 'GRASS user list'
Subject: RE: [GRASS-dev] [GRASS-user] execGRASS("r.diversity"): [Error 3] Cannot find path specified \\.grass7\\r.li

Hi Markus,

Here are the results:

(Sat May 24 10:28:44 2014)
g.gisenv set=DEBUG=1
(Sat May 24 10:28:45 2014) Command finished (0 sec)
(Sat May 24 10:29:06 2014)
g.region rast=lsat5_1987_10@landsat
D1/1: G_find_raster2(): name=lsat5_1987_10@landsat mapset=
(Sat May 24 10:29:07 2014) Command finished (0 sec)
(Sat May 24 10:29:22 2014)
r.diversity input=lsat5_1987_10@landsat prefix=lsat5_1987_div_ alpha=0.5 size=5
D1/1: G_find_raster2(): name=lsat5_1987_10@landsat mapset=
D1/1: G_find_raster2(): name=lsat5_1987_10@landsat mapset=
D1/1: G_find_raster2(): name=lsat5_1987_10@landsat mapset=
D1/1: G_find_raster2(): name=lsat5_1987_10@landsat mapset=
D1/1: G_find_raster2(): name=lsat5_1987_10@landsat mapset=
D1/1: G_find_raster2(): name=lsat5_1987_10@landsat mapset=
D1/1: grass.script.core.start_command(): r.li.simpson --q input=lsat5_1987_10@landsat conf=conf_diversity_5.0
output=lsat5_1987_div__simpson_size_5.0
D1/1: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D1/1: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D1/1: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D1/1: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D1/1: G_find_raster(): name=MASK mapset=landsat
D1/1: G_find_raster2(): name=lsat5_1987_10@landsat mapset=
D1/1: r.li.daemon pathSetup: [C:\Users\Sands\AppData\Roa ming\GRASS7\r.li\conf_diversity_5.0]
ERROR: Illegal areas disposition
D1/1: grass.script.core.start_command(): r.li.shannon --q input=lsat5_1987_10@landsat conf=conf_diversity_5.0
output=lsat5_1987_div__shannon_size_5.0
D1/1: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D1/1: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D1/1: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D1/1: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D1/1: G_find_raster(): name=MASK mapset=landsat
D1/1: G_find_raster2(): name=lsat5_1987_10@landsat mapset=
D1/1: r.li.daemon pathSetup: [C:\Users\Sands\AppData\Roa ming\GRASS7\r.li\conf_diversity_5.0]
ERROR: Illegal areas disposition
D1/1: grass.script.core.start_command(): r.li.pielou --q input=lsat5_1987_10@landsat conf=conf_diversity_5.0
output=lsat5_1987_div__pielou_size_5.0
D1/1: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D1/1: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D1/1: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D1/1: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D1/1: G_find_raster(): name=MASK mapset=landsat
D1/1: G_find_raster2(): name=lsat5_1987_10@landsat mapset=
D1/1: r.li.daemon pathSetup: [C:\Users\Sands\AppData\Roa ming\GRASS7\r.li\conf_diversity_5.0]
ERROR: Illegal areas disposition
D1/1: grass.script.core.start_command(): r.li.renyi --q
output=lsat5_1987_div__renyi_size_5.0_alpha_0.5
input=lsat5_1987_10@landsat conf=conf_diversity_5.0
alpha=0.5
D1/1: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D1/1: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D1/1: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D1/1: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D1/1: G_find_raster(): name=MASK mapset=landsat
D1/1: G_find_raster2(): name=lsat5_1987_10@landsat mapset=
D1/1: r.li.daemon pathSetup: [C:\Users\Sands\AppData\Roa ming\GRASS7\r.li\conf_diversity_5.0]
ERROR: Illegal areas disposition
D1/1: grass.script.core.start_command(): g.message message=Done.
Done.
(Sat May 24 10:29:23 2014) Command finished (0 sec)
(Sat May 24 10:29:40 2014)
g.gisenv set=DEBUG=0
(Sat May 24 10:29:41 2014) Command finished (0 sec)

Looks like it wants the conf_diversity_5.0 file from C:\Users\Sands\AppData\Roa ming\GRASS7\r.li\conf_diversity_5.0? Which is not there.

Thanks again for all your help.

Cheers
Sandra

-----Original Message-----
From: neteler.osgeo@gmail.com [mailto:neteler.osgeo@gmail.com] On Behalf Of Markus Neteler
Sent: 24 May 2014 10:13 AM
To: Sandra MacFadyen
Cc: Luca Delucchi; Glynn Clements; GRASS user list
Subject: Re: [GRASS-dev] [GRASS-user] execGRASS("r.diversity"): [Error 3] Cannot find path specified \\.grass7\\r.li

On Sat, May 24, 2014 at 9:16 AM, Sandra MacFadyen <sandramf@live.co.za> wrote:

Hi Luca,

Yes, I set the region to "lsat5_1987_10" beforehand:

g.region -p
projection: 99 (Lambert Conformal Conic)
zone: 0
datum: nad83
ellipsoid: a=6378137 es=0.006694380022900787
north: 228513
south: 214975.5
west: 629992.5
east: 645012
nsres: 28.5
ewres: 28.5
rows: 475
cols: 527
cells: 250325

ok - now let's make another test. First run

g.gisenv set="DEBUG=1"

then execute
r.diversity ... (your command line)

Please tell us what happens right before the error.

To switch the debug message off after that:
g.gisenv set="DEBUG=0"

Markus

On Sat, May 24, 2014 at 10:44 AM, Sandra MacFadyen <sandramf@live.co.za> wrote:

Maybe a silly question but: Is there a space in the path where there shouldn't be: C:\Users\Sands\AppData\Roa ming\GRASS7\r.li\conf_diversity_5.0
i.e. "\Roa ming\"?

Mhh strange. Is it just broken or really a white space therein?

BTW: The Windows support in r.li has been backported to GRASS 7.0 in
r60231 (post beta2)
http://trac.osgeo.org/grass/changeset/60231/grass/branches/releasebranch_7_0/raster/r.li/r.li.daemon

which uses G_config_path() which in turn calls getenv("APPDATA") on Windows:
(http://grass.osgeo.org/programming7/home_8c_source.html#l00096)

The "Roaming" should come from that variable (I am no expert on
Windows variables at all).
Others here?

...

If I create conf_diversity_5.0 using g.gui.rlisetup as follows:

(Sat May 24 10:34:53 2014)
g.gui.rlisetup
D1/1: grass.script.core.start_command(): g.gisenv -n (Sat May 24 10:35:04 2014) Command finished (10 sec)

I get the following conf_diversity_5.0 file content:

SAMPLINGFRAME 0|0|1|1
SAMPLEAREA -1|-1|0.010526315789473684|0.009487666034155597
MOVINGWINDOW

The sample area, shouldn't that be the bounding coordinates of lsat5_1987_10, in this case meters (lcc, nad83?)

AFAIK r.li uses relative coordinates, so that's ok.

Markus

Ok, so the actual path is: C:\Users\Sands\AppData\Roaming\GRASS7\r.li (without the space)
So I renamed it (temporarily): C:\Users\Sands\AppData\Roa ming\GRASS7\r.li (with the space)
And reran the code with the same error. Also, if I create the conf_diversity_5.0 file and place it there, it does not disappear after the error, which makes me think it's just a line break in the code and not the problem :frowning:

-----Original Message-----
From: neteler.osgeo@gmail.com [mailto:neteler.osgeo@gmail.com] On Behalf Of Markus Neteler
Sent: 24 May 2014 11:09 AM
To: Sandra MacFadyen
Cc: Luca Delucchi; Glynn Clements; GRASS user list
Subject: Re: [GRASS-dev] [GRASS-user] execGRASS("r.diversity"): [Error 3] Cannot find path specified \\.grass7\\r.li

On Sat, May 24, 2014 at 10:44 AM, Sandra MacFadyen <sandramf@live.co.za> wrote:

Maybe a silly question but: Is there a space in the path where there
shouldn't be: C:\Users\Sands\AppData\Roa
ming\GRASS7\r.li\conf_diversity_5.0
i.e. "\Roa ming\"?

Mhh strange. Is it just broken or really a white space therein?

BTW: The Windows support in r.li has been backported to GRASS 7.0 in
r60231 (post beta2)
http://trac.osgeo.org/grass/changeset/60231/grass/branches/releasebranch_7_0/raster/r.li/r.li.daemon

which uses G_config_path() which in turn calls getenv("APPDATA") on Windows:
(http://grass.osgeo.org/programming7/home_8c_source.html#l00096)

The "Roaming" should come from that variable (I am no expert on Windows variables at all).
Others here?

...

If I create conf_diversity_5.0 using g.gui.rlisetup as follows:

(Sat May 24 10:34:53 2014)
g.gui.rlisetup
D1/1: grass.script.core.start_command(): g.gisenv -n (Sat May 24
10:35:04 2014) Command finished (10 sec)

I get the following conf_diversity_5.0 file content:

SAMPLINGFRAME 0|0|1|1
SAMPLEAREA -1|-1|0.010526315789473684|0.009487666034155597
MOVINGWINDOW

The sample area, shouldn't that be the bounding coordinates of
lsat5_1987_10, in this case meters (lcc, nad83?)

AFAIK r.li uses relative coordinates, so that's ok.

Markus

Markus Neteler wrote

Mhh strange. Is it just broken or really a white space therein?

BTW: The Windows support in r.li has been backported to GRASS 7.0 in
r60231 (post beta2)
http://trac.osgeo.org/grass/changeset/60231/grass/branches/releasebranch_7_0/raster/r.li/r.li.daemon

which uses G_config_path() which in turn calls getenv("APPDATA") on
Windows:
(http://grass.osgeo.org/programming7/home_8c_source.html#l00096)

The "Roaming" should come from that variable (I am no expert on
Windows variables at all).
Others here?

tested here with (and some examples of the manual)

System Info
GRASS Version: 7.1.svn
GRASS SVN Revision: 60466
Erstellungsdatum: 2014-05-25
Build Platform: i686-pc-mingw32
GDAL/OGR: 1.11.0
PROJ.4: 4.8.0
GEOS: 3.4.2
SQLite: 3.7.17
Python: 2.7.4
wxPython: 2.8.12.1
Platform: Windows-7-6.1.7601-SP1 (OSGeo4W)

r.info map=lsat5_1987_10@landsat

+----------------------------------------------------------------------------+
| Layer: lsat5_1987_10@landsat Date: Wed May 9 11:37:57 2007
|
| Mapset: landsat Login of Creator: neteler
|
| Location: nc_spm_08_grass7
|
| DataBase: C:\grassdata
|
| Title: LANDSAT-TM5 Band 1 Visible (0.45-0.52um) 30m ( lsat5_1987_10 )
|
| Timestamp: 14 Oct 1987
|

|----------------------------------------------------------------------------|
|
|
| Type of Map: raster Number of Categories: 0
|
| Data Type: CELL
|
| Rows: 475
|
| Columns: 527
|
| Total Cells: 250325
|
| Projection: Lambert Conformal Conic
|
| N: 228513 S: 214975.5 Res: 28.5
|
| E: 645012 W: 629992.5 Res: 28.5
|
| Range of data: min = 45 max = 254
|
|
|
| Data Source:
|
| Global Land Cover Facility (GLCF)
|
|
|
|
|
| Data Description:
|
| generated by r.in.gdal
|
|
|
| Comments:
|
| r.in.gdal input="p016r035_5t19871014_z17_nn10_nc_spm_wake.tif" outpu\
|
| t="lsat5_1987_10"
|
|
IMAGE_ID=P016R35_5T871014,PATH=16,ROW=35,DATE=10/14/87,PLATFORM=LANDSAT |
| 5
|
| i.landsat.rgb "b=lsat5_1987_10" "g=lsat5_1987_20" "r=lsat5_1987_30"
|
|
|

+----------------------------------------------------------------------------+

g.region -p -a rast=lsat5_1987_10@landsat align=lsat5_1987_10@landsat
projection: 99 (Lambert Conformal Conic)
zone: 0
datum: nad83
ellipsoid: a=6378137 es=0.006694380022900787
north: 228513
south: 214975.5
west: 629992.5
east: 645012
nsres: 28.5
ewres: 28.5
rows: 475
cols: 527
cells: 250325

---------------------
manual:
"To calculate only Pielou and Simpson indices from a NDVI map, with several
moving window (3 x 3, 5 x 5, 7 x 7, 9 x 9), run:
r.diversity input=ndvi_map output=diversity size=3-9 method=pielou,simpson"

r.diversity --verbose input=lsat5_1987_10@landsat prefix=myland alpha=0.5
size=3-9
Traceback (most recent call last):
  File "C:\Users\myricaria\AppData\Roaming\GRASS7\addons\scr
ipts\r.diversity.py", line 279, in <module>
    sys.exit(main())
  File "C:\Users\myricaria\AppData\Roaming\GRASS7\addons\scr
ipts\r.diversity.py", line 113, in main
    resolution = checkValues(res)
  File "C:\Users\myricaria\AppData\Roaming\GRASS7\addons\scr
ipts\r.diversity.py", line 268, in checkValues
    reso = range(reso[0], reso[1] + 1, 2)
TypeError: range() integer end argument expected, got float.

-

r.diversity --verbose input=lsat5_1987_10@landsat prefix=myland size=3-9
method=simpson,pielou
Traceback (most recent call last):
  File "C:\Users\myricaria\AppData\Roaming\GRASS7\addons\scr
ipts\r.diversity.py", line 279, in <module>
    sys.exit(main())
  File "C:\Users\myricaria\AppData\Roaming\GRASS7\addons\scr
ipts\r.diversity.py", line 113, in main
    resolution = checkValues(res)
  File "C:\Users\myricaria\AppData\Roaming\GRASS7\addons\scr
ipts\r.diversity.py", line 268, in checkValues
    reso = range(reso[0], reso[1] + 1, 2)
TypeError: range() integer end argument expected, got float.

r.diversity --verbose input=lsat5_1987_10@landsat prefix=myland
method=simpson,pielou
ERROR: Illegal areas disposition
ERROR: Illegal areas disposition
Done.

g.gisenv set=DEBUG=3

r.diversity --verbose input=lsat5_1987_10@landsat prefix=myland
method=simpson,pielou
D2/3: filename = C:\Users\myricaria\AppData\Roaming\GRASS7\a
ddons\scripts\r.diversity.py
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/rdivers
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/rdivers/cell/myland
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/rdivers
D1/3: G_find_raster2(): name=lsat5_1987_10@landsat mapset=
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/cell/lsat5_1987_10
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/cellhd/lsat5_1987_10
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/cellhd/lsat5_1987_10
D2/3: file open: read (mode = r)
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/cellhd/lsat5_1987_10
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/cellhd/lsat5_1987_10
D2/3: file open: read (mode = r)
D2/3: G__read_Cell_head
D2/3: G__read_Cell_head_array
D3/3: region item: proj: 99
D3/3: region item: zone: 0
D3/3: region item: north: 228513
D3/3: region item: south: 214975.5
D3/3: region item: east: 645012
D3/3: region item: west: 629992.5
D3/3: region item: cols: 527
D3/3: region item: rows: 475
D3/3: region item: e-w resol: 28.5
D3/3: region item: n-s resol: 28.5
D3/3: region item: format: 0
D3/3: region item: compressed: 1
D1/3: G_find_raster2(): name=lsat5_1987_10@landsat mapset=
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/cell/lsat5_1987_10
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/fcell/lsat5_1987_10
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/g3dcell/lsat5_1987_10
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/cats/lsat5_1987_10
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/cats/lsat5_1987_10
D2/3: file open: read (mode = r)
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/hist/lsat5_1987_10
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/hist/lsat5_1987_10
D2/3: file open: read (mode = r)
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/cellhd/lsat5_1987_10
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/cellhd/lsat5_1987_10
D2/3: file open: read (mode = r)
D1/3: G_find_raster2(): name=lsat5_1987_10@landsat mapset=
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/cell/lsat5_1987_10
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/fcell/lsat5_1987_10
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/g3dcell/lsat5_1987_10
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/rdivers/WIND
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/rdivers/WIND
D2/3: file open: read (mode = r)
D2/3: G__read_Cell_head
D2/3: G__read_Cell_head_array
D3/3: region item: proj: 99
D3/3: region item: zone: 0
D3/3: region item: north: 228513
D3/3: region item: south: 214975.5
D3/3: region item: east: 645012
D3/3: region item: west: 629992.5
D3/3: region item: cols: 527
D3/3: region item: rows: 475
D3/3: region item: e-w resol: 28.5
D3/3: region item: n-s resol: 28.5
D3/3: region item: top: 1.000000000000000
D3/3: region item: bottom: 0.000000000000000
D3/3: region item: cols3: 527
D3/3: region item: rows3: 475
D3/3: region item: depths: 1
D3/3: region item: e-w resol3: 28.5
D3/3: region item: n-s resol3: 28.5
D3/3: region item: t-b resol: 1
D1/3: G_find_raster2(): name=lsat5_1987_10@landsat mapset=
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/cell/lsat5_1987_10
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/fcell/lsat5_1987_10
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/g3dcell/lsat5_1987_10
D1/3: G_find_raster2(): name=lsat5_1987_10@landsat mapset=
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/cell/lsat5_1987_10
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/fcell/lsat5_1987_10
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/g3dcell/lsat5_1987_10
D1/3: G_find_raster2(): name=lsat5_1987_10@landsat mapset=
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/cell/lsat5_1987_10
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/fcell/lsat5_1987_10
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/g3dcell/lsat5_1987_10
D1/3: grass.script.core.start_command(): r.li.simpson
input=lsat5_1987_10@landsat conf=conf_diversity_3.0
output=myland_simpson_size_3.0
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/rdivers
D2/3: G_file_name(): path = C:\grassdata/nc_spm_08_grass7/rd
ivers/cell/myland_simpson_size_3.0
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/rdivers/WIND
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/rdivers/WIND
D2/3: file open: read (mode = r)
D2/3: G__read_Cell_head
D2/3: G__read_Cell_head_array
D3/3: region item: proj: 99
D3/3: region item: zone: 0
D3/3: region item: north: 228513
D3/3: region item: south: 214975.5
D3/3: region item: east: 645012
D3/3: region item: west: 629992.5
D3/3: region item: cols: 527
D3/3: region item: rows: 475
D3/3: region item: e-w resol: 28.5
D3/3: region item: n-s resol: 28.5
D3/3: region item: top: 1.000000000000000
D3/3: region item: bottom: 0.000000000000000
D3/3: region item: cols3: 527
D3/3: region item: rows3: 475
D3/3: region item: depths: 1
D3/3: region item: e-w resol3: 28.5
D3/3: region item: n-s resol3: 28.5
D3/3: region item: t-b resol: 1
D1/3: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/cell/lsat5_1987_10
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/cellhd/lsat5_1987_10
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/cellhd/lsat5_1987_10
D2/3: file open: read (mode = r)
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/cellhd/lsat5_1987_10
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/cellhd/lsat5_1987_10
D2/3: file open: read (mode = r)
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/cellhd/lsat5_1987_10
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/cellhd/lsat5_1987_10
D2/3: file open: read (mode = r)
D2/3: G__read_Cell_head
D2/3: G__read_Cell_head_array
D3/3: region item: proj: 99
D3/3: region item: zone: 0
D3/3: region item: north: 228513
D3/3: region item: south: 214975.5
D3/3: region item: east: 645012
D3/3: region item: west: 629992.5
D3/3: region item: cols: 527
D3/3: region item: rows: 475
D3/3: region item: e-w resol: 28.5
D3/3: region item: n-s resol: 28.5
D3/3: region item: format: 0
D3/3: region item: compressed: 1
D1/3: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/cell/lsat5_1987_10
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/fcell/lsat5_1987_10
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/g3dcell/lsat5_1987_10
D1/3: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/cell/lsat5_1987_10
D1/3: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/cell/lsat5_1987_10
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/fcell/lsat5_1987_10
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/g3dcell/lsat5_1987_10
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/cell/lsat5_1987_10
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/cell/lsat5_1987_10
D3/3: create window mapping (527 columns)
D1/3: G_find_raster(): name=MASK mapset=rdivers
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/rdivers/cell/MASK
D1/3: G_find_raster2(): name=lsat5_1987_10@landsat mapset=
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/cell/lsat5_1987_10
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/fcell/lsat5_1987_10
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/g3dcell/lsat5_1987_10
D1/3: r.li.daemon pathSetup: [C:\Users\xxxx\AppData\Roa
ming\GRASS7\r.li\conf_diversity_3.0]
ERROR: Illegal areas disposition
D1/3: grass.script.core.start_command(): r.li.pielou
input=lsat5_1987_10@landsat conf=conf_diversity_3.0
output=myland_pielou_size_3.0
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/rdivers
D2/3: G_file_name(): path = C:\grassdata/nc_spm_08_grass7/rd
ivers/cell/myland_pielou_size_3.0
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/rdivers/WIND
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/rdivers/WIND
D2/3: file open: read (mode = r)
D2/3: G__read_Cell_head
D2/3: G__read_Cell_head_array
D3/3: region item: proj: 99
D3/3: region item: zone: 0
D3/3: region item: north: 228513
D3/3: region item: south: 214975.5
D3/3: region item: east: 645012
D3/3: region item: west: 629992.5
D3/3: region item: cols: 527
D3/3: region item: rows: 475
D3/3: region item: e-w resol: 28.5
D3/3: region item: n-s resol: 28.5
D3/3: region item: top: 1.000000000000000
D3/3: region item: bottom: 0.000000000000000
D3/3: region item: cols3: 527
D3/3: region item: rows3: 475
D3/3: region item: depths: 1
D3/3: region item: e-w resol3: 28.5
D3/3: region item: n-s resol3: 28.5
D3/3: region item: t-b resol: 1
D1/3: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/cell/lsat5_1987_10
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/cellhd/lsat5_1987_10
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/cellhd/lsat5_1987_10
D2/3: file open: read (mode = r)
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/cellhd/lsat5_1987_10
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/cellhd/lsat5_1987_10
D2/3: file open: read (mode = r)
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/cellhd/lsat5_1987_10
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/cellhd/lsat5_1987_10
D2/3: file open: read (mode = r)
D2/3: G__read_Cell_head
D2/3: G__read_Cell_head_array
D3/3: region item: proj: 99
D3/3: region item: zone: 0
D3/3: region item: north: 228513
D3/3: region item: south: 214975.5
D3/3: region item: east: 645012
D3/3: region item: west: 629992.5
D3/3: region item: cols: 527
D3/3: region item: rows: 475
D3/3: region item: e-w resol: 28.5
D3/3: region item: n-s resol: 28.5
D3/3: region item: format: 0
D3/3: region item: compressed: 1
D1/3: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/cell/lsat5_1987_10
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/fcell/lsat5_1987_10
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/g3dcell/lsat5_1987_10
D1/3: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/cell/lsat5_1987_10
D1/3: G_find_raster2(): name=lsat5_1987_10 mapset=landsat
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/cell/lsat5_1987_10
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/fcell/lsat5_1987_10
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/g3dcell/lsat5_1987_10
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/cell/lsat5_1987_10
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/cell/lsat5_1987_10
D3/3: create window mapping (527 columns)
D1/3: G_find_raster(): name=MASK mapset=rdivers
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/rdivers/cell/MASK
D1/3: G_find_raster2(): name=lsat5_1987_10@landsat mapset=
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/cell/lsat5_1987_10
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/fcell/lsat5_1987_10
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/landsat/g3dcell/lsat5_1987_10
D1/3: r.li.daemon pathSetup: [C:\Users\xxxx\AppData\Roa
ming\GRASS7\r.li\conf_diversity_3.0]
ERROR: Illegal areas disposition
D1/3: grass.script.core.start_command(): g.message
message=Done.
D2/3: G_file_name(): path =
C:\grassdata/nc_spm_08_grass7/rdivers
Done.

-

manual:
"To calculate all methods excluding Pielou from a NDVI map, with two moving
window (3 x 3, 9 x 9), run:
r.diversity input=ndvi_map output=diversity size=3,9 exclude=pielou alpha=3"

r.diversity --verbose input=lsat5_1987_10@landsat prefix=myland alpha=0.5
size=3,9
ERROR: Illegal areas disposition
ERROR: Illegal areas disposition
ERROR: Illegal areas disposition
ERROR: Illegal areas disposition
ERROR: Illegal areas disposition
ERROR: Illegal areas disposition
ERROR: Illegal areas disposition
ERROR: Illegal areas disposition
Done.

---------------------

could it be the logics to calculate

#create configuration file instead using r.li.setup
def createConfFile(res, inpumap, home):

and

# return a list of resolution
def checkValues(res, alpha=False):

(and maybe others too) the reason why the creation of the configuration
file(s) fails?

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/execGRASS-r-diversity-Error-3-Cannot-find-path-specified-grass7-r-li-tp5141590p5142440.html
Sent from the Grass - Users mailing list archive at Nabble.com.

If I understand Helmuts' post correctly, is the error I am getting attributed to the following sections of the python script r.diversity.py?

#create configuration file instead using r.li.setup
def createConfFile(res, inpumap, home):

and/or

# return a list of resolution
def checkValues(res, alpha=False):

I am also new to python and not sure how I should proceed to successfully create or read the config. file.
I would appreciate your advice.

Thank you
Sandra

P.S. Should I rather open a new thread entitled r.diversity Illegal areas disposition?

-------------------------------------------------------
<quote author='Helmut Kudrnovsky'>

manual:
"To calculate all methods excluding Pielou from a NDVI map, with two moving window (3 x 3, 9 x 9), run:
r.diversity input=ndvi_map output=diversity size=3,9 exclude=pielou alpha=3"

r.diversity --verbose input=lsat5_1987_10@landsat prefix=myland alpha=0.5
size=3,9
ERROR: Illegal areas disposition
ERROR: Illegal areas disposition
ERROR: Illegal areas disposition
ERROR: Illegal areas disposition
ERROR: Illegal areas disposition
ERROR: Illegal areas disposition
ERROR: Illegal areas disposition
ERROR: Illegal areas disposition
Done.

---------------------

could it be the logics to calculate

#create configuration file instead using r.li.setup def createConfFile(res, inpumap, home):

and

# return a list of resolution
def checkValues(res, alpha=False):

(and maybe others too) the reason why the creation of the configuration
file(s) fails?
</quote>
Quoted from:
http://osgeo-org.1560.x6.nabble.com/execGRASS-r-diversity-Error-3-Cannot-find-path-specified-grass7-r-li-tp5141590p5142440.html

commenting out line 147-149 and 272-275 in r.diversity (the conf file are
removed by this line)

then you can have a look in the conf file

r.diversity --verbose input=lsat7_2002_10@PERMANENT prefix=t
method=simpson,pielou

C:\Users\xxxx\AppData\Roaming\grass7\r.li\conf_diversity_3.0

SAMPLINGFRAME 0|0|1|1
SAMPLEAREA -1|-1|0.00631578947368|0.00569259962049
MOVINGWINDOW

it looks ok(?)

P.S. Should I rather open a new thread entitled r.diversity Illegal areas
disposition?

please open a ticket in http://trac.osgeo.org/grass/ and add the most
important parts from the thread there.

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/execGRASS-r-diversity-Error-3-Cannot-find-path-specified-grass7-r-li-tp5141590p5144178.html
Sent from the Grass - Users mailing list archive at Nabble.com.