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

Home » Public Forums » archive » array manipulation problem
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Array manipulation [message #22372 is a reply to message #22316] Fri, 03 November 2000 20:28 Go to previous messageGo to previous message
majewski is currently offline  majewski
Messages: 15
Registered: March 2000
Junior Member
Thanks Jaco (& everyone else) this works very well for my purposes (much faster than my
for loop stuff).
I'll look into the median aspect latter

leon


On Wed, 1 Nov 2000 17:59:16 -0000, "Jaco van Gorkom" <gorkom@rijnh.nl> wrote:
> <snip>
> For just NaN-correction the code would look
> something like this:
>
> ArrDims = size(InputArr, /dimensions)
> CorrArr = $
> rebin(float(finite(InputArr)), ArrDims[0]/Width, ArrDims[1]/Width)
> InputArr[where(finite(InputArr, /NaN))] = 0
> Average = rebin(InputArr, ArrDims[0]/Width, ArrDims[1]/Width)
> CorrArr[where(CorrArr eq 0.)] = !values.f_nan ; to avoid division by zero
> Average = Average / CorrArr
>
> I don't know if this will still be faster than smart subscripting in a loop,
> it probably depends on the size of the arrays. It also uses somewhat more
> memory. I hope that someone else knows a better solution. It would be best
> for this type of NaN-handling to be a built-in option of IDL-routines like
> rebin, smooth, etc. I would certainly be using it!
> <snip>
> Jaco
>
> ----------------
> Jaco van Gorkom
> FOM-Instituut voor Plasmafysica "Rijnhuizen", The Netherlands
> e-mail: gorkom@rijnh.nl
>
-------------------------
Leon Majewski

Remote Sensing & Satellite Research Group
Curtin University of Technology, Perth, Australia

email: majewski@ses.curtin.edu.au
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: how can I implement arcsinc
Next Topic: Re: MEM spectral analysis

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

Current Time: Fri Oct 10 07:36:46 PDT 2025

Total time taken to generate the page: 2.63951 seconds