array summation [message #93441] |
Tue, 19 July 2016 06:45  |
Ali Gamal
Messages: 98 Registered: June 2013
|
Member |
|
|
Hi,
my IDL program as
file='c:\a.sav'
restore,file,/st
V=[12,55,44,88,99]
x=sT[500,1000,15,0] ; it is an image
y=sT[500,1000,15,2] ; it is an image
I want to make
z=SUM(v*[x+y])
I want to result of z array as [500,1000,15,1], How can I do it ?
|
|
|
Re: array summation [message #93442 is a reply to message #93441] |
Tue, 19 July 2016 07:12   |
wlandsman
Messages: 743 Registered: June 2000
|
Senior Member |
|
|
On Tuesday, July 19, 2016 at 9:45:12 AM UTC-4, AGW wrote:
> Hi,
> my IDL program as
>
> file='c:\a.sav'
> restore,file,/st
>
> V=[12,55,44,88,99]
>
> x=sT[500,1000,15,0] ; it is an image
>
> y=sT[500,1000,15,2] ; it is an image
>
> I want to make
>
> z=SUM(v*[x+y])
>
z = total(v*[x+y])
|
|
|
Re: array summation [message #93443 is a reply to message #93441] |
Tue, 19 July 2016 07:34   |
Ali Gamal
Messages: 98 Registered: June 2013
|
Member |
|
|
On Tuesday, July 19, 2016 at 3:45:12 PM UTC+2, AGW wrote:
> Hi,
> my IDL program as
>
> file='c:\a.sav'
> restore,file,/st
>
> V=[12,55,44,88,99]
>
> x=sT[500,1000,15,0] ; it is an image
>
> y=sT[500,1000,15,2] ; it is an image
>
> I want to make
>
> z=SUM(v*[x+y])
>
>
> I want to result of z array as [500,1000,15,1], How can I do it ?
I try it before, It is not true, result of z is one value not array. I want the result as same dimension of input
|
|
|
Re: array summation [message #93444 is a reply to message #93443] |
Tue, 19 July 2016 07:44   |
wlandsman
Messages: 743 Registered: June 2000
|
Senior Member |
|
|
On Tuesday, July 19, 2016 at 10:34:50 AM UTC-4, AGW wrote:
> On Tuesday, July 19, 2016 at 3:45:12 PM UTC+2, AGW wrote:
>> Hi,
>> my IDL program as
>>
>> file='c:\a.sav'
>> restore,file,/st
>>
>> V=[12,55,44,88,99]
>>
>> x=sT[500,1000,15,0] ; it is an image
>>
>> y=sT[500,1000,15,2] ; it is an image
>>
>> I want to make
>>
>> z=SUM(v*[x+y])
>>
>>
>> I want to result of z array as [500,1000,15,1], How can I do it ?
>
> I try it before, It is not true, result of z is one value not array. I want the result as same dimension of input
Your original post was mostly jibberish.
v*[x+y] will be a 4 element array. What do you want to do with this array?
|
|
|
Re: array summation [message #93448 is a reply to message #93441] |
Tue, 19 July 2016 09:46   |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
On Tuesday, July 19, 2016 at 9:45:12 AM UTC-4, AGW wrote:
> Hi,
> my IDL program as
>
> file='c:\a.sav'
> restore,file,/st
>
> V=[12,55,44,88,99]
>
> x=sT[500,1000,15,0] ; it is an image
>
> y=sT[500,1000,15,2] ; it is an image
>
> I want to make
>
> z=SUM(v*[x+y])
>
>
> I want to result of z array as [500,1000,15,1], How can I do it ?
It's not possible with the information you provided.
V is a 5 element vector.
X and Y are single scalar values, not images
The math you describe doesn't make sense with those inputs.
CM
|
|
|
Re: array summation [message #93449 is a reply to message #93441] |
Tue, 19 July 2016 10:41   |
Ali Gamal
Messages: 98 Registered: June 2013
|
Member |
|
|
On Tuesday, July 19, 2016 at 3:45:12 PM UTC+2, AGW wrote:
> Hi,
> my IDL program as
>
> file='c:\a.sav'
> restore,file,/st
>
> V=[12,55,44,88,99]
>
> x=sT[500,1000,15,0] ; it is an image
>
> y=sT[500,1000,15,2] ; it is an image
>
> I want to make
>
> z=SUM(v*[x+y])
>
>
> I want to result of z array as [500,1000,15,1], How can I do it ?
OK, x=sT[0:499,0:999,15,0] & x=sT[0:499,0:999,15,2]
|
|
|
Re: array summation [message #93450 is a reply to message #93449] |
Tue, 19 July 2016 10:59   |
wlandsman
Messages: 743 Registered: June 2000
|
Senior Member |
|
|
On Tuesday, July 19, 2016 at 1:41:07 PM UTC-4, AGW wrote:
> On Tuesday, July 19, 2016 at 3:45:12 PM UTC+2, AGW wrote:
>> Hi,
>> my IDL program as
>>
>> file='c:\a.sav'
>> restore,file,/st
>>
>> V=[12,55,44,88,99]
>>
>> x=sT[500,1000,15,0] ; it is an image
>>
>> y=sT[500,1000,15,2] ; it is an image
>>
>> I want to make
>>
>> z=SUM(v*[x+y])
>>
>>
>> I want to result of z array as [500,1000,15,1], How can I do it ?
>
> OK, x=sT[0:499,0:999,15,0] & x=sT[0:499,0:999,15,2]
OK so it appears that ST is a 4 dimensional array
and now X and Y are 2d images
Now what exactly do you want to do?
>> I want to make
>>
>> z=SUM(v*[x+y])
So you add X and Y to make another 2d image, and then you want to multiply by the 5 element vector v?
|
|
|
Re: array summation [message #93452 is a reply to message #93441] |
Tue, 19 July 2016 13:42   |
Ali Gamal
Messages: 98 Registered: June 2013
|
Member |
|
|
On Tuesday, July 19, 2016 at 3:45:12 PM UTC+2, AGW wrote:
> Hi,
> my IDL program as
>
> file='c:\a.sav'
> restore,file,/st
>
> V=[12,55,44,88,99]
>
> x=sT[500,1000,15,0] ; it is an image
>
> y=sT[500,1000,15,2] ; it is an image
>
> I want to make
>
> z=SUM(v*[x+y])
>
>
> I want to result of z array as [500,1000,15,1], How can I do it ?
OK thank, I will try it
|
|
|
Re: array summation [message #93469 is a reply to message #93441] |
Tue, 26 July 2016 07:35   |
Ali Gamal
Messages: 98 Registered: June 2013
|
Member |
|
|
On Tuesday, July 19, 2016 at 3:45:12 PM UTC+2, AGW wrote:
> Hi,
> my IDL program as
>
> file='c:\a.sav'
> restore,file,/st
>
> V=[12,55,44,88,99]
>
> x=sT[500,1000,15,0] ; it is an image
>
> y=sT[500,1000,15,2] ; it is an image
>
> I want to make
>
> z=SUM(v*[x+y])
>
>
> I want to result of z array as [500,1000,15,1], How can I do it ?
OK, now if x=st[0:499,0:999,0:14,0], I want to print values form 0:14 only, how can I do it
|
|
|
Re: array summation [message #93470 is a reply to message #93469] |
Tue, 26 July 2016 11:20   |
wlandsman
Messages: 743 Registered: June 2000
|
Senior Member |
|
|
On Tuesday, July 26, 2016 at 10:35:14 AM UTC-4, AGW wrote:
> On Tuesday, July 19, 2016 at 3:45:12 PM UTC+2, AGW wrote:
>> Hi,
>> my IDL program as
>>
>> file='c:\a.sav'
>> restore,file,/st
>>
>> V=[12,55,44,88,99]
>>
>> x=sT[500,1000,15,0] ; it is an image
>>
>> y=sT[500,1000,15,2] ; it is an image
>>
>> I want to make
>>
>> z=SUM(v*[x+y])
>>
>>
>> I want to result of z array as [500,1000,15,1], How can I do it ?
>
> OK, now if x=st[0:499,0:999,0:14,0], I want to print values form 0:14 only, how can I do it
Again, we have to guess what you are asking for.
Your array x is dimensioned [500, 1000, 15]
To print the first 15 values in x
IDL> print,x[0:14]
To print the 15 values along the third dimension starting at x[0,0,0]
IDL> print,x[0,0,*]
|
|
|
Re: array summation [message #93471 is a reply to message #93441] |
Tue, 26 July 2016 12:22  |
Ali Gamal
Messages: 98 Registered: June 2013
|
Member |
|
|
On Tuesday, July 19, 2016 at 3:45:12 PM UTC+2, AGW wrote:
> Hi,
> my IDL program as
>
> file='c:\a.sav'
> restore,file,/st
>
> V=[12,55,44,88,99]
>
> x=sT[500,1000,15,0] ; it is an image
>
> y=sT[500,1000,15,2] ; it is an image
>
> I want to make
>
> z=SUM(v*[x+y])
>
>
> I want to result of z array as [500,1000,15,1], How can I do it ?
thanks for your replay
|
|
|