astro.fits
Class Icat

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by astro.fits.Icat
All Implemented Interfaces:
Cloneable, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying
Direct Known Subclasses:
IcatFinalize, IcatJoin, IcatMaster, IcatPrepare, IcatSearch

public class Icat
extends PropertyBundles

Base class for icat preparation, joining, and finishing. Provides necessarry path for all of the icat subobjects. The following file name appendices are created or interpreted by ICAT:


Nested Class Summary
static class Icat.Compress
          Compresses a list of files.
static class Icat.Snoop
          Snoops into the save-file and print its content.
static class Icat.Uncompress
          Uncompresses a list of files.
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
static String BIASCOMBINED
           
static String DATAEXTENSION
          Data file extension.
private static String DEFANALYSISPAR
          The location of the analysis-parameter file.
private static String DEFANALYSISPARNO
          The location of the analysis-parameter file.
private static String DEFANALYSISPARYES
          The location of the analysis-parameter file.
private static String DEFARCHIVE
          Start of directory tree of archive.
private static String DEFCALIBPAR
          The location of the calibration-parameter file.
private static String DEFCALIBPARDARK
          The location of the calibration-parameter file for dark reduction.
private static String DEFCALIBPARNODARK
          The location of the calibration-parameter file for no dark reduction.
private static String DEFCALIBPARSKIP
          The location of the calibration-parameter file.
private static String DEFDATEKEY
          The default key-name for the date of the observation.
private static String DEFEXPOSUREKEY
          The default key-name for the exposure time of the observation.
private static String DEFFILTERKEY
          The default key-name for the filter of the observation.
static String DEFFROM
          The default from address.
private static String DEFICATDIR
          The main root directory where ICAT resides.
private static String DEFICATIN
          The default input directory.
private static String DEFIMAGETYPEKEY
          The default key-name for the type of the observation.
private static String DEFIMCOPY
          Default path to imcopy.
private static String DEFIMCOPYFLAG
          Default extension for compress.
private static String DEFLOCALFITS
          Directory where the compressed files are stored for transfer.
private static String DEFLOCALTMP
          Directory where the compressed files are stored for transfer.
private static String DEFMODEANALYSE
          The location of the mode-parameter file.
private static String DEFMODEPAR
          The location of the mode-parameter file.
private static String DEFPASSWORD
          Default password name.
private static String DEFREDUCED
          Start of directory tree of archive.
private static String DEFREDUCEDONE
          All successfully and complete reduced dirs go into here.
private static String DEFREPLACEFROM
          Replace archive.
private static String DEFREPLACETO
          Replace archive with reduced.
private static String DEFSERIALIZE
          The default serialization file of the lookup table
private static String DEFSMTPHOST
          The default smtphost.
private static int DEFSMTPPORT
          The default port.
private static String DEFTO
           
private static String DEFUSERNAME
          Default user name.
private static boolean DEFUSESSL
          Default we use ssl.
private  Mailer email
          Mailer instance.
static NumberFormat EXPTIME
          How we format the exposure time part of the file name.
protected static String FE
          Shortcut
static String FLATHEADBIAS
           
static String FLATHEADDARK
           
static String FLATMASTERBIAS
           
static String FLATMASTERDARK
           
static String FLATMASTERSIGMA
           
static NumberFormat INDEXCAL
          How we format the running number part of the file name, calibration.
static NumberFormat INDEXSCI
          How we format the running number part of the file name, science.
private  File input
          The mian ICAT input directory, exisitng, readable and writeable.
static String INPUTBIAS
          The input bias image appendix.
static String INPUTDARK
          The input dark image appendix.
static String INPUTFLATPART
          The input flat image name appendix without the filter name.
static String KEY_ANALYSISPAR
          The location of the analysis-parameter file.
static String KEY_ANALYSISPARNO
          The location of the analysis-parameter file.
static String KEY_ANALYSISPARYES
          The location of the analysis-parameter file.
static String KEY_ARCHIVE
          Path to the main archive dir.
static String KEY_CALIBPAR
          The location of the calibration-parameter file.
static String KEY_CALIBPARDARK
          The location of the calibration-parameter file for dark reduction.
static String KEY_CALIBPARNODARK
          The location of the calibration-parameter file for no dark reduction.
