The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.


Astro::Correlate - Class for cross-correlating astronomical catalogues.


  use Astro::Correlate;

  my $corr = new Astro::Correlate( catalog1 => $cat1,
                                   catalog2 => $cat2,
                                   method => 'FINDOFF' );

  $result = $corr->correlate;


Class for cross-correlating astronomical catalogues.




Create a new instance of an Astro::Correlate object.

  $corr = new Astro::Correlate( catalog1 => $cat1,
                                catalog2 => $cat2 );

The two mandatory named arguments must be defined and must be Astro::Catalog objects. Both catalogs must be comparable -- the Astro::Catalog::Star objects in those catalogs must have x/y or RA/Dec defined, or be able to calculate one from the other using a Starlink::AST FrameSet.

Accessor Methods


Return or set the first catalogue used for correlation.

  my $catalog = $corr->catalog1;
  $corr->catalog1( $catalog );

Returns an Astro::Catalog object.


Return or set the second catalogue used for correlation.

  my $catalog = $corr->catalog2;
  $corr->catalog2( $catalog );

Returns an Astro::Catalog object.


The magnitude type to use for the first catalogue.

  my $magtype = $corr->cat1magtype;
  $corr->cat1magtype( 'mag_iso' );

This is used for Astro::Catalog::Item objects that have Astro::Flux measurements that are not standard magnitudes, and for correlation methods that require a measure of object brightness for optimizations like the RITMatch method. If this is not defined, it will default to 'mag'.


The magnitude type to use for the second catalogue.

  my $magtype = $corr->cat2magtype;
  $corr->cat2magtype( 'mag_iso' );

As for cat1magtype(), but for the second catalogue.


Whether or not to keep temporary files after processing is completed.

  my $keeptemps = $corr->keeptemps;
  $corr->keeptemps( 1 );

Temporary files are created in a temporary directory that is reported during execution. The location of this temporary directory can be controlled using the tempdir method.

This parameter defaults to false, so all temporary files are deleted after processing.


Whether or not to display messages from the correlation task while processing.

  my $messages = $corr->messages;
  $corr->messages( 1 );

If set to true, then messages from the correlation task will be printed.

Defaults to false.


Retrieve or set the method to be used for correlation.

  my $method = $corr->method;
  $corr->method( 'FINDOFF' );

The method is case-sensitive.


Retrieve or set the directory to be used for temporary files.

  my $temp = $corr->temp;
  $corr->temp( '/tmp' );

If undef (which is the default), a temporary directory will be created using File::Temp.


Retrieve or set the timeout.

  my $timeout = $corr->timeout;
  $corr->timeout( 120 );

Time is in seconds and defaults to 60.


Retrieve or set the verbosity level.

  my $verbose = $corr->verbose;
  $corr->verbose( 1 );

If set to true, then much output will be output to STD_ERR. Defaults to false.

General Methods


Cross-correlates two catalogues using the supplied method.

  ( $corrcat1, $corrcat2 ) = $corr->correlate;

This method returns two catalogues, both containing stars that matched in the two catalogues passed to the constructor. The returned catalogues are Astro::Catalog objects, and each matched Astro::Catalog::Star object has the same ID number in either catalogue.




Brad Cavanagh <>


Copyright (C) 2005-2006 Particle Physics and Astronomy Research Council. All Rights Reserved.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place,Suite 330, Boston, MA 02111-1307, USA