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

Home » Public Forums » archive » difficulty using "linterp" command - need help making loop to exclude a value yet average others
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: difficulty using "linterp" command - need help making loop to exclude a value yet average others [message #77253 is a reply to message #77160] Sun, 14 August 2011 01:49 Go to previous messageGo to previous message
Nikola is currently offline  Nikola
Messages: 53
Registered: November 2009
Member
It seems like you haven't defined wgrid in the procedure
interpolatedsixteen.pro.

linterp is not a standard idl function. Why not use interpol instead
(for the difference see the header of linterp.pro)?


> Also, in each of our 8 data sets, there is an increment of wavelength
> values where the value of the flux is 0, which will make the average
> of all 8 messed up. Do you have any ideas how to write a loop that
> goes through all of the wgrid values and averages the values of the
> interpolated flux values, but skips the flux values that are 0 and
> continues to the next? Is there a skip command? Would a where command
> work the best?

If you need to find mean of an array excluding elements equal to some
variable x (in your case x = 0) you don't need a loop. Just do

mask = array NE x
y = TOTAL(array*mask)/TOTAL(mask)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: creating a 2D mask for image filtering
Next Topic: Book Business Realities

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

Current Time: Wed Oct 08 19:47:42 PDT 2025

Total time taken to generate the page: 0.00498 seconds