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

Home » Public Forums » archive » Re: RANDOMU not very random
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: RANDOMU not very random [message #39868 is a reply to message #39859] Wed, 16 June 2004 15:34 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Ian Chapman writes:

> A colleague and I are working on simulating cosmic glitches in
> interferograms. The way we are trying to accomplish this is assigning
> each point in an interferogram a random number using IDL's RANDOMU.
> Once the random number falls below a specified threshold, we insert a
> cosmic ray.
>
> We originally used an undefined seed to get the random numbers, but we
> quickly discovered that if we ran the routine over and over again, the
> random numbers shifted by 1 position each time. We corrected this by
> defining our seed using the SYSTIME function. Now, however, we find
> that if you run the program a number of times, you see the same
> positions popping up (not in an identifiable pattern, but they show up
> more often than you would expect).
>
> For example, Cosmic rays in ifgm1 appeared at pts 107 and 534. After
> running the program ~20 more times, these same points popped up. This
> seems to happen fairly frequently over long times of many runs.
>
> Is there anything that we can do to introduce more randomness into the
> procedure? Are there any fixes for the IDL random number generators?

Oh, oh. Are you storing the seed somewhere safe between
calls to your program? You should be. :-)

Once set, you shouldn't be changing it if you want
a truly (pseudo) random sequence.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Read Message
Previous Topic: Another contour problem
Next Topic: 3D images

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

Current Time: Sun Oct 12 08:16:29 PDT 2025

Total time taken to generate the page: 7.67595 seconds