<div dir="ltr">Dear Dr Chris Yesson<br><br>Thanks for your quick response.<br><br>I got the following error:<br><br>ValueError: The truth value of an array with more than one element is ambiguous. <br>Use a.any() or a.all()`<br><br>Perhaps the expression for calc seems to be revised...<div><br></div><div><br><div class="gmail_extra"><div class="gmail_quote">On Tue, Nov 25, 2014 at 4:59 PM, Chris Yesson <span dir="ltr"><<a href="mailto:chris.yesson.phd@gmail.com" target="_blank">chris.yesson.phd@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Dear Simen,<div><br></div><div>You can refer to each band explicitly using the --A_band option.</div><div>Try something like this</div><div><br></div><div>gdal_calc.py -A infile --A_band 1 -B infile --B_band 2 -C infile --C_band 3  --outfile outfile --calc median(A,B,C)</div><div class="gmail_extra"><br></div><div class="gmail_extra">- Chris</div><div class="gmail_extra"><br clear="all"><div><div><div dir="ltr"><em><span style="font-size:12pt">Dr Chris Yesson</span></em><i><span style="font-size:10pt;font-family:Arial"><br></span><em><span style="font-size:12pt">Institute of Zoology, </span></em><em><span style="font-size:12pt">Zoological Society of London</span></em></i><div><div><i><font size="3">Tel: 020 7449 6267</font></i><br></div><div><i><font size="3">email: <a href="mailto:chris.yesson@ioz.ac.uk" target="_blank">chris.yesson@ioz.ac.uk</a><br></font></i><span style="font-size:10pt;font-family:Arial"><em><span style="font-size:12pt">web: <a href="http://www.zsl.org/chrisyesson/" target="_blank">http://www.zsl.org/chrisyesson/</a></span></em><br>
</span></div></div><div><em style="font-family:Arial"><span style="font-size:12pt">Note: I work Mon-Thurs and do not check email on Fri</span></em><br></div></div></div></div>
<br><div class="gmail_quote"><div><div class="h5">On 25 November 2014 at 07:44, Simen Langseth <span dir="ltr"><<a href="mailto:simlangen@gmail.com" target="_blank">simlangen@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">Dear Respected Authors:<div><br></div><div>I would be grateful if you could share any hints on it.</div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 25, 2014 at 4:33 PM, Simen Langseth <span dir="ltr"><<a href="mailto:simlangen@gmail.com" target="_blank">simlangen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Dear Marius Jigmond:<br><br>Thanks for your attempt.<br><br>Unfortunately, it is producing 3 band outfile, rather than 1 band median image.<br><br>I could not figure out what this code computed, all the resulted 3 bands images are also different.<br><br>I hope someone can help me.<br></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 25, 2014 at 12:09 PM, Marius Jigmond <span dir="ltr"><<a href="mailto:mariusjigmond@hotmail.com" target="_blank">mariusjigmond@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">


<div><div dir="ltr">Does the following work:<div><br><div>gdal_calc.py -A infile --allBands=A --outfile=outfile --calc="median(A)"</div><div><br><br><div><hr>Date: Mon, 24 Nov 2014 19:14:06 +0900<br>From: <a href="mailto:simlangen@gmail.com" target="_blank">simlangen@gmail.com</a><br>To: <a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>Subject: [gdal-dev] gdal_calc.py: produce median raster<div><div><br><br><div dir="ltr">I have one GeoTiff file with 3 bands. I want to produce a raster file computing pixel wise median value for the three raster bands. How can I do that?<div><br></div><div>I tried as follows:</div><div><br></div><div>gdal_calc.py -A infile --allBands --outfile outfile --calc median(A)</div><div><br></div><div>But could not get any out file.</div><div><br></div><div> </div></div>
<br></div></div>_______________________________________________
gdal-dev mailing list
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a></div></div></div>                                       </div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div></div>
<br><br>
</div></div><p align="center"><font style="background-color:rgb(255,255,255)" size="1">This message has been scanned for viruses by </font><a href="http://www.mailcontrol.com/" target="_blank"><font style="background-color:rgb(255,255,255)" size="1">MailControl</font></a><font style="background-color:rgb(255,255,255)" size="1">, a service from </font><a href="http://www.blackspider.com/" target="_blank"><font style="background-color:rgb(255,255,255)" size="1">BlackSpider Technologies</font></a><font style="background-color:rgb(255,255,255)" size="1">.</font></p>
<p align="center"><span style="background:white"><font size="1">Click <a href="https://www.mailcontrol.com/sr/MZbqvYs5QwJvpeaetUwhCQ==" target="_blank">here</a> to report this email as spam.<u></u><u></u><u></u></font></span></p>
<br><br>
<font>The Zoological Society of London is incorporated by Royal Charter<br>Principal Office England. Company Number RC000749<br>Registered address: <br>Regent's Park, London, England NW1 4RY<br>Registered Charity in England and Wales no. 208728</font> 
<p align="left"><font><font></font></font></p>
<p align="center"><font style="background-color:rgb(255,255,255)"><font size="1">_________________________________________________________________________<br>This e-mail has been sent in confidence to the named addressee(s).<br>If you are not the intended recipient, you must not disclose or distribute<br>it in any form, and you are asked to contact the sender immediately.<br>Views or opinions expressed in this communication may not be those<br>of The Zoological Society of London and, therefore, The Zoological<br>Society of London does not accept legal responsibility for the contents<br>of this message. The recipient(s) must be aware that e-mail is not a<br>secure communication medium and that the contents of this mail may<br>have been altered by a third party in transit.<br>If you have any issues regarding this mail please contact:<br></font><a href="mailto:administrator@zsl.org" target="_blank"><font size="1">administrator@zsl.org</font></a><font size="1">.<br>___________________________________________________________________________<br></font></font></p>
<p align="center"><font style="background-color:rgb(255,255,255)"></font><font size="1"></font></p>
<p align="center"><font style="background-color:rgb(255,255,255)" size="1">This message has been scanned for viruses by </font><a href="http://www.mailcontrol.com/" target="_blank"><font style="background-color:rgb(255,255,255)" color="#000000" size="1">MailControl</font></a><font style="background-color:rgb(255,255,255)" size="1">, a service from </font><a href="http://www.blackspider.com/" target="_blank"><font style="background-color:rgb(255,255,255)" color="#000000" size="1">BlackSpider Technologies</font></a><font style="background-color:rgb(255,255,255)" size="1">.</font></p>
</blockquote></div><br></div></div>
</blockquote></div><br></div></div></div>