static String KEY_CALIBPARSKIP
          The location of the calibration-parameter file for skipping calib.
static String KEY_DATEKEY
          This is the fits header key holding date of observation.
static String KEY_EXPOSUREKEY
          This is the fits header key holding exposure time of observation.
static String KEY_FILTERKEY
          This is the fits header key holding the filter name.
static String KEY_FROM
          Address of the sender, with or without domain.
static String KEY_ICATDIR
          The main root directory where ICAT resides.
static String KEY_ICATIN
          The main root directory where ICAT expect files.
static String KEY_IMAGETYPEKEY
          This is the fits header key designating the type of the image.
static String KEY_IMCOPY
          The path to the imcopy external program.
static String KEY_IMCOPYFLAG
          The thing to append to the target fits for imcopy.
static String KEY_LOCALFITS
          A re-useable file name for decompressed fits.
static String KEY_LOCALTMP
          Directory where the compressed files are stored for transfer.
static String KEY_MODEANALYSE
          The location of the mode file holding just analyse request.
static String KEY_MODEPAR
          The location of the mode par file.
static String KEY_REDUCED
          Path to the main reduced dir.
static String KEY_REDUCEDONE
          Path to the main reduced dir.
static String KEY_REPLACEFROM
          The src-part of the path that should be replaced in the final .
static String KEY_REPLACETO
          The src-part of the path is replaced with this .
static String KEY_SERIALIZE
          Where we serialize our lookup tables from one step to another.
static String KEY_TO
          Address list of the recipients, to-type.
protected  Map<File,String> lookbias
          The same for calibration images, bias.
protected  Map<File,String> lookdark
          The same for calibration images, dark.
protected  Map<File,String> lookflat
          The same for calibration images, flat.
protected  Map<File,String> lookup
          For later reconstruction, we have to record the lookup to orignal.
private  File main
          The main ICAT directory, exisitng, readable and writeable.
static String OUT
          The file-name part for output directories per quadrant.
static String OUTBDSFLAT
          Calibration images, bias dark and shutter corrected if applicable.
static String OUTBIAS
          Calibration images, bias corrected if applicable.
static String OUTBSFLAT
          Calibration images, bias and shutter corrected if applicable.
static String PHOTOMETRYASC
          The ascii file produced by sextractor.
static String[] QUADRANTS
          The names of the quadrant, also the names of the sub-dirs created.
static String SCIENCEBDFLAT
          The bias, dark, flat and shutter corrected science image appendix.
static String SCIENCEBFLAT
          The bias, flat and shutter corrected science image appendix.
static String SCIENCEBIAS
          The bias corrected science image appendix.
static String SCIENCEDARK
          The bias and dark corrected science image appendix.
static String SCIENCEFINAL
          The final science image solution appendix.
static String SCIENCERAW
          The raw science image appendix.
static String SCIENCETEMP
          The temporal science image solution appendix.
static Format YYYYMMDD
          How we create a file name from the observation date.
 
Fields inherited from class util.PropertyBundles
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES
 
Fields inherited from class util.PropertyResources
KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset
 
Fields inherited from class util.PropertyContainer
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR
 
Fields inherited from interface util.ResourceSupplying
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Fields inherited from interface util.PropertySupplying
CONFIG, KEY_CLASS
 
Constructor Summary
Icat(Map<String,String> prop)
          Defaults keys.
 
Method Summary
protected static void addExtension(List<String> aug, Collection<String> with, String ext)
          Adds the requested extension to all the string in the list.
protected  boolean compress(File src, File dest)
          Uses imcopy [compress] to compress a fits file from the original path to the destination path.
private  int execute(String exe, long timeout)
          Uses the given executable command line string and executes that with a specified timeout.
 String getIcatInputExtension(String typestr)
          From the type of the fits file get the icat extension, which is '.fits' for all calibration files and '_imr.fits' for science input files.
 String getIcatName(String typestr, String filter, Date expstart, double texp, int nr)
          Returns the standard icat name from the given type, observational filter, the time of the exposure start, the exposure time in ms and a running number.
 String getIcatOutputExtension(String typestr)
          From the type of the fits file get the icat extension, which is '.fits' for all calibration files and '_imc.fits' for science input files.
 File getInput()
          Returns the main icat input directory.
 File getMain()
          Returns the main ICAT directory.
 File getOutput()
          Returns the main icat input directory.
 File getQuadrantInput(int q0)
          Returns the icat input directory for a specified quadrant.
 File getQuadrantOutput(int q0)
          Returns the icat output directory per quadrant, where the first reduction step, the flat-field calibrated science images, are stored on a per-quadrant basis.
 File getSerializeFile()
          Returns a inter-process serialization file for permanent storage.
 void init()
          We check for the main directory and create the necessarry input and output dirs if they do not exist, or purge them otherwise.
