[GRASS-user] Precipitation color table?

Luigi Ponti lponti at infinito.it
Wed Sep 24 10:17:00 EDT 2008


Hamish wrote:
> [...]
> Luigi Ponti wrote:
>   
>> The SVN conversion script is something I have tried to figure out for
>> a while: great! It always challenges me to find ways to dynamically
>> generate raster color maps.
>>
>> I have understood that the algorithm is able to scale a 0-255 color map
>> to the 0-65535 range; I am not sure how it could be adapted to scale to
>> any range of data. Questions:
>>
>>     
>> [...]

Thanks for the detailed description of your script. It keeps amazing me 
how many things an awk script can do in a couple of lines.

>> The goal would be to develop a script which would take the
>> data range of any raster and scale a 0-255 color rule to it.
>>     
>
> scale 0-255 to 0-100 and add a % sign. r.colors will do the rest.
>
> r=
> g=
> b=
> RULE="`echo $EIGHTBIT | awk '{print $1 / 2.55}'`% $r:$g:$b"
>
>  -> if $EIGHTBIT=255 then $RULE becomes "100% r:g:b"
>
>
>   

Really a good tip -- will implement it right away.

Regards,

Luigi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20080924/293acea6/attachment-0001.html


More information about the grass-user mailing list