PDL::Astro
----------

A set of PDL routines useful for the (extragalactic) astronomer.

  PDL::Astro::Constants v0.2
    Contains a random selection of constants.
    Perhaps should just use the Astro constants module on CPAN.

  PDL::Astro::Cosmology v0.8
    Calculate distance/time.

Example
-------

 use PDL::Astro::Cosmology;
 use PDL::Astro::Constants qw( PARSEC );

 my $eds = PDL::Astro::Cosmology->new();
 my $sn  = PDL::Astro::Cosmology->new( matter => 0.3, lambda => 0.7,
	h0 => 70 );

 print "$eds\n$sn\n";
 [ Omega_matter = 1  Omega_lambda = 0  H0 = 50 km/s/Mpc ]
 [ Omega_matter = 0.3  Omega_lambda = 0.7  H0 = 70 km/s/Mpc ]
 
 my $z = (1 + sequence(10)) / 10;
 my $de = 1.0e6 * PARSEC * $eds->lum_dist($z);
 my $ds = 1.0e6 * PARSEC * $sn->lum_dist($z);
  
 wcols '%3.1f  %9.3e  %9.3e', $z, $de, $ds;
 0.1  1.894e+25  1.420e+25
 0.2  3.869e+25  3.024e+25
 0.3  5.914e+25  4.791e+25
 0.4  8.022e+25  6.703e+25
 0.5  1.019e+26  8.742e+25
 0.6  1.240e+26  1.089e+26
 0.7  1.466e+26  1.314e+26
 0.8  1.696e+26  1.548e+26
 0.9  1.930e+26  1.790e+26
 1.0  2.168e+26  2.039e+26

Requirements
------------

.) Developed on solaris and linux systems. It should work on other "unix-like"
   systems.
.) Developed using perl v5.6.0, but should work with 5.005.
.) Developed using PDL v 2.1.1cvs, but should work with any recent version.
.) PGPLOT and the PERL interface module to it (for the additional tests in
   Cosmology/cpt/ and Cosmology/hogg).

Build/Installation
------------------

Hopefully just the standard perl way - 'man ExtUtils::MakeMaker' for
customisation hints.

 perl Makefile.PL
 make 
 make test
 make install

Currently the test scripts aren't very clever - you should see 'ok 1'
to 'ok 4' for the Constants script and 'ok 1' to 'ok 13' for the 
Cosmology script.

Additional Tests
----------------

The test scripts aren't very clever; they're good enough to see that it's
basically working but not much else. Additional scripts are included in
the Cosmology/ directory: these produce graphical output (using the PGPLOT
library/module) and aim to be the same as some of the figures in
Carroll, Press & Turner, 1992, ARAA, 30, 499 (directory cpt/) and
Hogg, Distance measures in cosmology, astro-ph/9905116 (directory hogg/).
To run, 'cd Cosmology' and enter, for instance,
perl cpt/angular_diameter.pl

Notes
-----

If you compare the output from 'perl cpt/differential_comoving_volume.pl'
and figure 6 (page 514) of Carroll, Press & Turner, you'll see that my
values are slightly smaller than their values at z ~ 100. I don't know why this
is; I'm hoping that it's just due to numerical differences, but it could be
something wrong with this code. As I don't really work with objects much beyond 
z = 1, it's not currently high on my priority list.

There's also something strange going on with version numbers and the Cosmology
package. It should only worry you if you do something like
'use PDL::Astro::Cosmology 0.6', since this won't work. C'est la vie.

To do
-----

.) Sort out some proper test scripts
.) More functions need to be added to Cosmology. 
.) split into separate modules (remove constants module if possible)

Acknowledgements
----------------

Thanks to Brad Holden for testing.

The cosmology routines make use of code based on routines from

  NUMERICAL METHODS: FORTRAN Programs, (c) John H. Mathews 1994
  NUMERICAL METHODS for Mathematics, Science and Engineering, 2nd Ed, 1992
  Prentice Hall, Englewood Cliffs, New Jersey, 07632, U.S.A.

History
-------

19 July 2001 v0.5, initial "public" release.

Copyright
---------

Copyright (C) Douglas Burke <dburke@cfa.harvard.edu> 1999, 2000, 2001.

All rights reserved. There is no warranty. 
This program is free software; you can redistribute it
and/or modify it under the same terms as Perl itself.

