sw0 (version 1.0)


#! /aps/tools/perl/bin/perl  -w

##############################################################################
#
# DESCRIPTION: This is the processing script for Swift.
#
# HISTORY:
# HISTORY: $Log: sw0,v $
# HISTORY: Revision 1.51  2005/03/07 22:39:17  apsop
# HISTORY: Use common code version 4.3
# HISTORY:
# HISTORY: Revision 1.50  2005/02/25 20:41:22  apsop
# HISTORY: New version of common code.
# HISTORY:
# HISTORY:
# HISTORY: Revision 1.48  2005/01/06 16:39:24  apsop
# HISTORY: Comment out UVOTDB module as quick bug fix.
# HISTORY:
# HISTORY: Revision 1.47  2004/12/14 18:19:21  apsop
# HISTORY: New version of common code.
# HISTORY:
# HISTORY: Revision 1.44  2004/11/30 21:22:28  apsop
# HISTORY: Explicitly call SW0Filename, in order to support test pipeline.
# HISTORY:
# HISTORY: Revision 1.43  2004/11/30 03:12:55  apsop
# HISTORY: Use version 4.0 of common code.
# HISTORY:
# HISTORY: Revision 1.42  2004/11/19 22:19:15  apsop
# HISTORY: Fix accidental commit.
# HISTORY:
# HISTORY: Revision 1.38  2004/11/11 22:31:21  apsop
# HISTORY: Put in modules for full BAT event processing.
# HISTORY:
# HISTORY: Revision 1.37  2004/11/10 18:34:56  apsop
# HISTORY: Add in call to BATQmap
# HISTORY:
# HISTORY: Revision 1.36  2004/11/03 02:51:11  apsop
# HISTORY: Fix up mistake in previous version
# HISTORY:
# HISTORY: Revision 1.34  2004/10/13 02:24:46  apsop
# HISTORY: Use com3.9, and include XRTProducts module (commented out for now).
# HISTORY:
# HISTORY: Revision 1.33  2004/09/14 19:06:56  apsop
# HISTORY: Add new SortTdrss module.
# HISTORY:
# HISTORY: Revision 1.32  2004/09/01 14:47:12  apsop
# HISTORY: Switch use lib order of common and sw code.
# HISTORY:
# HISTORY: Revision 1.31  2004/08/30 13:26:37  apsop
# HISTORY: Use com 3.7
# HISTORY:
# HISTORY
# HISTORY: 0.0 -> 1.0 2003-07-09
# HISTORY: The script actually does something now
#
# VERSION: 1.0
#
##############################################################################

use strict;

use lib "/aps/subsys/proc/common/com4.3";
use lib "/aps/subsys/proc/sw/proc1.17.0";

use Util::SW0Filename;
BEGIN {$::FILENAME='Util::SW0Filename'}

use Subs::CheckInput;
use Subs::XrtCoords;
use Subs::UvotCoords;
use Subs::Spacecraft2FITS;
use Subs::BAT2FITS;
use Subs::XRT2FITS;
use Subs::UVOT2FITS;
use Subs::ExtractTiming;
use Subs::ExtractGTIs;
use Subs::Attitude;
use Subs::StartEndTimes;
use Subs::SortTdrss;
use Subs::LocateBurst;
use Subs::BATQmap;
use Subs::BATBurst;
use Subs::BATIntervals;
use Subs::BATSurvey;
use Subs::BATImages;
use Subs::XrtEvents;
use Subs::Filter;
use Subs::XrtImages;
use Subs::UvotImages;
use Subs::XRTProducts;
use Subs::NFILightCurves;
use Subs::BATSpectra;
use Subs::BATLightCurves;
use Subs::Spectra;
use Subs::CalSources;
use Subs::SW0Header;
use Subs::BATFinish;
use Subs::UVOTReport;
use Subs::UVOTDB;
use Subs::XRTReport;
use Subs::SW0WrapUp;


##########################
# PROCESSING STEPS:
##########################

Subs::CheckInput->new()->run();

############################
# convert telemetry to FITS
############################
Subs::Spacecraft2FITS->new()->run();
Subs::BAT2FITS ->new()->run();
Subs::XRT2FITS ->new()->run();
Subs::UVOT2FITS->new()->run();
Subs::ExtractTiming->new()->run();

Subs::ExtractGTIs  ->new()->run();
Subs::Attitude     ->new()->run();
Subs::StartEndTimes->new()->run();

Subs::SortTdrss    ->new()->run();
Subs::LocateBurst  ->new()->run();

#################################
# calibrate the unfiltered files
#################################
Subs::BATQmap      ->new()->run();
Subs::BATBurst     ->new()->run();
Subs::BATIntervals ->new()->run();
Subs::BATImages    ->new()->run();
Subs::BATSpectra   ->new()->run();

Subs::XrtCoords->new()->run();
Subs::XrtEvents->new()->run();

Subs::UvotCoords->new()->run();

############################
# filter the data
###########################
Subs::Filter->new()->run();

##############################
# extract products
##############################
##Subs::BATSurvey->new()->run();

###Subs::XrtImages     ->new()->run();
Subs::UvotImages    ->new()->run();
## Subs::NFILightCurves->new()->run();
## Subs::Spectra    ->new()->run();

###Subs::XRTProducts   ->new()->run();

###############################
# trend products
###############################
## Subs::CalSources->new()->run();

Subs::UVOTReport->new()->run();
Subs::UVOTDB->new()->run();
Subs::XRTReport->new()->run();
Subs::BATFinish->new()->run();

Subs::SW0Header ->new()->run();
Subs::SW0WrapUp ->new()->run();

exit 0;