comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Rescaling byte (0-200) ndvi to -1 to 1 values
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Rescaling byte (0-200) ndvi to -1 to 1 values [message #80861 is a reply to message #80855] Thu, 19 July 2012 13:13 Go to previous messageGo to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
Hello,

On 07/19/12 15:19, Narnia wrote:
> Thanks a lot, Paul, that makes sense of course but (I'm a real beginner with IDL), I'm still not sure how I would
> implement that as far as calling in the images and declaring that to run and scale all the images in my folder! :(

Well, let's assume you already have a function that reads the image data (I can't help with that one). Let's call it
"read_image" and assume it looks something like:

FUNCTION Read_Image, Filename
...open file...
...read image data...
RETURN, image_data
END

Your scaling function could look like

FUNCTION Scale_Image, Input_Image
output_image = FLOAT(Input_Image)
output_image = (output_image - 100.0) / 100.0
RETURN, output_image
END

Then you can loop over your filenames on the command line

IDL> files = FILE_SEARCH("path/to/data/emodis.filename.*")
IDL> FOR n = 0, N_ELEMENTS(files) DO BEGIN & scaled_image = Scale_Image(Read_Image(files[n])) & ...display... & ENDFOR

?

cheers,

paulv
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Speeding up xy distance calculations using complex numbers
Next Topic: Re: IDL8 plot

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 21:58:14 PDT 2025

Total time taken to generate the page: 0.88273 seconds