<div dir="ltr">yes, I checked the histogram and the out image is completely black.</div><div class="gmail_extra"><br clear="all"><div><div dir="ltr">cleo</div></div>
<br><br><div class="gmail_quote">On Wed, Jul 30, 2014 at 1:53 AM, Jukka Rahkonen <span dir="ltr"><<a href="mailto:jukka.rahkonen@mmmtike.fi" target="_blank">jukka.rahkonen@mmmtike.fi</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Cleo Drakos <cleo21drakos <at> <a href="http://gmail.com" target="_blank">gmail.com</a>> writes:<br>
<br>
><br>
> Thanks for your response.I tried the followings:<br>
<div class="">><br>
><br>
> gcalc = 'C:\\Users\\cleo\\Documents\\gdalpys\\gdal_calc.py'<br>
> ##I produced second file (b)as the copy of first(a)<br>
><br>
> a = 'D:\\a.tif'<br>
> b = 'D:\\b.tif'<br>
> outfile = 'D:\\result.tif'<br>
> expr = '(A-B)/(A+B)'<br>
> subprocess.call([sys.executable,gcalc,'-A',a,'--A_band','1','-B',b,<br>
'--B_band','0','--outfile',outfile,\<br>
><br>
>     '--calc',expr,'--type','Float32','--format','ENVI'],shell=True)  <br>
> a,b,outfile = None, None,None<br>
><br>
><br>
> Unfortunately, resulted file is completely black.<br>
><br>
><br>
> I hope someone can help me.<br>
</div>Have you checked from the histogram that the result is totally black? I<br>
could imagine that bands 1 (A) and 2 (B) can have values close to each<br>
other which makes that A-B is close to zero. That divided by A+B makes<br>
the values even closer to zero and if such Float32 type image is opened<br>
in an image viewer without LUT stretch that could well appear as<br>
totally black. Forget all this if you have checked the histograms.<br>
<span class="HOEnZb"><font color="#888888"><br>
-Jukka Rahkonen-<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a></div></div></blockquote></div><br></div>