comp.lang.idl-pvwave archive - RDF feed
type: channel
description: Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
items: Re: Rescaling byte (0-200) ndvi to -1 to 1 values

Re: Rescaling byte (0-200) ndvi to -1 to 1 values
type: item
description: On 07/19/12 14:18, 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? IDL> value = 150 IDL> help, (value - 100) / 100 <Expression> LONG = 0 IDL> value = 150.0 IDL> help, (value - 100) / 100 <Expression> FLOAT = 0.500000 > > 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... I would write one myself. Mostly since the scaling is just a one-line operation. At least you know you're getting the correct (or wrong) answer that way. :o) cheers, paulv
creator: Paul Van Delst[1]
date: 2012-07-19T18:41:58-00:00

Re: Rescaling byte (0-200) ndvi to -1 to 1 values
type: item
description: 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!
creator: Narnia
date: 2012-07-19T19:19:47-00:00

Re: Rescaling byte (0-200) ndvi to -1 to 1 values
type: item
description: 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
creator: Paul Van Delst[1]
date: 2012-07-19T20:13:32-00:00

Re: Rescaling byte (0-200) ndvi to -1 to 1 values
type: item
description: You're my hero, thank you so much! It's perfect. 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!
creator: Narnia
date: 2012-07-20T13:03:31-00:00

Re: Rescaling byte (0-200) ndvi to -1 to 1 values
type: item
description: 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.")
creator: David Fanning
date: 2012-07-20T13:07:51-00:00

Re: Rescaling byte (0-200) ndvi to -1 to 1 values
type: item
description: 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.")
creator: Narnia
date: 2012-07-20T14:01:15-00:00

Re: Rescaling byte (0-200) ndvi to -1 to 1 values
type: item
description: 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.")
creator: Narnia
date: 2012-07-20T14:05:55-00:00

Re: Rescaling byte (0-200) ndvi to -1 to 1 values
type: item
description: 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
creator: k.shemsu
date: 2013-05-20T12:39:46-00:00