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

NAME

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

SYNOPSIS

  use Astro::Correlate;

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

  $result = $corr->correlate;

DESCRIPTION

Class for cross-correlating astronomical catalogues.

METHODS

CONSTRUCTOR

new

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

catalog1

Return or set the first catalogue used for correlation.

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

Returns an Astro::Catalog object.

catalog2

Return or set the second catalogue used for correlation.

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

Returns an Astro::Catalog object.

cat1magtype

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'.

cat2magtype

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.

keeptemps

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.

messages

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.

method

Retrieve or set the method to be used for correlation.

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

The method is case-sensitive.

temp

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.

timeout

Retrieve or set the timeout.

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

Time is in seconds and defaults to 60.

verbose

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

correlate

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.

REVISION

$Id$

AUTHORS

Brad Cavanagh <brad.cavanagh@gmail.com>

COPYRIGHT

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