private  char lookupFilterChar(String filter)
           
protected  File reducedDir(File src)
          From the src-path DIR we get to the reduced path, creating any missing directories on the way.
protected  int restoreLookup()
          Restores the lookup tables from the serialization file.
protected  void saveLookup()
          Stores the lookup tables in the serialization file.
 boolean sendMail(String subject, String text)
          Sends mail to the default user.
protected  boolean uncompress(File src, File dest)
          Uses imcopy [compress] to compress a fits file from the original path to the destination path.See Error codes Because imcopy tends to fail for unknown reasons (error code 106), but on perfectly uncompressable files, we loop on this process at max 3 times.
 
Methods inherited from class util.PropertyBundles
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource
 
Methods inherited from class util.PropertyResources
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, keyCreate, keyCreate, reload, setApplet
 
Methods inherited from class util.PropertyContainer
augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, reload, removeProperty, rescanned, setObject, setProperties, setProperty, stringProperties, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface util.ResourceSupplying
getResource, getResourceAsStream, getResources
 
Methods inherited from interface util.PropertySupplying
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties
 

Field Detail

YYYYMMDD

public static final Format YYYYMMDD
How we create a file name from the observation date.


INDEXSCI

public static final NumberFormat INDEXSCI
How we format the running number part of the file name, science.


INDEXCAL

public static final NumberFormat INDEXCAL
How we format the running number part of the file name, calibration.


EXPTIME

public static final NumberFormat EXPTIME
How we format the exposure time part of the file name.


SCIENCERAW

public static final String SCIENCERAW
The raw science image appendix.

See Also:
Constant Field Values

SCIENCEBIAS

public static final String SCIENCEBIAS
The bias corrected science image appendix.

See Also:
Constant Field Values

SCIENCEDARK

public static final String SCIENCEDARK
The bias and dark corrected science image appendix.

See Also:
Constant Field Values

SCIENCEBDFLAT

public static final String SCIENCEBDFLAT
The bias, dark, flat and shutter corrected science image appendix.

See Also:
Constant Field Values

SCIENCEBFLAT

public static final String SCIENCEBFLAT
The bias, flat and shutter corrected science image appendix.

See Also:
Constant Field Values

SCIENCETEMP

public static final String SCIENCETEMP
The temporal science image solution appendix.

See Also:
Constant Field Values

SCIENCEFINAL

public static final String SCIENCEFINAL
The final science image solution appendix.

See Also:
Constant Field Values

PHOTOMETRYASC

public static final String PHOTOMETRYASC
The ascii file produced by sextractor.

See Also:
Constant Field Values

INPUTBIAS

public static final String INPUTBIAS
The input bias image appendix.

See Also:
Constant Field Values

INPUTDARK

public static final String INPUTDARK
The input dark image appendix.

See Also:
Constant Field Values

INPUTFLATPART

public static final String INPUTFLATPART
The input flat image name appendix without the filter name.

See Also:
Constant Field Values

OUTBIAS

public static final String OUTBIAS
Calibration images, bias corrected if applicable.

See Also:
Constant Field Values

OUTBSFLAT

public static final String OUTBSFLAT
Calibration images, bias and shutter corrected if applicable.

See Also:
Constant Field Values

OUTBDSFLAT

public static final String OUTBDSFLAT
Calibration images, bias dark and shutter corrected if applicable.

See Also:
Constant Field Values

FLATMASTERDARK

public static final String FLATMASTERDARK
See Also:
Constant Field Values

FLATMASTERBIAS

public static final String FLATMASTERBIAS
See Also:
Constant Field Values

FLATMASTERSIGMA

public static final String FLATMASTERSIGMA
See Also:
Constant Field Values

FLATHEADDARK

