Astro::Catalog - A generic stellar catalogue object.


NAME

Astro::Catalog - A generic stellar catalogue object.


SYNOPSIS

  $catalog = new Astro::Catalog( Stars   => \@array );
  $catalog = new Astro::Catalog( Cluster => $file_name );


DESCRIPTION

Stores generic meta-data about an astronomical catalogue. Takes a hash with an array refernce as an arguement. The array should contain a list of Astro::Catalog::Star objects. Alternatively it takes a file name of an ARK Cluster format catalogue.


REVISION

$Id: Catalog.pm,v 1.6 2002/03/31 21:39:48 aa Exp $


METHODS

Constructor

new
Create a new instance from a hash of options
  $catalog = new Astro::Catalog( Stars   => \@array );
  $catalog = new Astro::Catalog( Cluster => $file_name );

returns a reference to an Astro::Catalog object.

Output Methods

write_catalog
Will write the catalogue object to an standard ARK Cluster format file
   $status = $catalog->write_catalog( $file_name, \@mags, \@colour );

returns zero on sucess and non-zero if the write failed. Only magnitudes and colours passed in the array will be written to the file, e.g.

   my @mags = ( 'R' );
   my @colour = ( 'B-R', 'B-V' );
   $status = $catalog->write_catalog( $file_name, \@mags, \@colour );

will write a catalogue with R, B-R and B-V.

Accessor Methods

sizeof
Return the number of stars in the catalogue.
   $num = $catalog->sizeof();

pushstar
Push a new star onto the end of the Astro::Catalog object
   $catalog->pushstar( $star );

returns the number of stars now in the Catalog object.

popstar
Pop a star from the end of the Astro::Catalog object
   $star = $catalog->popstar();

the method deletes the star and returns the deleted Astro::Catalog::Star object.

stars
Return a list of all the Astro::Catalog::Star objects stored in the results object.
  @stars = $catalog->stars();

starbyindex
Return the Astro::Catalog::Star object at index $index
   $star = $catalog->starbyindex( $index );

the first star is at index 0 (not 1). Returns undef if no arguements are provided.

fieldcentre
Set the field centre and radius of the catalogue (if appropriate)
     $catalog->fieldcentre( RA     => $ra,
                            Dec    => $dec,
                            Radius => $radius );

get_ra
Return the RA of the catalogue field centre
   $ra = $catalog->get_ra();

get_dec
Return the Dec of the catalogue field centre
   $dec = $catalog->get_dec();

get_radius
Return the radius of the catalogue from the field centre
   $radius = $catalog->get_radius();

General Methods

configure
Configures the object from multiple pieces of information.
  $catalog->configure( %options );

Takes a hash as argument with the list of keywords.

freeze
Method to return a blessed reference to the object so that we can store ths object on disk using Data::Dumper module.

 Astro::Catalog - A generic stellar catalogue object.