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

Home » Public Forums » archive » Re: selecting radnom number from 2D array
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: selecting radnom number from 2D array [message #75409] Thu, 10 March 2011 08:08 Go to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> Here is more information about points on a sphere:
>
> http://www.idlcoyote.com/code_tips/pts_in_sphere.html

Whoops! Good information there, too, but I meant this
article:

http://www.idlcoyote.com/math_tips/randomsurface.html

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: selecting radnom number from 2D array [message #75410 is a reply to message #75409] Thu, 10 March 2011 08:03 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Paolo writes:

> Please do be careful and recognize that a random point
> on a sphere will not have a uniform distribution of latitudes,
> and a set of point with a uniform distribution of latitudes
> will not be uniform on a sphere.
>
> For instance to obtain the following uniform distributions
>
> www.grigis.ch/spherepoints.png
>
> I had to account for that.

Here is more information about points on a sphere:

http://www.idlcoyote.com/code_tips/pts_in_sphere.html

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: selecting radnom number from 2D array [message #75412 is a reply to message #75410] Thu, 10 March 2011 07:46 Go to previous messageGo to next message
pgrigis is currently offline  pgrigis
Messages: 436
Registered: September 2007
Senior Member
On Mar 9, 7:36 pm, Ashok <ashokrija...@gmail.com> wrote:
> I have 3 sets of two dimensional array. I need to select random 100
> points from each array (same random point i.e. latitude and
> longitude). How can I do that using RANDOMU()? is there any other idea
> to do this?

Please do be careful and recognize that a random point
on a sphere will not have a uniform distribution of latitudes,
and a set of point with a uniform distribution of latitudes
will not be uniform on a sphere.

For instance to obtain the following uniform distributions

www.grigis.ch/spherepoints.png

I had to account for that.

Ciao,
Paolo
Re: selecting radnom number from 2D array [message #75424 is a reply to message #75412] Wed, 09 March 2011 17:09 Go to previous messageGo to next message
Gray is currently offline  Gray
Messages: 253
Registered: February 2010
Senior Member
On Mar 9, 7:36 pm, Ashok <ashokrija...@gmail.com> wrote:
> I have 3 sets of two dimensional array. I need to select random 100
> points from each array (same random point i.e. latitude and
> longitude). How can I do that using RANDOMU()? is there any other idea
> to do this?

http://www.idlcoyote.com/code_tips/randomindex.html
Re: selecting radnom number from 2D array [message #75505 is a reply to message #75424] Thu, 10 March 2011 14:57 Go to previous message
Ashok is currently offline  Ashok
Messages: 5
Registered: April 2010
Junior Member
On Mar 9, 7:09 pm, Gray <grayliketheco...@gmail.com> wrote:
> On Mar 9, 7:36 pm, Ashok <ashokrija...@gmail.com> wrote:
>
>> I have 3 sets of two dimensional array. I need to select random 100
>> points from each array (same random point i.e. latitude and
>> longitude). How can I do that using RANDOMU()? is there any other idea
>> to do this?
>
> http://www.idlcoyote.com/code_tips/randomindex.html

Thank you, that is something helpful.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Merging Postcript files
Next Topic: latitude and longitude form geotiff file

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

Current Time: Wed Oct 08 11:45:16 PDT 2025

Total time taken to generate the page: 0.00591 seconds