Help with Idl+Envi [message #71738] |
Fri, 16 July 2010 01:42  |
MaxA
Messages: 1 Registered: July 2010
|
Junior Member |
|
|
Hi guys!
I need some help in image processing with IDL and Envi.
I have an image corresponding to the local Moran Index, computed
through envi basic tools.
Its values range from -0.000189 and 0.008413.
When I open this image in envi, it is displayed as a greyscale image
(8bit for each channel rgb).
What I'd like to do is to write an idl procedure that does the same
mapping from floating values to rgb 8 bit.
I'm a bit stucked with that and any help would be precious!
Thanks everybody!
Max
|
|
|
Re: help with idl [message #83182 is a reply to message #71738] |
Thu, 07 February 2013 10:26  |
Brian Daniel
Messages: 80 Registered: July 2009
|
Member |
|
|
On Thursday, February 7, 2013 9:13:36 AM UTC-5, fd_...@mail.com wrote:
> Does anyone know how to create a Toeplitz matrix in idl??
>
>
>
> Best Wishes
>
> Mar
And the Make_Array call is not needed...
|
|
|
Re: help with idl [message #83183 is a reply to message #71738] |
Thu, 07 February 2013 10:26  |
Brian Daniel
Messages: 80 Registered: July 2009
|
Member |
|
|
On Thursday, February 7, 2013 9:13:36 AM UTC-5, fd_...@mail.com wrote:
> Does anyone know how to create a Toeplitz matrix in idl??
>
>
>
> Best Wishes
>
> Mar
DIAG_MATRIX can build this easily.
N=8
OneLine = Indgen(N)+1
a = make_array(N,N)
FOR ii=-N+1, N-1 DO a += Diag_Matrix(Replicate(OneLine[ii],abs(N-abs(ii))),ii)
The abs() business was to allow for lower triangular portion to be filled. I usually use upper triangular matrices.
-B
|
|
|
Re: help with idl [message #83193 is a reply to message #71738] |
Thu, 07 February 2013 06:28  |
Helder Marchetto
Messages: 520 Registered: November 2011
|
Senior Member |
|
|
On Thursday, February 7, 2013 3:26:46 PM UTC+1, Helder wrote:
> On Thursday, February 7, 2013 3:13:36 PM UTC+1, fd_...@mail.com wrote:
>
>> Does anyone know how to create a Toeplitz matrix in idl??
>
>>
>
>>
>
>>
>
>> Best Wishes
>
>>
>
>> Mar
>
>
>
> Well, I'm not sure that this is what you are looking for and I don't think that this is the the "IDL" way, however it does the job:
>
>
>
> IDL> n = 5
>
> IDL> a = make_array(n,n)
>
> IDL> OneLine = findgen(2*n)
>
> IDL> FOR I=0,n-1 DO a[*,I] = (shift(OneLine,I))[0:4]
>
> IDL> print, a
>
> 0.000000 1.00000 2.00000 3.00000 4.00000
>
> 8.00000 0.000000 1.00000 2.00000 3.00000
>
> 7.00000 8.00000 0.000000 1.00000 2.00000
>
> 6.00000 7.00000 8.00000 0.000000 1.00000
>
> 5.00000 6.00000 7.00000 8.00000 0.000000
>
>
>
> Hope it helps.
>
>
>
> Cheers,
>
> h
Oh, yeah, to define the general elements you should edit the definition of OneLine. For instance you could try with:
OneLine = [0.0,1,2,3,4,8,7,6,5]
Cheers,
H
|
|
|
Re: help with idl [message #83194 is a reply to message #71738] |
Thu, 07 February 2013 06:26  |
Helder Marchetto
Messages: 520 Registered: November 2011
|
Senior Member |
|
|
On Thursday, February 7, 2013 3:13:36 PM UTC+1, fd_...@mail.com wrote:
> Does anyone know how to create a Toeplitz matrix in idl??
>
>
>
> Best Wishes
>
> Mar
Well, I'm not sure that this is what you are looking for and I don't think that this is the the "IDL" way, however it does the job:
IDL> n = 5
IDL> a = make_array(n,n)
IDL> OneLine = findgen(2*n)
IDL> FOR I=0,n-1 DO a[*,I] = (shift(OneLine,I))[0:4]
IDL> print, a
0.000000 1.00000 2.00000 3.00000 4.00000
8.00000 0.000000 1.00000 2.00000 3.00000
7.00000 8.00000 0.000000 1.00000 2.00000
6.00000 7.00000 8.00000 0.000000 1.00000
5.00000 6.00000 7.00000 8.00000 0.000000
Hope it helps.
Cheers,
h
|
|
|