On Mon, Jun 17, 2013 at 10:58 PM, Nikos Alexandris
<n...@nikosalexandris.net> wrote:
> Markus Metz wrote:
>
>> Feeding the test values and the evi(2) formula to r.mapcalc, the
>> results are more or less in the expected range, still beyond [-1, 1],
>> but not much.
>
> [cut]
>
> Yes, but feeding the "suspect" values in r.mapcalc, still gives, correctly,
> large/out of range (regarding EVI's expected range) result(s).

Just to confirm, the suspect values are

> blue <- 0.230260364323039
> red <- 0.110923862670943
> nir <- 0.0614305088322746
> evi <- ( 2.5 * ( nir - red) ) / (nir + 6 * red - 7 * blue + 1.0)
> evi
[1] -1.07453

and

> blue <- 0.228143006540123
> red <- 0.106632395012542
> nir <- 0.0712654621906476
> evi <- ( 2.5 * ( nir - red) ) / (nir + 6 * red - 7 * blue + 1.0)
> evi
[1] -0.7751909

?

Using r.mapcalc I get the same results like in R, not
-5905.44171917482 or 6952.80543731566, respectively. Why are the way
out of range values correct if R produces reasonable results?

Markus M


>
> Anyhow, just to have a quick-check on "r.what", should I upload the bands in
> question somewhere?  Would anyone have the time to explain/check why r.what
> gives different results depending on the extent/resolution for the same
> coordinates?  Which, might be expected, but why does "g.region rows=1 cols=1"
> set the resolution to... see below:

That explained Moritz. I would only add that you should align the
region to the raster (not the raster's resolution, these are two
different things), before using r.what, otherwise the raster lib will
do some internal nn resamplng (if the region's resoltion is larger
than the raster's resolution).

>
> Nikos
>
>
> Nikos Alexandris:
>
> [snip]
>
>> > Now, "pointing" to the suspect pixel:
>> >
>> > # both res=30  &  res=1 give the same result, of course
>> > g.region -pagc e=784935 n=2695215 rows=1 cols=1 res=30
> -------------------------------------------^------^-----^^
>> >
>> > n=2695230
>> > s=2621340
>> > w=658560
>> > e=784950
>
> ----------vvvvvv
>> > nsres=73890
>> > ewres=126390
> ----------^^^^^^
>
>> > rows=1
>> > cols=1
>> > cells=1
>> > center_easting=721755.000000
>> > center_northing=2658285.000000
>> >
>> > # what is there?
>> > r.what coordinates=784935,2695215
>> > map=B.Trimmed.ToAR.1,B.Trimmed.ToAR.3,B.Trimmed.ToAR.4,evi_DN,evi_ToAR
>> >
>> > 784935|2695215||0.264138088849702|0.372703389833447|
>> > 0.438437054236573|-0.203045685279188|0.0970312073830427
>> >
>> > [..]
>> >
>> > I guess it has to do with the extent/res definitions...
_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

Reply via email to