Re: Issue with addon r.vif in MS Windows GUI installations (stand-alone v. 7.2.2 and 7.0.5)

Dinarzarde Raheem <[email protected]>
Newsgroups gmane.comp.gis.grass.user
Message-ID <[email protected]>
Hi Paulo & Helmut,

I have had a go with a Windows 10 (64 bit) machine with Grass version 7.0.5. I copied the r.vif patch into the location C:\Users\YourUserName\AppData\Roaming\GRASS7\addons\scripts.

I get the following error message (I tried with the existing installation, uninstalled this and then tried again after re-installing grass). Would it make sense to wait until the server makes the new version of r.vif available through the g.extension option and try again? 

Dinarzarde

------error message-------

(Sat Feb 10 21:46:00 2018)                                                       
r.vif maps=2011_01_precip@climate_1970_2012,2011_02_precip@climate_1970_2012,2011_03_precip@climate_1970_2012,2011_04_precip@climate_1970_2012,2011_05_precip@climate_1970_2012,2011_06_precip@climate_1970_2012,2011_07_precip@climate_1970_2012,2011_08_precip@climate_1970_2012,2011_09_precip@climate_1970_2012,2011_10_precip@climate_1970_2012,2011_11_precip@climate_1970_2012,2011_12_precip@climate_1970_2012 maxvif=10 file=C:\Users\draheem\Desktop\Jan 2017\results1.csv
Reading in the data ...
ERROR: Error reading reclass file for raster map <2011_01_precip@climate_1970_2012>
Traceback (most recent call last):
  File "C:\Users\draheem\AppData\Roaming\GRASS7\addons/scrip
ts/r.vif.py", line 361, in <module>
    sys.exit(main(*gs.parser()))
  File "C:\Users\draheem\AppData\Roaming\GRASS7\addons/scrip
ts/r.vif.py", line 222, in main
    p = ReadData(IPF, n)
  File "C:\Users\draheem\AppData\Roaming\GRASS7\addons/scrip
ts/r.vif.py", line 150, in ReadData
    quiet=True, separator="comma").rstrip('\n'))
  File "C:\Program Files\GRASS GIS
7.0.5\etc\python\grass\script\core.py", line 446, in
read_command
    return handle_errors(returncode, stdout, args, kwargs)
  File "C:\Program Files\GRASS GIS
7.0.5\etc\python\grass\script\core.py", line 313, in
handle_errors
    returncode=returncode)
grass.exceptions.CalledModuleError: Module run None
['r.stats', '--q', '-1n', 'input=2011_01_precip@climate_1970
_2012,2011_02_precip@climate_1970_2012,2011_03_precip@climat
e_1970_2012,2011_04_precip@climate_1970_2012,2011_05_precip@
climate_1970_2012,2011_06_precip@climate_1970_2012,2011_07_p
recip@climate_1970_2012,2011_08_precip@climate_1970_2012,201
1_09_precip@climate_1970_2012,2011_10_precip@climate_1970_20
12,2011_11_precip@climate_1970_2012,2011_12_precip@climate_1
970_2012', 'separator=comma'] ended with error
Process ended with non-zero return code 1. See errors in the
(error) output.
(Sat Feb 10 21:46:02 2018) Command finished (1 sec)                             



________________________________________
From: grass-user [[email protected]] on behalf of Helmut Kudrnovsky [[email protected]]
Sent: 10 February 2018 16:27
To: [email protected]
Subject: Re: [GRASS-user] Issue with addon r.vif in MS Windows GUI installations (stand-alone v. 7.2.2 and 7.0.5)

>> Did you consider using cStringIO, if you need a file-object?
>>
>> That would avoid the temporary file and thus should be more efficient
>> too. See attached diff (it is probably not necessary to remove the last
>> line break though).
>Implemented your patch, thanks.  Dinarzarde, can you test?

tested here in OSGeo4W-winGRASS:

------------------
r.vif
maps=2011_01_precip,2011_02_precip,2011_03_precip,2011_04_precip,2011_05_precip,2011_06_precip,2011_07_precip,2011_08_precip,2011_09_precip,2011_10_precip,2011_11_precip,2011_12_precip
maxvif=10 file=D:\wd\rvif\test,csv
Reading in the data ...

Statistics are written to D:\wd\rvif\test,csv
VIF round 1
--------------------------------------
variable            vif  sqrtvif
2011_01_precip     6.86     2.62
2011_02_precip     2.77     1.66
2011_03_precip    33.17     5.76
2011_04_precip    10.81     3.29
2011_05_precip     4.82     2.20
2011_06_precip     2.72     1.65
2011_07_precip     1.44     1.20
2011_08_precip    10.04     3.17
2011_09_precip     3.16     1.78
2011_10_precip     2.50     1.58
2011_11_precip    16.71     4.09
2011_12_precip    50.81     7.13
VIF round 2
--------------------------------------
variable            vif  sqrtvif
2011_01_precip     6.74     2.60
2011_02_precip     2.54     1.59
2011_03_precip    18.23     4.27
2011_04_precip     8.99     3.00
2011_05_precip     4.72     2.17
2011_06_precip     2.69     1.64
2011_07_precip     1.40     1.18
2011_08_precip     9.11     3.02
2011_09_precip     3.08     1.75
2011_10_precip     2.42     1.55
2011_11_precip    16.20     4.03
VIF round 3
--------------------------------------
variable            vif  sqrtvif
2011_01_precip     5.63     2.37
2011_02_precip     2.14     1.46
2011_04_precip     5.71     2.39
2011_05_precip     4.63     2.15
2011_06_precip     2.52     1.59
2011_07_precip     1.33     1.15
2011_08_precip     9.01     3.00
2011_09_precip     3.08     1.75
2011_10_precip     2.14     1.46
2011_11_precip    10.42     3.23
VIF round 4
--------------------------------------
variable            vif  sqrtvif
2011_01_precip     5.53     2.35
2011_02_precip     2.13     1.46
2011_04_precip     3.09     1.76
2011_05_precip     4.10     2.03
2011_06_precip     2.52     1.59
2011_07_precip     1.24     1.11
2011_08_precip     4.26     2.06
2011_09_precip     3.01     1.74
2011_10_precip     2.14     1.46
/n
selected variables are:
--------------------------------------
2011_01_precip, 2011_02_precip, 2011_04_precip, 2011_05_precip,
2011_06_precip, 2011_07_precip, 2011_08_precip, 2011_09_precip,
2011_10_precip
(Sat Feb 10 17:24:14 2018) Command finished (31 sec)
-------------------

to use the new version by g.extension, you have to wait until tomorrow when
the server delivers the precompiled addons for winGRASS.

or just download it manually from

https://trac.osgeo.org/grass/browser/grass-addons/grass7/raster/r.vif

and copy r.vif.py into

C:\Users\YourUserName\AppData\Roaming\GRASS7\addons\scripts



-----
best regards
Helmut
--
Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html
_______________________________________________
grass-user mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/grass-user
_______________________________________________
grass-user mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/grass-user
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.