public static final String FLATHEADDARK
See Also:
Constant Field Values

FLATHEADBIAS

public static final String FLATHEADBIAS
See Also:
Constant Field Values

BIASCOMBINED

public static final String BIASCOMBINED
See Also:
Constant Field Values

FE

protected static final String FE
Shortcut

See Also:
Constant Field Values

DATAEXTENSION

public static final String DATAEXTENSION
Data file extension.

See Also:
Constant Field Values

QUADRANTS

public static final String[] QUADRANTS
The names of the quadrant, also the names of the sub-dirs created.


OUT

public static final String OUT
The file-name part for output directories per quadrant.

See Also:
Constant Field Values

KEY_ICATDIR

public static final String KEY_ICATDIR
The main root directory where ICAT resides.

See Also:
Constant Field Values

KEY_MODEPAR

public static final String KEY_MODEPAR
The location of the mode par file.

See Also:
Constant Field Values

KEY_MODEANALYSE

public static final String KEY_MODEANALYSE
The location of the mode file holding just analyse request.

See Also:
Constant Field Values

KEY_CALIBPAR

public static final String KEY_CALIBPAR
The location of the calibration-parameter file.

See Also:
Constant Field Values

KEY_CALIBPARSKIP

public static final String KEY_CALIBPARSKIP
The location of the calibration-parameter file for skipping calib.

See Also:
Constant Field Values

KEY_CALIBPARDARK

public static final String KEY_CALIBPARDARK
The location of the calibration-parameter file for dark reduction.

See Also:
Constant Field Values

KEY_CALIBPARNODARK

public static final String KEY_CALIBPARNODARK
The location of the calibration-parameter file for no dark reduction.

See Also:
Constant Field Values

KEY_ANALYSISPAR

public static final String KEY_ANALYSISPAR
The location of the analysis-parameter file.

See Also:
Constant Field Values

KEY_ANALYSISPARNO

public static final String KEY_ANALYSISPARNO
The location of the analysis-parameter file.

See Also:
Constant Field Values

KEY_ANALYSISPARYES

public static final String KEY_ANALYSISPARYES
The location of the analysis-parameter file.

See Also:
Constant Field Values

KEY_ICATIN

public static final String KEY_ICATIN
The main root directory where ICAT expect files.

See Also:
Constant Field Values

KEY_SERIALIZE

public static final String KEY_SERIALIZE
Where we serialize our lookup tables from one step to another.

See Also:
Constant Field Values

KEY_IMCOPY

public static final String KEY_IMCOPY
The path to the imcopy external program.

See Also:
Constant Field Values

KEY_IMCOPYFLAG

public static final String KEY_IMCOPYFLAG
The thing to append to the target fits for imcopy.

See Also:
Constant Field Values

KEY_LOCALTMP

public static final String KEY_LOCALTMP
Directory where the compressed files are stored for transfer.

See Also:
Constant Field Values

KEY_LOCALFITS

public static final String KEY_LOCALFITS
A re-useable file name for decompressed fits.

See Also:
Constant Field Values

KEY_DATEKEY

public static final String KEY_DATEKEY
This is the fits header key holding date of observation.

See Also:
Constant Field Values

KEY_EXPOSUREKEY

public static final String KEY_EXPOSUREKEY
This is the fits header key holding exposure time of observation.

See Also:
Constant Field Values

KEY_FILTERKEY

public static final String KEY_FILTERKEY
This is the fits header key holding the filter name.

See Also:
Constant Field Values

KEY_IMAGETYPEKEY

public static final String KEY_IMAGETYPEKEY
This is the fits header key designating the type of the image.

See Also:
Constant Field Values

KEY_ARCHIVE

public static final String KEY_ARCHIVE
Path to the main archive dir.

See Also:
Constant Field Values

KEY_REDUCED

public static final String KEY_REDUCED
Path to the main reduced dir.

See Also:
Constant Field Values

KEY_REPLACEFROM

public static final String KEY_REPLACEFROM
The src-part of the path that should be replaced in the final .

See Also:
Constant Field Values

KEY_REPLACETO

public static final String KEY_REPLACETO
The src-part of the path is replaced with this .

See Also:
Constant Field Values

KEY_REDUCEDONE

