Subs::XrtCoords (version $)


package Subs::XrtCoords;
##############################################################################
#
# DESCRIPTION: This subroutine runs the XRT tools delivered in build 1
#
# HISTORY:
# HISTORY: $Log: XrtCoords.pm,v $
# HISTORY: Revision 1.10  2015/05/22 13:59:33  apsop
# HISTORY: Updates for 3.16.08:
# HISTORY: * modify how xrtgrblc and xrtexpomap are run as requested by ASDC.
# HISTORY: * avoid E2 in UVOTReport.pm that occurs when trying to run mgtime without GTI.
# HISTORY: * update calibration clock file to v107.
# HISTORY:
# HISTORY: Revision 1.9  2014/02/28 10:59:59  apsop
# HISTORY: Chooses appropriate attitude file and passes it to event_transforms.
# HISTORY:
# HISTORY: Revision 1.8  2005/11/23 22:35:07  apsop
# HISTORY: Explicity set interpolation param in coordinator, LINEAR by default, CONSTANT for XRT.
# HISTORY:
# HISTORY: Revision 1.7  2005/04/29 15:49:17  apsop
# HISTORY: Set skyxnull, skyynull to -1 for xrt transforms.
# HISTORY:
# HISTORY: Revision 1.6  2004/05/06 20:02:34  dah
# HISTORY: Add version number back into the header comments.
# HISTORY:
# HISTORY: Revision 1.5  2004/04/16 20:21:18  dah
# HISTORY: Begin using embedded history records
# HISTORY:
#
# VERSION: $Revision: 1.10 $
#
##############################################################################


use Subs::Sub;
use Subs::Coordinates;

@ISA = ("Subs::Coordinates");
use strict;

sub new {
    my $proto=shift;
    my $self=$proto->SUPER::new();

    $self->{DESCRIPTION}="Doing XRT coordinate transforms";

    return $self;
}

##################
# METHODS:
##################

sub body {
    my $self = shift;
    my $log  = $self->log();
    my $filename = $self->filename();

    my $attfile = $filename->get('attcorr', 'p');
    my $attflag = undef;
    if (-e $attfile) {
	$log->entry("Got pat attitude file $attfile");
        $attflag = '110';
    } else {
	$log->error(1, "$attfile pat attitude file does not exist, trying sat file");
	$attfile = $filename->get('attitude', 's');
	if (-e $attfile) {
	    $log->entry("Got sat attitude file $attfile");
            $attflag = '100';
	} else {
	    $log->error(1, "Unable to find attitude file, using NONE");
	    $attfile="NONE";
	}
    }


    $self->event_transforms('xrt', ['pc*'], {skyxnull => -1,
					     skyynull => -1,
					     interpolation => 'CONSTANT',
					     attfile => $attfile,
                                             attflag => $attflag} );

} # end of body method