Re: [GRASS-user] Median filtering time series in time only

2021-01-27 Thread nik

On 2021-01-27 16:59, Veronica Andreo wrote:


Both r.series and t.rast.series will estimate the median per pixel in time 
(either for the whole series or the time period you want). Would it be possible 
then with so e sort of special for cycle?


Sorry, I didn't pay attention. Reading more carefully. 
Indeed, r.series (t.rast.series) do the median. But they will just
create a single pixel for each pixel time series. 
Then, as you write, it would take to hack-around a way to iterate over a

given time series at the desired (number of) intervals, then compile a
new time series. 

What is the 'e sort' part? 
Did you mean to type 'with some sort of...'? 
And what does the 'cycle' refer to? 


Thanks, Nikos___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Raster gaussian filter

2021-01-27 Thread Markus Neteler
On Wed, Jan 27, 2021 at 4:20 PM Eric Patton via grass-user
 wrote:
>
> Great, thanks Markus! I’ll give it a try.

Just as a note (and it is always good to ask in the list here, so that
others become aware of the many tools available!), the keyword index:

https://grass.osgeo.org/grass-stable/manuals/keywords.html#gauss

If you have suggestions how to improve the docs, let us know or feel
free to suggest changes in GitHub.

Cheers
markusN
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] r.clump/ Concurent mapset locking is not supported on Windows

2021-01-27 Thread Helmut Kudrnovsky
dag.lit wrote
> I am working only on one user on the computer (I don't have more usuers).
> Everything was normally working and one day it stops. I alredy tried to
> uninstall and install QGIS but it didn't help :(

It could be a region setting issue. 

QGIS shows the used GRASS commands. you could try these commands in GRASS
itself and see if it works. 




-
best regards
Helmut
--
Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Median filtering time series in time only

2021-01-27 Thread nik
An example: 

In [1]: from scipy.signal import medfilt 

In [4]: ts = [1, 2, 2, 6, 3, 3, 4, 4, 3, 2, 2, 1] 


In [5]: medfilt(ts, kernel_size=3)
Out[5]: array([1., 2., 2., 3., 3., 3., 4., 4., 3., 2., 2., 1.])___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Median filtering time series in time only

2021-01-27 Thread nik

Yes, I have tried `r.series.fiter` with winsize=3 and winsize=9 for a
year of MODIS products. 
It seems it works. But I want to ensure I am not filtering in space
too.- 


Vero, it feels nice to read you understand what I am trying to describe.

As usual there is an excuse/justification: workload suppresses/d placing
the adjective 'moving' or 'rolling' in the right place before median. 


So, It's a rolling median-filtering of 1-D signal (call it scalar,
vector) in time. 


If you dig in the code of the addon, it uses SciPy's
https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.medfilt.html#scipy.signal.medfilt.

This function applies indeed to both 1-D and 2-D data. 


So, we are discussing about the `kernel_size` input parameter for
scipy.signal.medfilt [1].

   > A scalar or an N-length list giving the size of the median filter
window in each dimension. Elements of _kernel_size_ should be odd. If
_kernel_size_ is a scalar, then this scalar is used as the size in each
dimension. Default size is 3 for each dimension. 

By the way, there is a note that 
   > The more general function scipy.ndimage.median_filter [2] has a

more efficient implementation of a median filter and therefore runs much
faster. 

Nikos 
---


On 2021-01-27 16:59, Veronica Andreo wrote:

El mié., 27 ene. 2021 11:33,  escribió: 

Thank you Vero. 

Consider the following time series [1, 2, 2, 6, 3, 3, 4, 4, 3, 2, 2, 1] <- evolution of a pixel in time. 

Say this is always the same pixel indexed at [0, 0] in each of 12 raster maps registered in a GRASS GIS STRDS. 

Median filtering pixel-wise in time, only, with a temporal window=3, would then be doing: 

1st pixel would be replaced by the median of [0, 1, 2] 

2nd pixel would be replaced by then median of [1, 2, 2] 

3rd pixel would be replaced by the median of [2, 2, 6] 

4th pixel would be replaved by the median of [2, 6, 3] 


etc.


Got it, it's more like a rolling median what you need.  

Have you tried r.series.filter? From the manual page, it seems that's exactly what it does if you set method=median and winsize=3 (given that winsize is in time) 

Otherwise, we can think harder on how to do that with t.rast.algebra and the neighborhood modifier only moving in time. But, you should explore how to expose the median function from r.mapcalc first, since it's not available in t.rast.algebra yet 


Doing a spatial median over a 2D (sub)window of each raster map in a GRASS GIS 
STRDS is not wanted here.  I hope this is more clear now.


