#
# Compare to fig 2, of Hogg, D. W., "Distance measures in cosmology",
#   astro-ph/9905116
#

use strict;

use PDL;
use PDL::Graphics::PGPLOT;
use PGPLOT;

use blib;
use PDL::Astro::Cosmology;

# cosmologies - h0 is irrelevant here

my $a = new PDL::Astro::Cosmology { matter =>   1.0, lambda =>  0.0, h0 => 0.0 };
my $b = new PDL::Astro::Cosmology { matter =>  0.05, lambda =>  0.0, h0 => 0.0 };
my $c = new PDL::Astro::Cosmology { matter =>   0.2, lambda =>  0.8, h0 => 0.0 };

# z range
my $z = 0.1 * sequence(51);

# calculate the normalised angular diameter distances
my $d_a = $a->adiam_dist( $z );
my $d_b = $b->adiam_dist( $z );
my $d_c = $c->adiam_dist( $z );

# plot the graph
dev;

env 0, 5, 0, 0.5;
pglabel "redshift z", "angular diameter distance D\\dA\\u/D\\dH\\u", "";

hold;

line $z, $d_a, { LINESTYLE => 'solid' };
line $z, $d_b, { LINESTYLE => 'dotted' };
line $z, $d_c, { LINESTYLE => 'dashed' };

release;

## End of the test
exit;

