<div dir="ltr">Thanks. That helps. I now use the output of that (SZA_lut) and the following:<div><br></div><div><div>r.mapcalc --o <<EOF</div><div>eval(SZA0 = if(SZA_lut == 0, ${img_arr[0]}), \</div><div> SZA1 = if(SZA_lut == 1, ${img_arr[1]}), \</div><div> SZA2 = if(SZA_lut == 2, ${img_arr[2]}), \</div><div> SZA3 = if(SZA_lut == 3, ${img_arr[3]}), \</div><div> SZA4 = if(SZA_lut == 4, ${img_arr[4]}), \</div><div> SZA5 = if(SZA_lut == 5, ${img_arr[5]}))</div><div>SZA_min = SZA0+SZA1+SZA2+SZA3+SZA4+SZA5</div><div>EOF</div></div><div><br></div><div> -k.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 17, 2017 at 1:41 PM, Moritz Lennert <span dir="ltr"><<a href="mailto:mlennert@club.worldonline.be" target="_blank">mlennert@club.worldonline.be</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><br>
<br>
Le 17 octobre 2017 13:38:34 GMT+02:00, Ken Mankoff <<a href="mailto:mankoff@gmail.com">mankoff@gmail.com</a>> a écrit :<br>
>Dear GRASS List,<br>
><br>
>I'm trying to do something in GRASS and can't figure out an efficient<br>
>way to do it. I'm guessing it is possible with 1-3 lines, but don't<br>
>know which ones. The algorithm I'm developing would be much more<br>
>complex, and I hope someone can suggest a shortcut.<br>
><br>
>I have several satellite products of the same region each day. For<br>
>simplicity sake lets assume 3 overlapping solar zenith angle (SZA)<br>
>products, and for each of those a visual image (VIS). I'd like to have<br>
>one visual raster that, for each pixel, has the minimum SZA.<br>
><br>
>I can get the minimum SZA for each pixel with<br>
><br>
>r.mapcalc "SZA_min = min(SZA1,SZA2,SZA3)"<br>
><br>
>But now I've lost the source of the minimum SZA, and I need it to link<br>
>SZA1 with VIS1.<br>
><br>
>I could encode categories for each SZA:<br>
>r.category map=SZA1 cats=0-360 values=1<br>
>r.category map=SZA2 cats=0-360 values=2<br>
>r.category map=SZA3 cats=0-360 values=3<br>
><br>
>And then<br>
><br>
>r.mapcalc "SZA_min_cat = min(@SZA1,@SZA2,@SZA3)"<br>
><br>
>And then use SZA_min_cat (values: 1 to 3) as a lookup to<br>
>VIS1,VIS2,VIS3. I'm actually not clear how to do this last step, if<br>
>this is the correct approach. Do I return to r.mapcalc, or is r.univar<br>
>the right tool?<br>
><br>
>Any help will be much appreciated.<br>
<br>
</div></div>Check r.series, notably the min_raster method.<br>
<br>
Moritz<br>
<br>
<br>
><br>
>Thanks,<br>
><br>
> -k.<br>
><br>
>_____________________________<wbr>__________________<br>
>grass-user mailing list<br>
><a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a><br>
><a href="https://lists.osgeo.org/mailman/listinfo/grass-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/grass-user</a><br>
</blockquote></div><br></div>