package Astro::Catalog::Item::Morphology; =head1 NAME Astro::Catalog::Item::Morphology - Information about a star's morphology. =head1 SYNOPSIS $morphology = new Astro::Catalog::Item::Morphology( ); =head1 DESCRIPTION Stores information about an astronomical object's morphology. =cut 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); =head1 METHODS =head2 Constructor =over 4 =item B Create a new instance of an C object. $morphology = new Astro::Catalog::Item::Morphology( ); This method returns a reference to an C object. =cut 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; } =back =head2 Accessor Methods =over 4 =item B The ellipticity of the object. =cut 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}; } =item B Position angle using the pixel frame as a reference. Measured counter- clockwise from the positive x axis. =cut 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}; } =item B Position angle using the world coordinate system as a reference. Measured east of north. =cut 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}; } =item B Length of the semi-major axis in units of pixels. =cut 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}; } =item B Length of the semi-minor axis in units of pixels. =cut 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}; } =item B Length of the semi-major axis in units of degrees. =cut 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}; } =item B Length of the semi-minor axis in units of degrees. =cut 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}; } =item B Area of the object, usually by using isophotal techniques, in square pixels. =cut 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}; } =back =head1 PRIVATE METHODS =over 4 =item B<_configure> Configure the object. =cut 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} ); } } } =head1 REVISION $Id: Morphology.pm,v 1.3 2005/10/25 01:22:29 cavanagh Exp $ =head1 COPYRIGHT Copyright (C) 2004 Particle Physics and Astronomy Research Council. All Rights Reserved. =head1 AUTHORS Brad Cavanagh Eb.cavanagh@jach.hawaii.eduE =cut 1;