[GRASS-SVN] r70095 - grass-addons/grass7/raster/r.vif

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Dec 18 11:13:53 PST 2016


Author: pvanbosgeo
Date: 2016-12-18 11:13:53 -0800 (Sun, 18 Dec 2016)
New Revision: 70095

Modified:
   grass-addons/grass7/raster/r.vif/r.vif.html
   grass-addons/grass7/raster/r.vif/r.vif.py
Log:
r.vif addon: bugfix

Modified: grass-addons/grass7/raster/r.vif/r.vif.html
===================================================================
--- grass-addons/grass7/raster/r.vif/r.vif.html	2016-12-18 18:03:43 UTC (rev 70094)
+++ grass-addons/grass7/raster/r.vif/r.vif.html	2016-12-18 19:13:53 UTC (rev 70095)
@@ -33,13 +33,13 @@
 
 <h2>EXAMPLES</h2>
 
-The following examples are based on the nc_climate_spm_2000_2012
-sample data set which you can download from
-<a href="https://grass.osgeo.org/download/sample-data/">GRASS GIS sample
-data download page</a>. This data set contains monthly rainfall and
-temperature data for the years 2000 - 2012. In the examples below
-the monthly data of 2000 is used. The analyses are run on a smaller
-region, set below, to reduce the run time.
+The following examples are based on the nc_climate_spm_2000_2012 sample data
+set which you can download from
+<a href="https://grass.osgeo.org/download/sample-data/" target="_blank">GRASS GIS
+sample data download page</a>. This data set contains monthly rainfall and
+temperature data for the years 2000 - 2012. In the examples below the monthly
+data of 2000 is used. The analyses are run on a smaller region, set below, to
+reduce the run time.
 
 <div class="code"><pre>g.region n=226000 s=168500 w=229500 e=298500</pre></div>
 

Modified: grass-addons/grass7/raster/r.vif/r.vif.py
===================================================================
--- grass-addons/grass7/raster/r.vif/r.vif.py	2016-12-18 18:03:43 UTC (rev 70094)
+++ grass-addons/grass7/raster/r.vif/r.vif.py	2016-12-18 19:13:53 UTC (rev 70095)
@@ -263,20 +263,20 @@
         else:
             print(','.join(IPFn))
 
-        if len(OPF) > 0:
-            try:
-                text_file = open(OPF, "w")
-        if MXVIF == '':
-            text_file.write("variable,vif,sqrtvif\n")
-        for i in xrange(len(out_vif)):
-            text_file.write('{0:s},{1:.6f},{2:.6f}\n'.format(
-                out_variable[i], out_vif[i], out_sqrt[i]))
-        else:
-            text_file.write("round,removed,variable,vif,sqrtvif\n")
-        for i in xrange(len(out_vif)):
-            text_file.write('{0:d},{1:s},{2:s},{3:.6f},{4:.6f}\n'.
-                            format(out_round[i], out_removed[i],
-                                   out_variable[i], out_vif[i], out_sqrt[i]))
+    if len(OPF) > 0:
+        try:
+            text_file = open(OPF, "w")
+            if MXVIF == '':
+                text_file.write("variable,vif,sqrtvif\n")
+                for i in xrange(len(out_vif)):
+                    text_file.write('{0:s},{1:.6f},{2:.6f}\n'.format(
+                        out_variable[i], out_vif[i], out_sqrt[i]))
+            else:
+                text_file.write("round,removed,variable,vif,sqrtvif\n")
+                for i in xrange(len(out_vif)):
+                    text_file.write('{0:d},{1:s},{2:s},{3:.6f},{4:.6f}\n'.format(
+                    out_round[i], out_removed[i], out_variable[i],
+                    out_vif[i], out_sqrt[i]))
         finally:
             text_file.close()
 



More information about the grass-commit mailing list