[GRASS-dev] G_exp_colors()?

Glynn Clements glynn at gclements.plus.com
Tue Apr 1 08:23:25 EDT 2008


Hamish wrote:

> I am working with MODIS Aqua imagery in HDF4 format. (level 3)
>   http://oceancolor.gsfc.nasa.gov/PRODUCTS/
> 
> The Chlorophyll-a concentration data comes in log form, 0-65535.
> Plotting the data with a bcyr color rules makes it look great.
> 
> I added a mini-tutorial here:
>   http://grass.gdf-hannover.de/wiki/MODIS
> 
> 
> The metadata (available through gdalinfo) gives the formula and test
> points to convert to mg/m^3:
>   r.mapcalc "${map}.chlor_a = 10^(($Slope * $map) + $Intercept)"

> ie a histogram of that starts high and exponentially drops to 0. By 2.0
> there are few data cells left, but real data continues up to the max in
> areas having plankton blooms.
> 
> 
> So how to make nice color rules for that? 'r.colors -g' does the opposite
> of what I want,

Odd. Theoretically, it should do exactly what you want.

> 'r.colors -e' shows some more detail but isn't really
> right. A custom one using 'r.univar precentile=,,,,' cues shows some more
> but isn't smooth and is a pain.
> 
> 
> Any ideas? Could G_log_colors() be turned on its head to make a
> G_exp_colors() function and associated 'r.colors -x' flag? Would it work?

It could be done easily enough, although I'm not sure how useful it
would be.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list