[GRASS-user] Do not report cells where thousands of maps have no data

GRASS GIS' `r.stats` modules does this:

r.stats input=$(g.list rast pattern=cru*.*1 separator=comma) -n -x -N

However, it won't do it for thousands of maps. Too many maps will hit
the '[Argument list too long]' error which is triggered by the ARG_MAX
constant. Is there a work-around?

Else, I see no option but to set on a Python script that will loop over
thousands of maps and will identify pixels for which all maps have a
valid value. Any recommendations (like best to user xarray or numpy or
rasterio or else...)?

Thank you, Nikos

On 27/09/19 17:39, Nikos Alexandris wrote:

GRASS GIS' `r.stats` modules does this:

r.stats input=$(g.list rast pattern=cru*.*1 separator=comma) -n -x -N

However, it won't do it for thousands of maps. Too many maps will hit
the '[Argument list too long]' error which is triggered by the ARG_MAX
constant. Is there a work-around?

- use xargs
- use r.series with the -n flag and 'file' parameter

Else, I see no option but to set on a Python script that will loop over
thousands of maps and will identify pixels for which all maps have a
valid value. Any recommendations (like best to user xarray or numpy or
rasterio or else...)?

I think r.series -n will give you what you want: any none null pixel in the output will have a value in all maps.

Moritz