Forum: Ruby Cosmological distances with ruby

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Cameron McBride (Guest)
on 2006-04-28 02:49
(Received via mailing list)
I'm doubtful of any interest, but in the odd chance that someone else
might want to play, I'm posting this code.  If someone does look, all
comments are welcome (be it ruby style or corrections)!

Attached is a small library that calculates comological distances
(like light travel time, comoving distances, age of the universe,
angular size of the horizon) given a specific cosmology.  This is
something I threw together for personal use in solving a homework
problem or two and making some quick estimates.  References are
included in the comments for further information.

It requires the ruby GSL bindings (http://rb-gsl.rubyforge.org) for
numerical integration.

The library also includes some sample usage at the end (which is
invoked if the script is just run from the command line).

Cameron

p.s. to interested parties, the science / calculations are pretty well
described by Ned Wright's page:
http://www.astro.ucla.edu/~wright/CosmoCalc.html
John G. (Guest)
on 2006-04-28 06:39
(Received via mailing list)
On 4/27/06, Cameron McBride <removed_email_address@domain.invalid> wrote:
> I'm doubtful of any interest, but in the odd chance that someone else
> might want to play, [snip]
>
> Attached is a small library that calculates comological distances
> [snip]
> It requires the ruby GSL bindings (http://rb-gsl.rubyforge.org) for
> numerical integration.

Neat. Thanks for the link Cameron.

It's interesting that there's two different Ruby bindings to GSL
("Ruby/GSL" and ruby-gsl). Any idea why that is? Sometimes when
there's two projects like this, it turns out that one is more of a
straight wrapper, while the other has been worked a little to have
more of the flavor of the language wrapping it. Is that the case here?
unknown (Guest)
on 2006-04-28 07:33
(Received via mailing list)
On Fri, 28 Apr 2006, John G. wrote:

>
> It's interesting that there's two different Ruby bindings to GSL
> ("Ruby/GSL" and ruby-gsl). Any idea why that is? Sometimes when
> there's two projects like this, it turns out that one is more of a
> straight wrapper, while the other has been worked a little to have
> more of the flavor of the language wrapping it. Is that the case here?

if anyone is interested in playing with the gsl using the
one-click-installer
a pre-compiled version, including narray, is here

   http://www.codeforpeople.com/lib/ruby/rb-gsl-win/

just grab

   http://www.codeforpeople.com/lib/ruby/rb-gsl-win/r...

unpack.  and run 'ruby install.rb'.

cheers.

-a
Cameron McBride (Guest)
on 2006-04-28 15:59
(Received via mailing list)
On 4/27/06, removed_email_address@domain.invalid 
<removed_email_address@domain.invalid> wrote:
> >
>
>    http://www.codeforpeople.com/lib/ruby/rb-gsl-win/
>
> just grab
>
>    http://www.codeforpeople.com/lib/ruby/rb-gsl-win/r...
>
> unpack.  and run 'ruby install.rb'.

Very cool, Ara.  I'll remember that link!

Cameron
Cameron McBride (Guest)
on 2006-04-28 16:54
(Received via mailing list)
On 4/27/06, John G. <removed_email_address@domain.invalid> wrote:
> It's interesting that there's two different Ruby bindings to GSL
> ("Ruby/GSL" and ruby-gsl). Any idea why that is? Sometimes when
> there's two projects like this, it turns out that one is more of a
> straight wrapper, while the other has been worked a little to have
> more of the flavor of the language wrapping it. Is that the case here?

Some might consider that a fair distinction between the two bindings,
although both camps have included code from the other at one point or
another.  IMO, Arno's (http://ruby-gsl.sourceforge.net/) is a bit more
of a straight forward binding whereas Yoshiki added a few things to
round some corners (and hence it's the one I use).  Also, Yoshiki put
a good deal of time into documentation - which is always a good thing!

Cameron
unknown (Guest)
on 2006-04-28 17:22
(Received via mailing list)
On Fri, 28 Apr 2006, Cameron McBride wrote:

> straight forward binding whereas Yoshiki added a few things to round some
> corners (and hence it's the one I use).  Also, Yoshiki put a good deal of
> time into documentation - which is always a good thing!

lastly, yoshiki's versions allows one to intermix narray and gsl
routines
which is really sweet.

cheers.

-a
Daniel N. (Guest)
on 2006-04-28 17:53
(Received via mailing list)
Awesome!  This'll show James Gosling that Ruby's perfectly fine for
interplanetary navigation! :D

On 4/28/06, removed_email_address@domain.invalid 
<removed_email_address@domain.invalid> wrote:
> > although both camps have included code from the other at one point or
> -a
> --
> be kind whenever possible... it is always possible.
> - h.h. the 14th dali lama
>
>


--
-Dan Nugent

Don't Feel Like Typing?  Send me a voicemail:
http://odeo.com/sendmeamessage/DanNugent
This topic is locked and can not be replied to.