Averaging values in an array [message #91501] |
Tue, 21 July 2015 09:50  |
wdolan
Messages: 29 Registered: June 2015
|
Junior Member |
|
|
So I've got an array called 'topscans' which is [333,9], so I am looking through 9 different scans, and each scan has 333 spectral points. I want to average each spectral point for the 9 scans. For example I want to average the first spectral point for all 9 runs, then the 2nd, then the third etc. So that in the end I have a set of 333 spectral points which represents an average of all 9 scans.
Thanks for your help!
|
|
|
|
Re: Averaging values in an array [message #91503 is a reply to message #91501] |
Tue, 21 July 2015 09:58   |
wlandsman
Messages: 743 Registered: June 2000
|
Senior Member |
|
|
It sounds like you want
IDL> topscans_avg = mean(topscans,dimension=2)
On Tuesday, July 21, 2015 at 12:50:10 PM UTC-4, Wayana Dolan wrote:
> So I've got an array called 'topscans' which is [333,9], so I am looking through 9 different scans, and each scan has 333 spectral points. I want to average each spectral point for the 9 scans. For example I want to average the first spectral point for all 9 runs, then the 2nd, then the third etc. So that in the end I have a set of 333 spectral points which represents an average of all 9 scans.
>
> Thanks for your help!
|
|
|
Re: Averaging values in an array [message #91505 is a reply to message #91503] |
Wed, 22 July 2015 08:10  |
wdolan
Messages: 29 Registered: June 2015
|
Junior Member |
|
|
Great, thank you, it worked!
On Tuesday, July 21, 2015 at 9:58:48 AM UTC-7, wlandsman wrote:
> It sounds like you want
>
> IDL> topscans_avg = mean(topscans,dimension=2)
>
> On Tuesday, July 21, 2015 at 12:50:10 PM UTC-4, Wayana Dolan wrote:
>> So I've got an array called 'topscans' which is [333,9], so I am looking through 9 different scans, and each scan has 333 spectral points. I want to average each spectral point for the 9 scans. For example I want to average the first spectral point for all 9 runs, then the 2nd, then the third etc. So that in the end I have a set of 333 spectral points which represents an average of all 9 scans.
>>
>> Thanks for your help!
|
|
|