[GRASS-user] r.hants and r.series.lwr in Windows

I am trying to establish a workflow to gapfill temporal maps using r.hants
and r.series.lwr. It is important that the solution also works in windows
for the teaching.

The issue I am encountering is that both r.hants and r.series.lwr are
returning 0 values in Windows with a majority of the valid pixels in the
original raster converted to NULL() in outputs.
While in Linux it works well and gives the intended results.

*Specs:*
*Windows 10, GRASS 7.8.3 *
*Ubuntu 18.04 LTS, GRASS 7.8.3*

Here are the commands I use:

*r.series.lwr -l -h -i file=maps.txt suffix=_lwr order=2 weight=tricube
range=0,inf fet=0.5 dod=3 maxgap=3 --or.hants -l -h -i file=maps.txt
suffix=_hants range=0,inf nf=3 fet=0.5 --o*

trying here with:

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

r.series.lwr -l -h -i input=ETact_SEBAL_2019_03_mm_month@TMPMAP,ETact_SEBAL_2019_04_mm_month@TMPMAP,ETact_SEBAL_2019_05_mm_month@TMPMAP,ETact_SEBAL_2019_06_mm_month@TMPMAP,ETact_SEBAL_2019_07_mm_month@TMPMAP,ETact_SEBAL_2019_08_mm_month@TMPMAP,ETact_SEBAL_2019_09_mm_month@TMPMAP,ETact_SEBAL_2019_10_mm_month@TMPMAP,ETact_SEBAL_2019_11_mm_month@TMPMAP order=2 fet=0.5 dod=3 range=0,10000000000000000000000000000000000000 maxgap=3

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

r.univar map=ETact_SEBAL_2019_03_mm_month_lwr@TMPMAP
total null and non-null cells: 10413
total null cells: 417
Of the non-null cells:
----------------------
n: 9996
minimum: 0
maximum: 78.5551
range: 78.5551
mean: 5.9911
mean of absolute values: 5.9911
standard deviation: 11.3704
variance: 129.287
variation coefficient: 189.789 %
sum: 59887.0226345476

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

the issue is here in your original command:

range=0,inf

winGRASS doesn't recognize inf or INF as infinity.

there is somewhere an old ticket in trac. please open an issue in github for this.

kind regards
Helmut

[p.s. it's not possible anymore to post via nabble.com in the GRASS ML: Read-Only Archive. You cannot post here. This is a read-only archive. was there any change there in the settings?]

there is somewhere an old ticket in trac.

see

https://trac.osgeo.org/grass/ticket/3432
https://trac.osgeo.org/grass/ticket/2919

----------------------------------------
[...]
My guess - input.d8cut->answer contains extra chars (CR/LF issue?) and thus changing line to read:

if (strncmp(input.d8cut->answer, "infinity", 8) == 0) {

would solve the issue. Still, if it is so, then it is worth to digg deeper to see why it is failing as strcmp is used in many modules.
[...]
I guess that the MS Windows version of sscanf does not recognize infinity as a floating point number, while the Linux version does.
[...]

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

IMHO it's still worth to fix the issue with inf/INF as this issue pops up from time to time.

if it's not possible, the manual should be updated where needed that examples work also in winGRASS. PR welcome. :slight_smile:

kind regards
Helmut

Dear Helmut

Thank you for testing and finding the issue. Both commands work well without infinity in Windows.
Big help for continuing to use GRASS GIS in Windows for the course.

I have opened an issue in github.

Regards

Sajid

On Fri, Jun 26, 2020 at 11:05 AM Helmut Kudrnovsky <hellik@web.de> wrote:

there is somewhere an old ticket in trac.

see

https://trac.osgeo.org/grass/ticket/3432
https://trac.osgeo.org/grass/ticket/2919


[…]
My guess - input.d8cut->answer contains extra chars (CR/LF issue?) and thus changing line to read:

if (strncmp(input.d8cut->answer, “infinity”, 8) == 0) {

would solve the issue. Still, if it is so, then it is worth to digg deeper to see why it is failing as strcmp is used in many modules.
[…]
I guess that the MS Windows version of sscanf does not recognize infinity as a floating point number, while the Linux version does.
[…]


IMHO it’s still worth to fix the issue with inf/INF as this issue pops up from time to time.

if it’s not possible, the manual should be updated where needed that examples work also in winGRASS. PR welcome. :slight_smile:

kind regards
Helmut

On Sat, Jun 27, 2020 at 2:26 AM Sajid Pareeth <spareeth@gmail.com> wrote:

Dear Helmut

Thank you for testing and finding the issue. Both commands work well without infinity in Windows.
Big help for continuing to use GRASS GIS in Windows for the course.

I have opened an issue in github.

I have taken liberty to transfer it to "grass-addons":

https://github.com/OSGeo/grass-addons/issues/230

Best,
Markus