package Subs::AddGTI2Att;
##############################################################################
#
# DESCRIPTION: This module has he simple functionality of appending
# DESCRIPTION: an extension that contains the GTIsto all existing
# DESCRIPTION: attitude files
#
# HISTORY: $Log: AddGTI2Att.pm,v $
# HISTORY: Revision 1.3 2012/01/12 06:52:03 apsop
# HISTORY: Changes going to proc3.15.03
# HISTORY:
#
# VERSION: 0.0
#
##############################################################################
use Subs::Sub;
use Util::Log;
#@ISA = ("Subs::Sub","Util::Log");
@ISA = ("Subs::Sub");
use strict;
sub new {
my $proto=shift;
my $self=$proto->SUPER::new();
$self->{DESCRIPTION}="Adding GTI\'s to spacecraft attitude file";
return $self;
}
sub body {
my $self=shift;
my $log =$self->log();
my $filename=$self->filename();
my $jobpar =$self->jobpar();
my $sssgti = $filename->get('gti', 's', 'ss');
my $satgti = $filename->get('gti', 's', 'at');
my $attitude = $filename->get('attitude', 's');
if(!-e $sssgti and !-e $satgti){
$log->error(1, "NO GTI file available, unable to add GTI's to attitude file");
return;
}
if(!-e $attitude){
$log->error(1, "Spacecraft attitude file does not exist, unable to add GTI's to file");
return;
}
if(-e $sssgti){
Util::HEAdas->new('ftappend')
->params({
infile => "$sssgti\[GTI\]",
outfile => "$attitude",
})
->run();
}
if(-e $satgti){
Util::HEAdas->new('ftappend')
->params({
infile => "$satgti\[STDGTI\]",
outfile => "$attitude",
})
->run();
}
return;
} # end of body method