Hi krasny2k5,

According to the source code in **ps_select.m** from line 262~267:

**i_min=max(ps_ij(1)-n_win/2, 1);**

**i_max=i_min+n_win-1;**

**if i_max > n_i**

**i_min=i_min-i_max+n_i;**

**i_max=n_i;**

**end**

The value of i_min or i_max can not be negative if the **if** statement is not true. However, once the **if** is true, **i_min** will equal **-n_win+1+n_i**, where **n_win** is the parameter **clap_win** in step 2, which equals 32 by default, while the value of **n_i** depends on both the parameter **filter_gird_size**, which is also the parameter in step 2 and default value is 50 meters, and the size of pixels, which default is 5m*20m, so, the minimum of you subset should let n_i(or n_j) equals 31, means it should larger than 31*50/5=310 in col and 31*50/20=77.5 in row.

But actually I do not meet the problem as you do, so you should test it by yourself, increase the size of your subset, and maybe the problem can be solved.

Hope this helps,

Fei