Swapnil,<br><br>I'm not sure which shell script you are running, but in bash, you need to have semicolons somewhere there.<br><br>The -scale option does a linear stretch of the pixel values. So, if you have values ranging from 0 to 250, "-scale 0 250 0 25" will do the job you are trying to do.<br>
<br>Please add the error messages if you still have any more problems.<br><br><div class="gmail_quote">On Fri, May 11, 2012 at 11:05 AM, Swapnil Chaudhari <span dir="ltr"><<a href="mailto:swapsslan@gmail.com" target="_blank">swapsslan@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Chaitanya,<br>
<br>
Thank you for your response. I tried inserting the --format option. It<br>
still gives me the same error.<br>
I would be glad if you can describe the --scale function. It asks for<br>
, [-scale [src_min src_max [dst_min dst_max]]]<br>
How do you put a formula here? like "raster/10"<br>
<br>
Thanks a ton! I think you have given me a way to do it.<br>
<span class="HOEnZb"><font color="#888888"><br>
Swapnil<br>
</font></span><div class="im HOEnZb"> o__<br>
_> /__<br>
(_) \(_)....... live healthy<br>
<br>
<br>
<br>
</div><div class="HOEnZb"><div class="h5">On Fri, May 11, 2012 at 10:42 AM, Chaitanya kumar CH<br>
<<a href="mailto:chaitanya.ch@gmail.com">chaitanya.ch@gmail.com</a>> wrote:<br>
> Swapnil,<br>
><br>
> You missed the --format option with gdal_calc. If you don't mention it, it<br>
> assumes the default format, GeoTiff.<br>
><br>
> Since the operation is simple, you should be able to do that using<br>
> gdal_translate using the -scale option. It also has the -projwin option to<br>
> select the extents.<br>
><br>
> On Fri, May 11, 2012 at 9:59 AM, Swapnil Chaudhari <<a href="mailto:swapsslan@gmail.com">swapsslan@gmail.com</a>><br>
> wrote:<br>
>><br>
>> Dear All,<br>
>><br>
>> I would like to get your advise on running gdal_calc using shell.<br>
>> I am finding it difficult, mostly because the command requires you to<br>
>> define what -A stands for etc. which is quite different from<br>
>> gdal_translate or such similar tools, so is the case with Raster<br>
>> package in R.<br>
>><br>
>> I wish to scale all the temperature ascii grids that I have for quite<br>
>> a few number of folders.<br>
>><br>
>> I wrote following sh file<br>
>><br>
>> for f in *.tif<br>
>> do<br>
>> echo "Processing $f"<br>
>> gdal_calc -A $f --outfile=$f_scaled.asc --calc=A/10<br>
>> done<br>
>><br>
>><br>
>> However, I am making a mistake somewhere, it does not read above<br>
>> script as a command. I wish to divide all the rasters with 10 and also<br>
>> equally wish to make all output files extent as "-projwin -180.0 90.0<br>
>> 180.0 -60.0" and column 720 with rows 300<br>
>><br>
>> I would be really thankful if you can give some suggestion on this.<br>
>><br>
>> Thanks a ton.<br>
>><br>
>> Swapnil Chaudhari<br>
>><br>
>> o__<br>
>> _> /__<br>
>> (_) \(_)....... live healthy<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><br>
><br>
><br>
><br>
> --<br>
> Best regards,<br>
> Chaitanya kumar CH.<br>
><br>
> <a href="tel:%2B91-9494447584" value="+919494447584">+91-9494447584</a><br>
> 17.2416N 80.1426E<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Best regards,<br>Chaitanya kumar CH.<br><br>+91-9494447584<br>17.2416N 80.1426E<br>