This is not what I suggested in the previous email either. Both r.series and t.rast.series will estimate the median per pixel in time (either for the whole series or the time period you want). Would it be possible then with so e sort of special for cycle? 

Best, 
Vero 

Nikos 


---

On 2021-01-27 16:04, Veronica Andreo wrote: 

What exactly do you mean by median-filtering in time only, Nikos? Get the median and then filtering out all pixels above/below that value? If that's the case, then maybe some of the examples here https://grasswiki.osgeo.org/wiki/Temporal_data_processing#Spatio-temporal_algebra_with_STRDS might be of help 

Basically, you first estimate the median of the series (or the period you are interested in) either with r.series or t.rast.series and then use t.rast.mapcalc or t.rast.algebra to get only pixels below/above that value represented pixelwise in the median map. It can also be a single value of course. 

Does that make sense? 

best, 
Vero 


El mié., 27 ene. 2021 08:44,  escribió: I am trying 
to median-filter time series in time and not in space.

Not sure `r.series.filter` is the right tool.
I skimmed through the manual, the paper and the source code. Yet I am 
asking for a confirmation.
Its (odd integer) parameter `winsize=` implies a moving window (of size 
winsize^2).

Does this rather filter images, of a time series, in space?
Or does the `winsize` here refer to the length of a moving temporal 
window?


Then, there is `r.series.lwr`.
Can I use the tool with `order=0` and `delta=1` (or `order=3` and 
`delta=1`)

and perform a moving average filtering in time?
It's not median. Still I'd like to see a filtering in time-only effect.

And, now I recall `r.hants`.
Is there a way to use it for filtering-out only lows and highs (`-l` and 
`-h` respectively) pixel-wise in time, without interpolating nor 
extrapolating?


Else, I guess there should be a way to build a 'custom' filter using 
`t.rast.algebra` using its temporal neighborhood modifier.
It's convenient if one the tools above does already median-filtering in 
time-only.


Kind regards, Nikos
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user



Links:
--
[1]
https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.medfilt.html#scipy.signal.medfilt
[2]

Re: [GRASS-user] Raster gaussian filter

2021-01-27 Thread Eric Patton via grass-user
Great, thanks Markus! I’ll give it a try.

~ E.

On Wed, Jan 27, 2021 at 11:10 AM, Markus Metz  
wrote:

> A spatial Gauss filter is available in r.resamp.filter. I use it regularly 
> for smoothing and interpolation.
>
> HTH,
>
> Markus M
>
> On Wed, Jan 27, 2021 at 4:03 PM Eric Patton via grass-user 
>  wrote:
>>
>> Hi all,
>>
>> I was wondering if there was any tool in grass that does a Gaussian blur of 
>> a raster data set. I am trying to smooth out and blur survey-related 
>> artefacts in a swath multibeam dataset. I seem to remember in Grass 6.x 
>> there was r.gauss, but I don’t see it anymore in Grass 7.8.x.
>>
>> Thanks,
>>
>> ~ Eric.
>>
>> ___
>> grass-user mailing list
>> grass-user@lists.osgeo.org
>> https://lists.osgeo.org/mailman/listinfo/grass-user___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Raster gaussian filter

2021-01-27 Thread Markus Metz
A spatial Gauss filter is available in r.resamp.filter. I use it regularly
for smoothing and interpolation.

HTH,

Markus M

On Wed, Jan 27, 2021 at 4:03 PM Eric Patton via grass-user <
grass-user@lists.osgeo.org> wrote:
>
> Hi all,
>
> I was wondering if there was any tool in grass that does a Gaussian blur
of a raster data set. I am trying to smooth out and blur survey-related
artefacts in a swath multibeam dataset. I seem to remember in Grass 6.x
there was r.gauss, but I don’t see it anymore in Grass 7.8.x.
>
> Thanks,
>
> ~ Eric.
>
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Raster gaussian filter

2021-01-27 Thread Stefan Blumentrath
Hei Eric,

Try r.neighbors.

Cheers
Stefan

Get Outlook for Android


From: grass-user  on behalf of Eric Patton 
via grass-user 
Sent: Wednesday, January 27, 2021 3:59:15 PM
To: grass-user 
Subject: [GRASS-user] Raster gaussian filter

Hi all,

I was wondering if there was any tool in grass that does a Gaussian blur of a 
raster data set. I am trying to smooth out and blur survey-related artefacts in 
a swath multibeam dataset. I seem to remember in Grass 6.x there was r.gauss, 
but I don’t see it anymore in Grass 7.8.x.

Thanks,

~ Eric.

___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] Raster gaussian filter

2021-01-27 Thread Eric Patton via grass-user
Hi all,

