I have a strds and I try to get statistics for an area within a mask. A couple of images have no data within the masked area, and t.rast.univar gives the warning message: “Unable to get statistics for raster map”. In the resulting csv, the missed dates are skipped, and this is sort of unexpected and creates hurdles when for example I compare it with the behavior of t.rast.what, that keeps the date and associates a no-data to it. Wouldn’t it be better if also t.rast.univar would yield a no-data rather than skip the date?
I have a strds and I try to get statistics for an area within a mask. A couple of images have no data within the masked area, and t.rast.univar gives the warning message: "Unable to get statistics for raster map". In the resulting csv, the missed dates are skipped, and this is sort of unexpected and creates hurdles when for example I compare it with the behavior of t.rast.what, that keeps the date and associates a no-data to it. Wouldn't it be better if also t.rast.univar would yield a no-data rather than skip the date?
This can probably somehow be solved within t.rast.univar, but IIUC the actual issue comes from the underlying r.univar call which has the same behaviour, for example when call with the 'zones' parameter and the '-t' flag: data is just absent if there are only null values in a given zone. I've been struggling with that, for example for addon modules such as i.segment.stats. I don't know how easy it would be to change that within r.univar, but it would be nice.
IIUC, the issue comes from stats.c [1]:
123 if (stats[z].n == 0)
124 continue;
Maybe a flag to fill the stats with NULL values, instead of ignoring them, would be appropriate ? But I don't know what an good NULL value would be here.
I have a strds and I try to get statistics for an area within a mask. A
couple of images have no data within the masked area, and t.rast.univar
gives the warning message: “Unable to get statistics for raster map”.
In the resulting csv, the missed dates are skipped, and this is sort of
unexpected and creates hurdles when for example I compare it with the
behavior of t.rast.what, that keeps the date and associates a no-data to
it. Wouldn’t it be better if also t.rast.univar would yield a no-data
rather than skip the date?
+1
This can probably somehow be solved within t.rast.univar, but IIUC the
actual issue comes from the underlying r.univar call which has the same
behaviour, for example when call with the ‘zones’ parameter and the ‘-t’
flag: data is just absent if there are only null values in a given zone.
I’ve been struggling with that, for example for addon modules such as
i.segment.stats. I don’t know how easy it would be to change that within
r.univar, but it would be nice.
IIUC, the issue comes from stats.c [1]:
123 if (stats[z].n == 0)
124 continue;
Maybe a flag to fill the stats with NULL values, instead of ignoring
them, would be appropriate ?
+1!!
But I don’t know what an good NULL value would be here.
This can probably somehow be solved within t.rast.univar, but IIUC the
actual issue comes from the underlying r.univar call which has the same
behaviour, for example when call with the ‘zones’ parameter and the ‘-t’
flag: data is just absent if there are only null values in a given zone.
I’ve been struggling with that, for example for addon modules such as
i.segment.stats. I don’t know how easy it would be to change that within
r.univar, but it would be nice.
IIUC, the issue comes from stats.c [1]:
123 if (stats[z].n == 0)
124 continue;
Maybe a flag to fill the stats with NULL values, instead of ignoring
them, would be appropriate ?
[…]
+1!!
But I don’t know what an good NULL value would be here.