Re: Multiply N bands to N numbers [message #54393] |
Tue, 12 June 2007 09:33 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
ali.darvishi@gmail.com writes:
> am always using ENVI and new with IDL.
> I have a problem with hyperspectral data multiplication..
> I want to multiply 200 bands to an ASCII file that contain 200
> separate number, each for any band.
> Does anybody know a function in IDL that can Multiply N bands to N
> numbers at once?.
You might try using the techniques of the Dimensional Juggling
Tutorial:
http://www.dfanning.com/tips/rebin_magic.html
IDL> a = IntArr(2, 4, 2)
IDL> b = [2,4]
IDL> Print, a
0 1 2
3 4 5
6 7 8
9 10 11
12 13 14
15 16 17
18 19 20
21 22 23
IDL> Print, a * Rebin(Reform(b, 1, 1, 2), 3, 4, 2)
0 2 4
6 8 10
12 14 16
18 20 22
48 52 56
60 64 68
72 76 80
84 88 92
Cheers,
David
--
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.")
|
|
|