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

Home » Public Forums » archive » Most Common IDL Programming Errors
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: Most Common IDL Programming Errors [message #59811 is a reply to message #59761] Wed, 09 April 2008 19:18 Go to previous messageGo to previous message
Tom McGlynn is currently offline  Tom McGlynn
Messages: 13
Registered: January 2008
Junior Member
One problem that I used to make all the time was to assume that WHERE
returned a match, e.g.,

w = where(x gt 0)
x[w] = alog10(x[w])

neglecting the case where the x are all negative. My programs would
always work when I tested them, and then I'd find they failed when I
tried them in the real world. The need to check finally got beaten
into me.

Another is fogetting the inherently parallel nature of array
operations, e.g., something like expecting

x=[0,1,1,2,2,2]
y=indgen(3)

y[x] = y[x]+1

to give something other than 1,1,1.

Regards,
Tom McGlynn
[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
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: hdf conversion
Next Topic: Re: Passing variables between procedures

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

Current Time: Wed Oct 08 19:37:01 PDT 2025

Total time taken to generate the page: 0.00519 seconds