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

Home » Public Forums » archive » turn a string value into variable name
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: turn a string value into variable name [message #63270 is a reply to message #63122] Wed, 29 October 2008 08:29 Go to previous messageGo to previous message
loebasboy is currently offline  loebasboy
Messages: 26
Registered: August 2008
Junior Member
On 29 okt, 16:09, David Fanning <n...@dfanning.com> wrote:
> loebasboy writes:
>> To know if my code is good coding I'll explain myself why I want to
>> use this type of coding.
>
>> I want to write function to read data out of a HDF5 file with a
>> certain structure. The HDF5 file consists of a digital aerial image
>> with callibration information per band and such. What I wanted to do
>> is that I want to read in the central wavelength of a band, analyse it
>> and define the name of that band so that I can write the data of the
>> band in a variable with the right name of that band. Lets say that the
>> central wavelength of this band is 752 nm, I would like to write the
>> information of this band in the variable "NIR". So I first read in the
>> central wavelength of a certain band, compare it with a reference
>> value (depends on the sensor), and then write the information of the
>> band in the right named variable. In this way I could do analyses with
>> logical named variables...for instance, the calculation of the NDVI
>> simply becomes (NIR-R)/(NIR+R) in the code.
>
> Well, I think I'll just stand behind my statement. :-)
>
> Cheers,
>
> David
>
> P.S. Wouldn't just using simple variables make your program easier
> to understand!? That's sort of the purpose of variables, to
> stand in for the real thing.
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")- Tekst uit oorspronkelijk bericht niet weergeven -
>
> - Tekst uit oorspronkelijk bericht weergeven -

simple AND logical named variables? ;)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL-python bridge issue for MacOS Sierra 10.12.2 (Library not loaded: libpython2.7.dylib)
Next Topic: Image registration

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

Current Time: Wed Oct 08 17:31:59 PDT 2025

Total time taken to generate the page: 0.00413 seconds