Re: Rescaling byte (0-200) ndvi to -1 to 1 values [message #80852] |
Fri, 20 July 2012 07:01  |
Narnia
Messages: 5 Registered: July 2012
|
Junior Member |
|
|
Well, Dr. Coyote, you're the untouchable hero, I've drooling over your website quite a bit :P
On Friday, July 20, 2012 4:07:51 PM UTC+3, David Fanning wrote:
> Narnia writes:
>
> > You're my hero, thank you so much! It's perfect.
>
> Geez, I might start answering questions again!
>
> Cheers,
>
> David
>
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: Rescaling byte (0-200) ndvi to -1 to 1 values [message #80853 is a reply to message #80852] |
Fri, 20 July 2012 07:05   |
Narnia
Messages: 5 Registered: July 2012
|
Junior Member |
|
|
That would be a good idea, Dr. Coyote; I've been 'drooling' over your website quite a bit :)
On Friday, July 20, 2012 4:07:51 PM UTC+3, David Fanning wrote:
> Narnia writes:
>
> > You're my hero, thank you so much! It's perfect.
>
> Geez, I might start answering questions again!
>
> Cheers,
>
> David
>
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
|
|
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   |
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
|
|
|
Re: Rescaling byte (0-200) ndvi to -1 to 1 values [message #80863 is a reply to message #80861] |
Thu, 19 July 2012 12:19   |
Narnia
Messages: 5 Registered: July 2012
|
Junior Member |
|
|
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! :(
On Thursday, July 19, 2012 9:18:39 PM UTC+3, Narnia wrote:
> I'm using the eMODIS 10-day product from the USGS with this description: "MODIS NDVI data are stretched (mapped) linearly (to byte values) as follows:
> [-1.0, 1.0] -> [0, 200]
> Invalid Values: 201 - 255
>
> NDVI = (value – 100) / 100; example: [ (150 – 100) / 100 = 0.5 NDVI ]"
>
> I am trying thus to scale the data in ENVI just using Band Math [expression:((b1-100)/100)] and all the values I get are 0 across my entire image. Any thoughts as to why?
>
> Secondly, I need to do this for over 400 images; can someone suggest a quick script that can read and scale this data in IDL? I tried 'ScaledImage' but i keep getting errors as well...
>
> Thank you so much!
|
|
|
|
Re: Rescaling byte (0-200) ndvi to -1 to 1 values [message #84534 is a reply to message #80861] |
Mon, 20 May 2013 05:39  |
k.shemsu
Messages: 1 Registered: May 2013
|
Junior Member |
|
|
On Thursday, July 19, 2012 11:13:32 PM UTC+3, Paul van Delst wrote:
> 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
Hi Paul,
I have seen your suggestion, but I don't work in IDL. Can you tell me this process in ArcGIS? Thank you in advance for your kind support. KS
|
|
|