I was wondering if there was any tool in grass that does a Gaussian blur of a 
raster data set. I am trying to smooth out and blur survey-related artefacts in 
a swath multibeam dataset. I seem to remember in Grass 6.x there was r.gauss, 
but I don’t see it anymore in Grass 7.8.x.

Thanks,

~ Eric.___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Median filtering time series in time only

2021-01-27 Thread Veronica Andreo
El mié., 27 ene. 2021 11:33,  escribió:

> Thank you Vero.
>
> Consider the following time series [1, 2, 2, 6, 3, 3, 4, 4, 3, 2, 2, 1] <-
> evolution of a pixel in time.
>
> Say this is always the same pixel indexed at [0, 0] in each of 12 raster
> maps registered in a GRASS GIS STRDS.
>
> Median filtering pixel-wise in time, only, with a temporal window=3, would
> then be doing:
>
> 1st pixel would be replaced by the median of [0, 1, 2]
>
> 2nd pixel would be replaced by then median of [1, 2, 2]
>
> 3rd pixel would be replaced by the median of [2, 2, 6]
>
> 4th pixel would be replaved by the median of [2, 6, 3]
>
> etc.
>
>
Got it, it's more like a rolling median what you need.

Have you tried r.series.filter? From the manual page, it seems that's
exactly what it does if you set method=median and winsize=3 (given that
winsize is in time)

Otherwise, we can think harder on how to do that with t.rast.algebra and
the neighborhood modifier only moving in time. But, you should explore how
to expose the median function from r.mapcalc first, since it's not
available in t.rast.algebra yet

Doing a spatial median over a 2D (sub)window of each raster map in a GRASS
> GIS STRDS is not wanted here.  I hope this is more clear now.
>

This is not what I suggested in the previous email either. Both r.series
and t.rast.series will estimate the median per pixel in time (either for
the whole series or the time period you want). Would it be possible then
with so e sort of special for cycle?

Best,
Vero

Nikos
>
>
> ---
>
>
>
> On 2021-01-27 16:04, Veronica Andreo wrote:
>
> What exactly do you mean by median-filtering in time only, Nikos? Get the
> median and then filtering out all pixels above/below that value? If that's
> the case, then maybe some of the examples here
> https://grasswiki.osgeo.org/wiki/Temporal_data_processing#Spatio-temporal_algebra_with_STRDS
> might be of help
>
> Basically, you first estimate the median of the series (or the period you
> are interested in) either with r.series or t.rast.series and then use
> t.rast.mapcalc or t.rast.algebra to get only pixels below/above that value
> represented pixelwise in the median map. It can also be a single value of
> course.
>
> Does that make sense?
>
> best,
> Vero
>
>
> El mié., 27 ene. 2021 08:44,  escribió:
>
> I am trying to median-filter time series in time and not in space.
>
> Not sure `r.series.filter` is the right tool.
> I skimmed through the manual, the paper and the source code. Yet I am
> asking for a confirmation.
> Its (odd integer) parameter `winsize=` implies a moving window (of size
> winsize^2).
> Does this rather filter images, of a time series, in space?
> Or does the `winsize` here refer to the length of a moving temporal
> window?
>
> Then, there is `r.series.lwr`.
> Can I use the tool with `order=0` and `delta=1` (or `order=3` and
> `delta=1`)
> and perform a moving average filtering in time?
> It's not median. Still I'd like to see a filtering in time-only effect.
>
> And, now I recall `r.hants`.
> Is there a way to use it for filtering-out only lows and highs (`-l` and
> `-h` respectively) pixel-wise in time, without interpolating nor
> extrapolating?
>
> Else, I guess there should be a way to build a 'custom' filter using
> `t.rast.algebra` using its temporal neighborhood modifier.
> It's convenient if one the tools above does already median-filtering in
> time-only.
>
> Kind regards, Nikos
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
>
>
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Median filtering time series in time only

2021-01-27 Thread nik
Thank you Vero. 


Consider the following time series [1, 2, 2, 6, 3, 3, 4, 4, 3, 2, 2, 1]
<- evolution of a pixel in time. 


Say this is always the same pixel indexed at [0, 0] in each of 12 raster
maps registered in a GRASS GIS STRDS. 


Median filtering pixel-wise in time, only, with a temporal window=3,
would then be doing: 

1st pixel would be replaced by the median of [0, 1, 2] 

2nd pixel would be replaced by then median of [1, 2, 2] 

3rd pixel would be replaced by the median of [2, 2, 6] 

4th pixel would be replaved by the median of [2, 6, 3] 

etc. 


Doing a spatial median over a 2D (sub)window of each raster map in a
GRASS GIS STRDS is not wanted here.  I hope this is more clear now. 

