Rapid response for true color has this:<br><br>;- Rapid Response default enhancement: 0,0, 30,110, 60,160, 120,210, 190,240, 255,255<br>x = byte([0,  30,  60, 120, 190, 255])<br>y = byte([0, 110, 160, 210, 240, 255])<br><br>
;- Rapid Response cloud enhancement: 0,0, 25,90, 55,140, 100,175, 255,255<br>if keyword_set(cloud) then begin<br>  x = byte([0, 25,  55, 100, 255])<br>  y = byte([0, 90, 140, 175, 255])<br>endif<br><br><br>how it can be programmed in gdal language?<br>
<br>--Nikos<br><br><div class="gmail_quote">On Thu, Jun 9, 2011 at 8:42 PM, Brian Case <span dir="ltr">&lt;<a href="mailto:rush@winkey.org">rush@winkey.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Nikos<br>
<br>
143, and 721<br>
<font color="#888888"><br>
Brian<br>
</font><div><div></div><div class="h5"><br>
On Thu, 2011-06-09 at 16:49 -0700, Nikolaos Hatzopoulos wrote:<br>
&gt; for modis truecolor images?<br>
&gt;<br>
&gt; --Nikos<br>
&gt;<br>
&gt; On Thu, Jun 9, 2011 at 4:44 PM, Brian Case &lt;<a href="mailto:rush@winkey.org">rush@winkey.org</a>&gt; wrote:<br>
&gt;         Jonathan<br>
&gt;<br>
&gt;         I don&#39;t know about worldview, but with modis I wound up using<br>
&gt;         multiple<br>
&gt;         ranges<br>
&gt;<br>
&gt;         0:0,750:110,1500:160,3000:210,4750:240,6375:255<br>
&gt;<br>
&gt;         see &lt;lut&gt;  in the vrt tutorial<br>
&gt;<br>
&gt;         Brian<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;         On Thu, 2011-06-09 at 12:39 -0700, Jonathan Greenberg wrote:<br>
&gt;         &gt; Brian:<br>
&gt;         &gt;<br>
&gt;         &gt;<br>
&gt;         &gt; Thanks!  Great solution, definitely saved me some time.  The<br>
&gt;         main<br>
&gt;         &gt; issue (in terms of doing this entirely within GDAL) is<br>
&gt;         getting the<br>
&gt;         &gt; right scaling to make the image look good.  I was able to<br>
&gt;         figure out<br>
&gt;         &gt; the correct scale range within ENVI, and then apply the<br>
&gt;         scales as you<br>
&gt;         &gt; suggested below.  Nikos&#39; suggestion to use rgb2pct makes me<br>
&gt;         wonder if<br>
&gt;         &gt; there is some way to figure out the optimal scale (which,<br>
&gt;         AFAIK, is<br>
&gt;         &gt; part of how rgb2pct is functioning) to apply to this image.<br>
&gt;         &gt;<br>
&gt;         &gt;<br>
&gt;         &gt; Incidentally, what I&#39;m trying to do is load Worldview-2 data<br>
&gt;         onto an<br>
&gt;         &gt; iPad 2 for use with the GISRoam mobile mapping app.<br>
&gt;          Worldview-2 is<br>
&gt;         &gt; 16-bit per band, 8 band data, with a very high dynamic range<br>
&gt;         (we have<br>
&gt;         &gt; snow in our image, so we have lots of VERY bright pixels<br>
&gt;         which throw<br>
&gt;         &gt; off the adjustment if using -scale without any parameters).<br>
&gt;          99%<br>
&gt;         &gt; (100%?) of mobile mapping applications need 3-band data,<br>
&gt;         usually with<br>
&gt;         &gt; only 8 bits per band.<br>
&gt;         &gt;<br>
&gt;         &gt;<br>
&gt;         &gt; Pushing forward, but if someone knows how to figure out an<br>
&gt;         optimal set<br>
&gt;         &gt; of scale values to use within GDAL, please post the<br>
&gt;         solution.<br>
&gt;         &gt;<br>
&gt;         &gt;<br>
&gt;         &gt; --j<br>
&gt;         &gt;<br>
&gt;         &gt; On Wed, Jun 8, 2011 at 9:45 PM, Brian Case &lt;<a href="mailto:rush@winkey.org">rush@winkey.org</a>&gt;<br>
&gt;         wrote:<br>
&gt;         &gt;         Jonathan<br>
&gt;         &gt;<br>
&gt;         &gt;         you can do scaling on individual bands.<br>
&gt;         &gt;<br>
&gt;         &gt;         gdal_translate -b 1 -scale 0 5000 -ot Byte -of VRT<br>
&gt;         infile<br>
&gt;         &gt;         outfile1.vrt<br>
&gt;         &gt;         gdal_translate -b 2 -scale 0 4000 -ot Byte -of VRT<br>
&gt;         infile<br>
&gt;         &gt;         outfile2.vrt<br>
&gt;         &gt;         gdal_translate -b 3 -scale 0 3000 -ot Byte -of VRT<br>
&gt;         infile<br>
&gt;         &gt;         outfile3.vrt<br>
&gt;         &gt;<br>
&gt;         &gt;         gdalbuildvrt -separate output.vrt outfile1.vrt<br>
&gt;         outfile2.vrt<br>
&gt;         &gt;         outfile3.vrt<br>
&gt;         &gt;<br>
&gt;         &gt;         gdal_translate -of gtiff output.vrt output.tif<br>
&gt;         &gt;<br>
&gt;         &gt;<br>
&gt;         &gt;<br>
&gt;         &gt;         for more complicated scaling you may need to hand<br>
&gt;         write a vrt<br>
&gt;         &gt;<br>
&gt;         &gt;         <a href="http://www.gdal.org/gdal_vrttut.html" target="_blank">http://www.gdal.org/gdal_vrttut.html</a><br>
&gt;         &gt;<br>
&gt;         &gt;         Brian<br>
&gt;         &gt;<br>
&gt;         &gt;<br>
&gt;         &gt;         On Wed, 2011-06-08 at 19:31 -0700, Jonathan<br>
&gt;         Greenberg wrote:<br>
&gt;         &gt;         &gt; Nikos and GDALers:<br>
&gt;         &gt;         &gt;<br>
&gt;         &gt;         &gt;<br>
&gt;         &gt;         &gt; This is CLOSE to what I&#39;m looking to do, but I&#39;m<br>
&gt;         having a<br>
&gt;         &gt;         hard time<br>
&gt;         &gt;         &gt; getting it working properly.  Here&#39;s my input<br>
&gt;         dataset<br>
&gt;         &gt;         gdalinfo dump:<br>
&gt;         &gt;         &gt;<br>
&gt;         &gt;         &gt;<br>
&gt;         &gt;         &gt; ***<br>
&gt;         &gt;         &gt;<br>
&gt;         &gt;         &gt;<br>
&gt;         &gt;         &gt; Driver: ENVI/ENVI .hdr Labelled<br>
&gt;         &gt;         &gt; Files:<br>
&gt;         &gt;<br>
&gt;         10SEP10191223-M2AS-052377832030_01_P003_ps_gs_bl_tc.envi<br>
&gt;         &gt;         &gt;<br>
&gt;         &gt;<br>
&gt;          10SEP10191223-M2AS-052377832030_01_P003_ps_gs_bl_tc.hdr<br>
&gt;         &gt;         &gt; Size is 42255, 51712<br>
&gt;         &gt;         &gt; Coordinate System is:<br>
&gt;         &gt;         &gt; GEOGCS[&quot;WGS 84&quot;,<br>
&gt;         &gt;         &gt;     DATUM[&quot;WGS_1984&quot;,<br>
&gt;         &gt;         &gt;         SPHEROID[&quot;WGS 84&quot;,6378137,298.257223563,<br>
&gt;         &gt;         &gt;             AUTHORITY[&quot;EPSG&quot;,&quot;7030&quot;]],<br>
&gt;         &gt;         &gt;         TOWGS84[0,0,0,0,0,0,0],<br>
&gt;         &gt;         &gt;         AUTHORITY[&quot;EPSG&quot;,&quot;6326&quot;]],<br>
&gt;         &gt;         &gt;     PRIMEM[&quot;Greenwich&quot;,0,<br>
&gt;         &gt;         &gt;         AUTHORITY[&quot;EPSG&quot;,&quot;8901&quot;]],<br>
&gt;         &gt;         &gt;     UNIT[&quot;degree&quot;,0.0174532925199433,<br>
&gt;         &gt;         &gt;         AUTHORITY[&quot;EPSG&quot;,&quot;9108&quot;]],<br>
&gt;         &gt;         &gt;     AUTHORITY[&quot;EPSG&quot;,&quot;4326&quot;]]<br>
&gt;         &gt;         &gt; Origin = (-120.066479999999999,39.271554000000002)<br>
&gt;         &gt;         &gt; Pixel Size =<br>
&gt;         (0.000004500000005,-0.000004500000005)<br>
&gt;         &gt;         &gt; Image Structure Metadata:<br>
&gt;         &gt;         &gt;   INTERLEAVE=BAND<br>
&gt;         &gt;         &gt; Corner Coordinates:<br>
&gt;         &gt;         &gt; Upper Left  (-120.0664800,  39.2715540) (120d<br>
&gt;         3&#39;59.33&quot;W,<br>
&gt;         &gt;         &gt; 39d16&#39;17.59&quot;N)<br>
&gt;         &gt;         &gt; Lower Left  (-120.0664800,  39.0388500) (120d<br>
&gt;         3&#39;59.33&quot;W, 39d<br>
&gt;         &gt;         &gt; 2&#39;19.86&quot;N)<br>
&gt;         &gt;         &gt; Upper Right (-119.8763325,  39.2715540)<br>
&gt;         (119d52&#39;34.80&quot;W,<br>
&gt;         &gt;         &gt; 39d16&#39;17.59&quot;N)<br>
&gt;         &gt;         &gt; Lower Right (-119.8763325,  39.0388500)<br>
&gt;         (119d52&#39;34.80&quot;W, 39d<br>
&gt;         &gt;         &gt; 2&#39;19.86&quot;N)<br>
&gt;         &gt;         &gt; Center      (-119.9714062,  39.1552020)<br>
&gt;         (119d58&#39;17.06&quot;W, 39d<br>
&gt;         &gt;         &gt; 9&#39;18.73&quot;N)<br>
&gt;         &gt;         &gt; Band 1 Block=42255x1 Type=UInt16,<br>
&gt;         ColorInterp=Undefined<br>
&gt;         &gt;         &gt; Band 2 Block=42255x1 Type=UInt16,<br>
&gt;         ColorInterp=Undefined<br>
&gt;         &gt;         &gt; Band 3 Block=42255x1 Type=UInt16,<br>
&gt;         ColorInterp=Undefined<br>
&gt;         &gt;         &gt;<br>
&gt;         &gt;         &gt;<br>
&gt;         &gt;         &gt; ***<br>
&gt;         &gt;         &gt;<br>
&gt;         &gt;         &gt;<br>
&gt;         &gt;         &gt; I need to end up with a Byte TIF image with good<br>
&gt;         color<br>
&gt;         &gt;         balance from<br>
&gt;         &gt;         &gt; this input.  Running rgb2pct.py on this dataset<br>
&gt;         just<br>
&gt;         &gt;         outputted a<br>
&gt;         &gt;         &gt; &quot;blank&quot; (grey) image.  Running gdal_translate -of<br>
&gt;         GTiff -ot<br>
&gt;         &gt;         Byte<br>
&gt;         &gt;         &gt; -scale [min] [max] worked somewhat, but its near<br>
&gt;         impossible<br>
&gt;         &gt;         to get<br>
&gt;         &gt;         &gt; this looking right, since the scaling I want to do<br>
&gt;         differs<br>
&gt;         &gt;         from band<br>
&gt;         &gt;         &gt; to band (e.g. if there any way to use -scale to<br>
&gt;         adjust each<br>
&gt;         &gt;         band<br>
&gt;         &gt;         &gt; separately)?  Alternatively, how would I get<br>
&gt;         rgb2pct.py<br>
&gt;         &gt;         working on the<br>
&gt;         &gt;         &gt; above image correctly?  Thanks!<br>
&gt;         &gt;         &gt;<br>
&gt;         &gt;         &gt;<br>
&gt;         &gt;         &gt; --j<br>
&gt;         &gt;         &gt;<br>
&gt;         &gt;         &gt;<br>
&gt;         &gt;         &gt;<br>
&gt;         &gt;         &gt; On Wed, Jun 8, 2011 at 4:10 PM, Nikolaos<br>
&gt;         Hatzopoulos<br>
&gt;         &gt;         &gt; &lt;<a href="mailto:nhatzop@gmail.com">nhatzop@gmail.com</a>&gt; wrote:<br>
&gt;         &gt;         &gt;         why you don&#39;t try rgb2pct<br>
&gt;         &gt;         <a href="http://www.gdal.org/rgb2pct.html" target="_blank">http://www.gdal.org/rgb2pct.html</a>?<br>
&gt;         &gt;         &gt;<br>
&gt;         &gt;         &gt;         --Nikos Hatzopoulos<br>
&gt;         &gt;         &gt;<br>
&gt;         &gt;         &gt;<br>
&gt;         &gt;         &gt;         On Wed, Jun 8, 2011 at 2:20 PM, Jonathan<br>
&gt;         Greenberg<br>
&gt;         &gt;         &gt;         &lt;<a href="mailto:greenberg@ucdavis.edu">greenberg@ucdavis.edu</a>&gt; wrote:<br>
&gt;         &gt;         &gt;<br>
&gt;         &gt;         &gt;<br>
&gt;         &gt;         &gt;                 Folks:<br>
&gt;         &gt;         &gt;<br>
&gt;         &gt;         &gt;<br>
&gt;         &gt;         &gt;                 I am using a piece of software<br>
&gt;         which is<br>
&gt;         &gt;         relying on an<br>
&gt;         &gt;         &gt;                 older version of GDAL that doesn&#39;t<br>
&gt;         have the<br>
&gt;         &gt;         &quot;fix&quot; to<br>
&gt;         &gt;         &gt;                 deal with &gt; 8 bit geotiffs (it is<br>
&gt;         trying to<br>
&gt;         &gt;         make a<br>
&gt;         &gt;         &gt;                 jpeg overlay but can&#39;t from a 16<br>
&gt;         bit image.<br>
&gt;         &gt;          I think<br>
&gt;         &gt;         &gt;                 this is the issue:<br>
&gt;         &gt;         &gt;<br>
&gt;         &gt;         <a href="http://trac.osgeo.org/gdal/wiki/TIFF12BitJPEG" target="_blank">http://trac.osgeo.org/gdal/wiki/TIFF12BitJPEG</a>), but<br>
&gt;         &gt;         &gt;                 when I do a straight convert (-ot<br>
&gt;         Byte) the<br>
&gt;         &gt;         output<br>
&gt;         &gt;         &gt;                 image looks really washed out.<br>
&gt;          Any hints<br>
&gt;         &gt;         for getting<br>
&gt;         &gt;         &gt;                 the best quality output from a 16<br>
&gt;         bit to to<br>
&gt;         &gt;         an 8 bit<br>
&gt;         &gt;         &gt;                 conversion of a Geotiff?<br>
&gt;         &gt;         &gt;<br>
&gt;         &gt;         &gt;<br>
&gt;         &gt;         &gt;                 --j<br>
&gt;         &gt;         &gt;<br>
&gt;         &gt;         &gt;                 --<br>
&gt;         &gt;         &gt;                 Jonathan A. Greenberg, PhD<br>
&gt;         &gt;         &gt;                 Assistant Project Scientist<br>
&gt;         &gt;         &gt;                 Center for Spatial Technologies<br>
&gt;         and Remote<br>
&gt;         &gt;         Sensing<br>
&gt;         &gt;         &gt;                 (CSTARS)<br>
&gt;         &gt;         &gt;                 Department of Land, Air and Water<br>
&gt;         Resources<br>
&gt;         &gt;         &gt;                 University of California, Davis<br>
&gt;         &gt;         &gt;                 One Shields Avenue<br>
&gt;         &gt;         &gt;                 Davis, CA 95616<br>
&gt;         &gt;         &gt;                 Phone: <a href="tel:415-763-5476" value="+14157635476">415-763-5476</a><br>
&gt;         &gt;         &gt;                 AIM: jgrn307, MSN:<br>
&gt;         <a href="mailto:jgrn307@hotmail.com">jgrn307@hotmail.com</a>,<br>
&gt;         &gt;         Gchat: jgrn307<br>
&gt;         &gt;         &gt;<br>
&gt;         &gt;         &gt;<br>
&gt;         &gt;         &gt;<br>
&gt;         &gt;         &gt;<br>
&gt;         &gt;         &gt;<br>
&gt;         &gt;         _______________________________________________<br>
&gt;         &gt;         &gt;                 gdal-dev mailing list<br>
&gt;         &gt;         &gt;                 <a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
&gt;         &gt;         &gt;<br>
&gt;         &gt;         <a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
&gt;         &gt;         &gt;<br>
&gt;         &gt;         &gt;<br>
&gt;         &gt;         &gt;<br>
&gt;         &gt;         &gt;<br>
&gt;         &gt;         &gt; --<br>
&gt;         &gt;         &gt; Jonathan A. Greenberg, PhD<br>
&gt;         &gt;         &gt; Assistant Project Scientist<br>
&gt;         &gt;         &gt; Center for Spatial Technologies and Remote Sensing<br>
&gt;         (CSTARS)<br>
&gt;         &gt;         &gt; Department of Land, Air and Water Resources<br>
&gt;         &gt;         &gt; University of California, Davis<br>
&gt;         &gt;         &gt; One Shields Avenue<br>
&gt;         &gt;         &gt; Davis, CA 95616<br>
&gt;         &gt;         &gt; Phone: <a href="tel:415-763-5476" value="+14157635476">415-763-5476</a><br>
&gt;         &gt;         &gt; AIM: jgrn307, MSN: <a href="mailto:jgrn307@hotmail.com">jgrn307@hotmail.com</a>, Gchat:<br>
&gt;         jgrn307<br>
&gt;         &gt;         &gt;<br>
&gt;         &gt;         &gt;<br>
&gt;         &gt;         &gt; _______________________________________________<br>
&gt;         &gt;         &gt; gdal-dev mailing list<br>
&gt;         &gt;         &gt; <a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
&gt;         &gt;         &gt; <a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
&gt;         &gt;<br>
&gt;         &gt;<br>
&gt;         &gt;<br>
&gt;         &gt;<br>
&gt;         &gt;<br>
&gt;         &gt;<br>
&gt;         &gt; --<br>
&gt;         &gt; Jonathan A. Greenberg, PhD<br>
&gt;         &gt; Assistant Project Scientist<br>
&gt;         &gt; Center for Spatial Technologies and Remote Sensing (CSTARS)<br>
&gt;         &gt; Department of Land, Air and Water Resources<br>
&gt;         &gt; University of California, Davis<br>
&gt;         &gt; One Shields Avenue<br>
&gt;         &gt; Davis, CA 95616<br>
&gt;         &gt; Phone: <a href="tel:415-763-5476" value="+14157635476">415-763-5476</a><br>
&gt;         &gt; AIM: jgrn307, MSN: <a href="mailto:jgrn307@hotmail.com">jgrn307@hotmail.com</a>, Gchat: jgrn307<br>
&gt;         &gt;<br>
&gt;         &gt;<br>
&gt;         &gt; _______________________________________________<br>
&gt;         &gt; gdal-dev mailing list<br>
&gt;         &gt; <a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
&gt;         &gt; <a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
&gt;<br>
&gt;<br>
&gt;         _______________________________________________<br>
&gt;         gdal-dev mailing list<br>
&gt;         <a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
&gt;         <a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
&gt;<br>
&gt;<br>
<br>
<br>
</div></div></blockquote></div><br>