comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » array averaging
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
array averaging [message #67681] Thu, 13 August 2009 01:49
Lasse Clausen is currently offline  Lasse Clausen
Messages: 22
Registered: August 2001
Junior Member
Hi there,

I have particle distribution functions measured by a spacecraft in a
4D array. The dimensions are energy, azimuth, polar angle and time.
This array contains NaNs. I would like to average over, say, all
azimuthal angles such that I get a 3D array. The totalling up is
easily done like so

PSD FLOAT = Array[31, 16, 8, 2693]
tot_azi_psd = TOTAL(psd, 2, /NAN)

However, I need to divide this number by the number of non-NaN values
in each, well, column, row, whatever you like to call it, of azimuths.
I struggle to find an easy way to determine this without looping
through all dimensions. Obviously, I can find the indices of the NaN
using WHERE, but so far that doesn't help me.

Any ideas?

Cheers
Lasse Clausen

PS: The MEAN function has a /NAN switch, but unfortunately no
dimension keyword.
[Message index]
 
Read Message
Previous Topic: River lines out of a DEM with IDL
Next Topic: Re: array averaging

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 13:18:37 PDT 2025

Total time taken to generate the page: 1.75952 seconds