public static final String KEY_REDUCEDONE
Path to the main reduced dir.

See Also:
Constant Field Values

KEY_FROM

public static final String KEY_FROM
Address of the sender, with or without domain. Follow RFC822 syntax.

See Also:
Constant Field Values

KEY_TO

public static final String KEY_TO
Address list of the recipients, to-type. With or without domain.

See Also:
Constant Field Values

DEFICATDIR

private static final String DEFICATDIR
The main root directory where ICAT resides.

See Also:
Constant Field Values

DEFMODEPAR

private static final String DEFMODEPAR
The location of the mode-parameter file.

See Also:
Constant Field Values

DEFMODEANALYSE

private static final String DEFMODEANALYSE
The location of the mode-parameter file.

See Also:
Constant Field Values

DEFCALIBPAR

private static final String DEFCALIBPAR
The location of the calibration-parameter file.

See Also:
Constant Field Values

DEFCALIBPARSKIP

private static final String DEFCALIBPARSKIP
The location of the calibration-parameter file.

See Also:
Constant Field Values

DEFCALIBPARDARK

private static final String DEFCALIBPARDARK
The location of the calibration-parameter file for dark reduction.

See Also:
Constant Field Values

DEFCALIBPARNODARK

private static final String DEFCALIBPARNODARK
The location of the calibration-parameter file for no dark reduction.

See Also:
Constant Field Values

DEFANALYSISPAR

private static final String DEFANALYSISPAR
The location of the analysis-parameter file.

See Also:
Constant Field Values

DEFANALYSISPARNO

private static final String DEFANALYSISPARNO
The location of the analysis-parameter file.

See Also:
Constant Field Values

DEFANALYSISPARYES

private static final String DEFANALYSISPARYES
The location of the analysis-parameter file.

See Also:
Constant Field Values

DEFICATIN

private static final String DEFICATIN
The default input directory.

See Also:
Constant Field Values

DEFSERIALIZE

private static final String DEFSERIALIZE
The default serialization file of the lookup table

See Also:
Constant Field Values

DEFIMCOPY

private static final String DEFIMCOPY
Default path to imcopy.

See Also:
Constant Field Values

DEFIMCOPYFLAG

private static final String DEFIMCOPYFLAG
Default extension for compress.

See Also:
Constant Field Values

DEFLOCALTMP

private static final String DEFLOCALTMP
Directory where the compressed files are stored for transfer.

See Also:
Constant Field Values

DEFLOCALFITS

private static final String DEFLOCALFITS
Directory where the compressed files are stored for transfer.

See Also:
Constant Field Values

DEFDATEKEY

private static final String DEFDATEKEY
The default key-name for the date of the observation.

See Also:
Constant Field Values

DEFEXPOSUREKEY

private static final String DEFEXPOSUREKEY
The default key-name for the exposure time of the observation.

See Also:
Constant Field Values

DEFFILTERKEY

private static final String DEFFILTERKEY
The default key-name for the filter of the observation.

See Also:
Constant Field Values

DEFIMAGETYPEKEY

private static final String DEFIMAGETYPEKEY
The default key-name for the type of the observation.

See Also:
Constant Field Values

DEFARCHIVE

private static final String DEFARCHIVE
Start of directory tree of archive.

See Also:
Constant Field Values

DEFREDUCED

private static final String DEFREDUCED
Start of directory tree of archive.

See Also:
Constant Field Values

DEFREDUCEDONE

private static final String DEFREDUCEDONE
All successfully and complete reduced dirs go into here.

See Also:
Constant Field Values

DEFFROM

public static final String DEFFROM
The default from address.

See Also:
Constant Field Values

DEFTO

private static final String DEFTO
See Also:
Constant Field Values

DEFSMTPHOST

private static final String DEFSMTPHOST
The default smtphost.

See Also:
Constant Field Values

DEFSMTPPORT

private static final int DEFSMTPPORT
The default port.

See Also:
Constant Field Values

DEFUSESSL

private static final boolean DEFUSESSL
Default we use ssl.

See Also:
Constant Field Values

DEFUSERNAME

private static final String DEFUSERNAME
Default user name.

See Also:
Constant Field Values

DEFPASSWORD

private static final String DEFPASSWORD
Default password name.

See Also:
Constant Field Values

DEFREPLACEFROM

