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

Home » Public Forums » archive » I have a problem with ENVI's Band Math Tool and functions written by me.
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
I have a problem with ENVI's Band Math Tool and functions written by me. [message #38083] Thu, 19 February 2004 07:18 Go to next message
wl2776 is currently offline  wl2776
Messages: 13
Registered: February 2004
Junior Member
I have a function:

function xlorofil, b1, b2
if (b2 ne 0) then begin
return, 0.88*(b1/float(b2))^(-2.26)
endif else begin
return, -2
endelse
end

It is situated in the file in save_add directory.
On startup idlde writes that this module was compiled successfully.

When I try to use it in Band Math

xlorofil(b1,b2)

I get a message saying that I have entered an invalid expression.

However command

print, xlorofil(1,2)

executed from the command line of idlde, works fine.

And the expression

xlorofil(b1,2)

is accepted by the Band Math tool.

Where is the problem?
Why cannot I execute my funcion on two image bands?
Re: I have a problem with ENVI's Band Math Tool and functions written by me. [message #38140 is a reply to message #38083] Sun, 22 February 2004 17:16 Go to previous message
tianyf_cn is currently offline  tianyf_cn
Messages: 19
Registered: November 2002
Junior Member
wl2776@yandex.ru (wl) wrote in message news:<1c9e5a19.0402190718.6cd9ec66@posting.google.com>...
> I have a function:
>
> function xlorofil, b1, b2
> if (b2 ne 0) then begin
~~~~~~~~~
ENVI regards it as a variable (not a 2-d array).

I recommend you to use WHERE function to find the subscripts of
nonzero pixels and then perform calculations.

Regard,
Tian.



> return, 0.88*(b1/float(b2))^(-2.26)
> endif else begin
> return, -2
> endelse
> end
>
> It is situated in the file in save_add directory.
> On startup idlde writes that this module was compiled successfully.
>
> When I try to use it in Band Math
>
> xlorofil(b1,b2)
>
> I get a message saying that I have entered an invalid expression.
>
> However command
>
> print, xlorofil(1,2)
>
> executed from the command line of idlde, works fine.
>
> And the expression
>
> xlorofil(b1,2)
>
> is accepted by the Band Math tool.
>
> Where is the problem?
> Why cannot I execute my funcion on two image bands?
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Array string
Next Topic: String composition

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

Current Time: Wed Oct 08 19:53:32 PDT 2025

Total time taken to generate the page: 0.13095 seconds