Nikos 


---

On 2021-01-27 16:04, Veronica Andreo wrote:

What exactly do you mean by median-filtering in time only, Nikos? Get the median and then filtering out all pixels above/below that value? If that's the case, then maybe some of the examples here https://grasswiki.osgeo.org/wiki/Temporal_data_processing#Spatio-temporal_algebra_with_STRDS might be of help 

Basically, you first estimate the median of the series (or the period you are interested in) either with r.series or t.rast.series and then use t.rast.mapcalc or t.rast.algebra to get only pixels below/above that value represented pixelwise in the median map. It can also be a single value of course. 

Does that make sense? 

best, 
Vero 

El mié., 27 ene. 2021 08:44,  escribió: 


I am trying to median-filter time series in time and not in space.

Not sure `r.series.filter` is the right tool.
I skimmed through the manual, the paper and the source code. Yet I am 
asking for a confirmation.
Its (odd integer) parameter `winsize=` implies a moving window (of size 
winsize^2).

Does this rather filter images, of a time series, in space?
Or does the `winsize` here refer to the length of a moving temporal 
window?


Then, there is `r.series.lwr`.
Can I use the tool with `order=0` and `delta=1` (or `order=3` and 
`delta=1`)

and perform a moving average filtering in time?
It's not median. Still I'd like to see a filtering in time-only effect.

And, now I recall `r.hants`.
Is there a way to use it for filtering-out only lows and highs (`-l` and 
`-h` respectively) pixel-wise in time, without interpolating nor 
extrapolating?


Else, I guess there should be a way to build a 'custom' filter using 
`t.rast.algebra` using its temporal neighborhood modifier.
It's convenient if one the tools above does already median-filtering in 
time-only.


Kind regards, Nikos
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Median filtering time series in time only

2021-01-27 Thread Veronica Andreo
What exactly do you mean by median-filtering in time only, Nikos? Get the
median and then filtering out all pixels above/below that value? If that's
the case, then maybe some of the examples here
https://grasswiki.osgeo.org/wiki/Temporal_data_processing#Spatio-temporal_algebra_with_STRDS
might be of help

Basically, you first estimate the median of the series (or the period you
are interested in) either with r.series or t.rast.series and then use
t.rast.mapcalc or t.rast.algebra to get only pixels below/above that value
represented pixelwise in the median map. It can also be a single value of
course.

Does that make sense?

best,
Vero


El mié., 27 ene. 2021 08:44,  escribió:

> I am trying to median-filter time series in time and not in space.
>
> Not sure `r.series.filter` is the right tool.
> I skimmed through the manual, the paper and the source code. Yet I am
> asking for a confirmation.
> Its (odd integer) parameter `winsize=` implies a moving window (of size
> winsize^2).
> Does this rather filter images, of a time series, in space?
> Or does the `winsize` here refer to the length of a moving temporal
> window?
>
> Then, there is `r.series.lwr`.
> Can I use the tool with `order=0` and `delta=1` (or `order=3` and
> `delta=1`)
> and perform a moving average filtering in time?
> It's not median. Still I'd like to see a filtering in time-only effect.
>
> And, now I recall `r.hants`.
> Is there a way to use it for filtering-out only lows and highs (`-l` and
> `-h` respectively) pixel-wise in time, without interpolating nor
> extrapolating?
>
> Else, I guess there should be a way to build a 'custom' filter using
> `t.rast.algebra` using its temporal neighborhood modifier.
> It's convenient if one the tools above does already median-filtering in
> time-only.
>
> Kind regards, Nikos
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
>
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] Median filtering time series in time only

2021-01-27 Thread nik

I am trying to median-filter time series in time and not in space.

Not sure `r.series.filter` is the right tool.
I skimmed through the manual, the paper and the source code. Yet I am 
asking for a confirmation.
Its (odd integer) parameter `winsize=` implies a moving window (of size 
winsize^2).

Does this rather filter images, of a time series, in space?
Or does the `winsize` here refer to the length of a moving temporal 
window?


Then, there is `r.series.lwr`.
Can I use the tool with `order=0` and `delta=1` (or `order=3` and 
`delta=1`)

and perform a moving average filtering in time?
It's not median. Still I'd like to see a filtering in time-only effect.

And, now I recall `r.hants`.
Is there a way to use it for filtering-out only lows and highs (`-l` and 
`-h` respectively) pixel-wise in time, without interpolating nor 
extrapolating?


Else, I guess there should be a way to build a 'custom' filter using 
`t.rast.algebra` using its temporal neighborhood modifier.
It's convenient if one the tools above does already median-filtering in 
time-only.


Kind regards, Nikos
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user