[GRASS-dev] GRASS-dev] On i.histo.match (Re: On (Landsat) imagery naming patterns)

Michael Barton Michael.Barton at asu.edu
Thu Aug 1 12:03:56 PDT 2013


So r.recode works, although it seems to have a bug. 

Maybe that is the key to having i.pansharpen work better with a wider range of input values. The user would still need to input the min and max possible range, but it could default to 0 and 255 for 8 bit data.

This changes original values of course. But pan sharpening is not intended to keep the original values. It is to create a visual output. Of course if the visual output looks crummy, that's not good either.

Michael
______________________________
C. Michael Barton 
Director, Center for Social Dynamics & Complexity
Professor of Anthropology, School of Human Evolution & Social Change
Arizona State University
Tempe, AZ  85287-2402
USA

voice: 	480-965-6262 (SHESC), 480-965-8130/727-9746 (CSDC)
fax:          480-965-7671(SHESC), 480-727-0709 (CSDC)
www: 	http://csdc.asu.edu, http://shesc.asu.edu
		http://www.public.asu.edu/~cmbarton

On Aug 1, 2013, at 6:15 AM, Moritz Lennert <mlennert at club.worldonline.be>
 wrote:

> On 01/08/13 14:01, Nikos Alexandris wrote:
>> Moritz:
>>>>>>>> r.rescale is just a frontend to r.reclass. and as such is meant for
>>>>>>>> CELLmaps. It should'nt make a difference whether it is 8-bit or more,
>>>>>>>> though. For DCELL you can try to use r.recode.
>> 
>> Nikos:
>>>>>>> Didn't work also (tried the previous days) -- I can try again.
>> 
>> Moritz:
>>>>>> Please be more precise than "didn't work"...
>> 
>> Nikos:
>>>>> Right, "be more precise" is the key to "freedom" :D.  Indeed, I used to
>>>>> say (either in a "rules" file, or directly using "...<<   EOF"
>> [..]
>>>>> I altered the rules file like
>> 
>>>>> 0.001:1.0:0:255
>> 
>>>>> This works-out!  Now, the recoded image is
>> 
>>>>> r.recode in=Red_ToAR out=Red_ToAR_recoded_255 rules=recode_rules  --o
>>>>> r.stats Red_ToAR_recoded_255
>>>>> 
>>>>>   100%
>>>>> 
>>>>> 5
>>>>> 6
>>>>> 7
>>>>> .
>>>>> ..
>>>>> ...  \
>>>>> ....>   Many values in-between
>>>>> ...  /
>>>>> ..
>>>>> .
>>>>> 195
>>>>> 196
>>>>> 197
>>>>> *
>>>>> 
>>>>> And the histogram looks "nice" as well. I didn't grasp that -- from
>>>>> where
>>>>> should I?  In the manual there is only an example from int to float
>>>>> (however, indeed, instructing 0.1 as the "target" min value).
>> 
>> Moritz:
>>>> There does seem to be a bug in r.recode. Your first rule set should work
>>>> if you set the -d flag. Maybe you can file a ticket ?
>> 
>> Nikos:
>>> Oh man... I need to rest.  The "-d" flag... that's it :-p
>> 
>> On the other hand, even if I would read it (because I did not read carefully
>> the --help before), it reads:
>> 
>> -d   Force output to 'double' raster map type (DCELL)
>> 
>> In this case I have a DCELL Input, recoding in to CELL Output.  How is this
>> related?
> 
> Sorry, you're right. Got mixed up with another problem I had when I tried to recode a 0:2047 image to 0.0:1.0. And even if -d solved my problem there AFAICT it shouldn't be necessary.
> 
> Trying to do too many things at the same time in the last hours before leaving on vacation !!
> 
> Moritz



More information about the grass-dev mailing list