Download

package InstrumentHK;
use strict;
use English;
use Carp;
use vars
  qw(@ISA $VERSION $name $author $date $version @instList $numberOfStreams);
@ISA = qw(Module);
use ModuleResources;

# Declare identity, version, author, date, etc.
$name    = __PACKAGE__;
$VERSION = '2.01';
$version = $VERSION;
$author="Richard West,Dean Hinshaw";
$date="2006-01-25";

#
# ChangeLog
# =========
#
# Version 2.1 - 2006-01-25 (DJF)
# ------------
#
# + The PN instrument team have indicated that hkgtigen can now be used for PN processing. Enabled hkgtigen for PN.
#
# Version 2.0 - 2006-01-18 (DJF)
# ------------
#
# + Amended module header to conform to uniform code layout.
#
# Version 1.10 - 2002-02-04 (DH)
# ------------
#
# + Turn on HK GTI generation for rgs.
#
# Version 1.09 - 2001-06-05 (DH)
# ------------
#
# + Turn off GTI generation for pn.
#
# Version 1.08 - 2001-06-04 (DH)
# ------------
#
# + Turn on GTI generation of epic instruments only.
#
# Version 1.07 - 2001-03-16 (DH)
# ------------
#
# + Print out version number in performAction() for
#   tracking purposes.
#
# Version 1.06 - 2001-01-16 (DH)
# ------------
#
# + Remove ignore rule on number of exposures, as it was
#   redundant and causing unnecessary DB access.
#
# Version 1.05 - 2001-01-10 (DH)
# ------------
#
# + Fix typo.
#
#
# Version 1.04 - 2001-01-10 (DH)
# ------------
#
# + Add ignore rules, and add ExpChooser to start rule.
#
# Version 1.03 - 2000-12-19 (DH)
# ------------
#
# + Turn GTI generation back off.
#
# Version 1.02 - 2000-12-19 (DH)
# ------------
#
# + Turn GTI generation back on.
#
# Version 1.01 - 2000-12-18 (DH)
# ------------
#
# + First production version.
#

# Declare list of instruments this module is interested in
@instList=qw(emos1 emos2 epn om rgs1 rgs2);

# Number of streams
sub numberOfStreams {
    return 1;
}

sub evaluateRules {

    return ignore() if allIgnored(module => 'ExpChooser', 
				 instrument => thisInstrument);

    start() if complete(module => 'MakeCIF', instrument => 'all')
	and allComplete(module => 'ExpChooser', 
		 instrument => thisInstrument);
}

sub performAction {
    info("Module version number: $version");
    #

    if( thisInstrument =~ /^(epn|emos|rgs)/ ){
	my $gtiFile=newFile(class => 'intermediate',
			    instrument => thisInstrument,
			    content => 'HK GTI');

	# Run hkgtigen to generate observation-wide HK GTIs
	#
	doCommand('hkgtigen',
		  instrument => thisInstrument,
		  withgtiset => 'yes',
		  gtiset => $gtiFile)
	    or return exception();
    }

    #
    return success();
}

1;