I have a problem with ENVI's Band Math Tool and functions written by me. [message #38083] |
Thu, 19 February 2004 07:18  |
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  |
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?
|
|
|