private static final String DEFREPLACEFROM
Replace archive.

See Also:
Constant Field Values

DEFREPLACETO

private static final String DEFREPLACETO
Replace archive with reduced.

See Also:
Constant Field Values

lookup

protected Map<File,String> lookup
For later reconstruction, we have to record the lookup to orignal.


lookbias

protected Map<File,String> lookbias
The same for calibration images, bias.


lookdark

protected Map<File,String> lookdark
The same for calibration images, dark.


lookflat

protected Map<File,String> lookflat
The same for calibration images, flat.


main

private File main
The main ICAT directory, exisitng, readable and writeable.


input

private File input
The mian ICAT input directory, exisitng, readable and writeable.


email

private Mailer email
Mailer instance.

Constructor Detail

Icat

public Icat(Map<String,String> prop)
Defaults keys. Necessarry path and checks are done in init.

Method Detail

init

public void init()
We check for the main directory and create the necessarry input and output dirs if they do not exist, or purge them otherwise. An IllegalArgumentException is thrown, if the main directory or the in/out directories cannot be created or purged, or unreadable/unwritable.

Specified by:
init in interface Initializable
Overrides:
init in class PropertyResources

lookupFilterChar

private char lookupFilterChar(String filter)

getIcatName

public String getIcatName(String typestr,
                          String filter,
                          Date expstart,
                          double texp,
                          int nr)
Returns the standard icat name from the given type, observational filter, the time of the exposure start, the exposure time in ms and a running number.


getIcatInputExtension

public String getIcatInputExtension(String typestr)
From the type of the fits file get the icat extension, which is '.fits' for all calibration files and '_imr.fits' for science input files.


getIcatOutputExtension

public String getIcatOutputExtension(String typestr)
From the type of the fits file get the icat extension, which is '.fits' for all calibration files and '_imc.fits' for science input files.


getMain

public File getMain()
Returns the main ICAT directory. If this method returns non-null, the file pointed to is an exiting directory, it can be read and writtn to.


getQuadrantInput

public File getQuadrantInput(int q0)
Returns the icat input directory for a specified quadrant. This is the directory, we the first reduction run, the one producing flat-field corrected science images, is expecting the raw input files, which are the splitted bias/dark/flat and science fits.


getInput

public File getInput()
Returns the main icat input directory. This is the directory where the secondary reduction step expects its input files, which are the flat-field calibrated science images, stitched together into a single fits file. If this method returns non-null, the file pointed to is an exiting directory, it can be read and writtn to.


getOutput

public File getOutput()
Returns the main icat input directory. This is the directory where the secondary reduction step expects its input files, which are the flat-field calibrated science images, stitched together into a single fits file. If this method returns non-null, the file pointed to is an exiting directory, it can be read and writtn to.


getQuadrantOutput

public File getQuadrantOutput(int q0)
Returns the icat output directory per quadrant, where the first reduction step, the flat-field calibrated science images, are stored on a per-quadrant basis.


getSerializeFile

public File getSerializeFile()
Returns a inter-process serialization file for permanent storage.


execute

private int execute(String exe,
                    long timeout)
Uses the given executable command line string and executes that with a specified timeout.


reducedDir

protected File reducedDir(File src)
From the src-path DIR we get to the reduced path, creating any missing directories on the way.


compress

protected boolean compress(File src,
                           File dest)
Uses imcopy [compress] to compress a fits file from the original path to the destination path. See Error codes


uncompress

protected boolean uncompress(File src,
                             File dest)
Uses imcopy [compress] to compress a fits file from the original path to the destination path.See Error codes Because imcopy tends to fail for unknown reasons (error code 106), but on perfectly uncompressable files, we loop on this process at max 3 times.


saveLookup

protected void saveLookup()
                   throws IOException
Stores the lookup tables in the serialization file. Should be called on exit.

Throws:
IOException

restoreLookup

protected int restoreLookup()
                     throws IOException
Restores the lookup tables from the serialization file.

Returns:
Number of lookup entries restored.
Throws:
IOException

sendMail

public boolean sendMail(String subject,
                        String text)
Sends mail to the default user.


addExtension

protected static void addExtension(List<String> aug,
                                   Collection<String> with,
                                   String ext)
Adds the requested extension to all the string in the list.