<html>
<head>
<meta http-equiv="Content-Type" content="text/html"/>
</head>
<body>
<div style="color: black;">
<p style="margin: 0 0 1em 0; color: black; font-family: sans-serif;"></p>
<p style="margin: 0 0 1em 0; color: black; font-family: sans-serif;">On February 2, 2018 8:52:03 PM Helmut Kudrnovsky <hellik@web.de> wrote:</p>
<p style="margin: 0 0 1em 0; color: black; font-family: sans-serif;">>>Any idea how I can do that in such a way that it works on both Linux and<br>
> Windows?<br>
><br>
> in r.vif script I've changed the relevant lines:<br>
><br>
> <----------------------------------------<br>
>     # Get the raster values at sample points<br>
>     fd, tmpcov = tempfile.mkstemp()<br>
>     with open(tmpcov, "w") as text_file:<br>
>         text_file.write(<br>
>                 gs.read_command("r.stats", flags="1n", input=raster,<br>
>                                 quiet=True, separator="comma"))<br>
>     p = np.loadtxt(tmpcov, skiprows=0, delimiter=",")<br>
><br>
>     # Clean up<br>
>     text_file.close()<br>
>     os.close(fd)<br>
>     os.remove(tmpcov)<br>
>     if not n == "100%":<br>
>         gs.run_command("r.mask", flags="r", quiet=True)<br>
>         if exist_mask['fullname']:<br>
>             gs.run_command("g.rename", raster=[mask_backup, "MASK"],<br>
>                            quiet=True)<br>
>     return(p)<br>
> ----------------------------------------><br>
><br>
> and tested the script in winGRASS; it seems to work in windows; not tested<br>
> on linux and mac.<br>
><br>
><br>
Ok, thanks Helmut, I'll see if that works in Linux too<br>
><br>
> -----<br>
> best regards<br>
> Helmut<br>
> --<br>
> Sent from: <a href="http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html">http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html</a><br>
> _______________________________________________<br>
> grass-user mailing list<br>
> grass-user@lists.osgeo.org<br>
> <a href="https://lists.osgeo.org/mailman/listinfo/grass-user">https://lists.osgeo.org/mailman/listinfo/grass-user</a><br>
</p>
</div>
</body>
</html>