Astro::Catalog::Item::Morphology - Information about a star's morphology.


Astro-Catalog documentation Contained in the Astro-Catalog distribution.

Index


Code Index:

NAME

Top

Astro::Catalog::Item::Morphology - Information about a star's morphology.

SYNOPSIS

Top

  $morphology = new Astro::Catalog::Item::Morphology( );

DESCRIPTION

Top

Stores information about an astronomical object's morphology.

METHODS

Top

Constructor

new

Create a new instance of an Astro::Catalog::Item::Morphology object.

$morphology = new Astro::Catalog::Item::Morphology( );

This method returns a reference to an Astro::Catalog::Item::Morphology object.

Accessor Methods

ellipticity

The ellipticity of the object.

position_angle_pixel

Position angle using the pixel frame as a reference. Measured counter- clockwise from the positive x axis.

position_angle_world

Position angle using the world coordinate system as a reference. Measured east of north.

major_axis_pixel

Length of the semi-major axis in units of pixels.

minor_axis_pixel

Length of the semi-minor axis in units of pixels.

major_axis_world

Length of the semi-major axis in units of degrees.

minor_axis_world

Length of the semi-minor axis in units of degrees.

area

Area of the object, usually by using isophotal techniques, in square pixels.

PRIVATE METHODS

Top

_configure

Configure the object.

REVISION

Top

 $Id: Morphology.pm,v 1.3 2005/10/25 01:22:29 cavanagh Exp $

COPYRIGHT

Top

AUTHORS

Top

Brad Cavanagh <b.cavanagh@jach.hawaii.edu>


Astro-Catalog documentation Contained in the Astro-Catalog distribution.
package Astro::Catalog::Item::Morphology;

use 5.006;
use strict;
use warnings;
use vars qw/ $VERSION /;
use Carp;

use Number::Uncertainty;

use warnings::register;

'$Revision: 1.3 $ ' =~ /.*:\s(.*)\s\$/ && ($VERSION = $1);

sub new {
  my $proto = shift;
  my $class = ref( $proto ) || $proto;

  # Retrieve the arguments.
  my %args = @_;

  # Create the object.
  my $obj = bless {}, $class;

  # Configure the object.
  $obj->_configure( %args );

  # And return it.
  return $obj;
}

sub ellipticity {
  my $self = shift;
  if( @_ ) {
    my $ell = shift;
    if( defined( $ell ) &&
        ! UNIVERSAL::isa( $ell, "Number::Uncertainty" ) ) {
      $ell = new Number::Uncertainty( Value => $ell );
    }
    $self->{ELLIPTICITY} = $ell;
  }
  return $self->{ELLIPTICITY};
}

sub position_angle_pixel {
  my $self = shift;
  if( @_ ) {
    my $ang = shift;
    if( defined( $ang ) &&
        ! UNIVERSAL::isa( $ang, "Number::Uncertainty" ) ) {
      $ang = new Number::Uncertainty( Value => $ang );
    }
    $self->{POSITION_ANGLE_PIXEL} = $ang;
  }
  return $self->{POSITION_ANGLE_PIXEL};
}

sub position_angle_world {
  my $self = shift;
  if( @_ ) {
    my $ang = shift;
    if( defined( $ang ) &&
        ! UNIVERSAL::isa( $ang, "Number::Uncertainty" ) ) {
      $ang = new Number::Uncertainty( Value => $ang );
    }
    $self->{POSITION_ANGLE_WORLD} = $ang;
  }
  return $self->{POSITION_ANGLE_WORLD};
}

sub major_axis_pixel {
  my $self = shift;
  if( @_ ) {
    my $axis = shift;
    if( defined( $axis ) &&
        ! UNIVERSAL::isa( $axis, "Number::Uncertainty" ) ) {
      $axis = new Number::Uncertainty( Value => $axis );
    }
    $self->{MAJOR_AXIS_PIXEL} = $axis;
  }
  return $self->{MAJOR_AXIS_PIXEL};
}

sub minor_axis_pixel {
  my $self = shift;
  if( @_ ) {
    my $axis = shift;
    if( defined( $axis ) &&
        ! UNIVERSAL::isa( $axis, "Number::Uncertainty" ) ) {
      $axis = new Number::Uncertainty( Value => $axis );
    }
    $self->{MINOR_AXIS_PIXEL} = $axis;
  }
  return $self->{MINOR_AXIS_PIXEL};
}

sub major_axis_world {
  my $self = shift;
  if( @_ ) {
    my $axis = shift;
    if( defined( $axis ) &&
        ! UNIVERSAL::isa( $axis, "Number::Uncertainty" ) ) {
      $axis = new Number::Uncertainty( Value => $axis );
    }
    $self->{MAJOR_AXIS_WORLD} = $axis;
  }
  return $self->{MAJOR_AXIS_WORLD};
}

sub minor_axis_world {
  my $self = shift;
  if( @_ ) {
    my $axis = shift;
    if( defined( $axis ) &&
        ! UNIVERSAL::isa( $axis, "Number::Uncertainty" ) ) {
      $axis = new Number::Uncertainty( Value => $axis );
    }
    $self->{MINOR_AXIS_WORLD} = $axis;
  }
  return $self->{MINOR_AXIS_WORLD};
}

sub area {
  my $self = shift;
  if( @_ ) {
    my $area = shift;
    if( defined( $area ) &&
        ! UNIVERSAL::isa( $area, "Number::Uncertainty" ) ) {
      $area = new Number::Uncertainty( Value => $area );
    }
    $self->{AREA} = $area;
  }
  return $self->{AREA};
}

sub _configure {
  my $self = shift;

  my %args = @_;
  foreach my $key ( keys %args ) {
    if( $self->can( lc( $key ) ) ) {
      my $method = lc $key;
      $self->$method( $args{$key} );
    }
  }
}

1;