#
# Configuration file for jitter imaging reduction
# covino@MacBook-Pro-di-Stefano.local Thu May 24 16:23:27 2012
#
#
# Check out the following pages regularly for updates:
#
#     Infrared jitter imaging data reduction algorithms
#     http://www.eso.org/projects/dfs/papers/jitter99/
#
#     Frequently Asked Questions about eclipse,
#     has a dedicated section for the 'jitter' command.
#     http://www.eso.org/eclipse/faq
#
#     eclipse main WWW site:
#     http://www.eso.org/eclipse
#
# Please read the algorithmic manual BEFORE you start using
# this software.
#

[General]
Eclipse         = 5.0.0 ;

# Algorithm can be any of the following:
#
# auto        - Let jitter find out according the instrument used
# isaac-sw    - ISAAC SW algorithm
# isaac-lw    - ISAAC LW algorithm
# naco-sw     - NAOS/CONICA SW algorithm

Algorithm       = auto ;


#
# -------------------- Input files
#
# Input file names are stored in a separate file.
# The input frame list is an ASCII file containing
# the file name in first column and the frame type
# in second column. The frame type is indicating if
# the frame is an object or a sky.
#
# Actually, if the string in second column contains
# anywhere the string 'sky' (case insensitive) then
# the frame is taken as a sky, otherwise as an object.
#
# Example:
# file1         object
# file2         sky
# file3         object
# file4         sky
#
# is similar to:
# file1
# file2         SKY_FRAME
# file3         this is an object frame
# file4         sky
#
# Frame names in the input file are expected in
# same order as they were generated, one file name
# per line, no comments allowed.
#
#

[Frames]
FileList         = framelist.ascii ; contains the list of frames to process

RejectBottom     = 0 ; Number of pixels to reject at the bottom
RejectTop        = 0 ; Number of pixels to reject at the top
RejectLeft       = 0 ; Number of pixels to reject at the left
RejectRight      = 0 ; Number of pixels to reject at the right


#
# -------------------- Pre-processing
#

[PreProcessing]
Activate             = yes ;       activate pre-processing
OddEvenCorrection    = no ;        activate odd-even correction
FiftyHertzCorrection = no ;        activate 50Hz correction

#
# -------------------- Calibration
#
# Dark subtraction, flat-field division and bad pixel replacement
# can be activated here. Provide a file name containing the correct
# calibration data in each case.
# If you do not provide these files, specify 'none' as filename
#

[CalibrationData]
Dark          = none ;           name of the dark file
FlatField     = none ;           name of the flatfield file
BadPixelMap   = none ;           name of a bad pixel map

#
# -------------------- Sky subtraction
#

[SkyEngine]
EstimateSky         = yes  ;        activate sky estimation
OutputDiff          = no ;          activate output (object - sky)
Method              = auto ;          auto / combine / combine_mc / median


[SkyCombine]
MinNumberOfFrames   = 10 ;          min # of frames to run sky estimation
RejectHalfWidth     = 7 ;          rejection halfwidth (int)
RejectMin           = 3 ;          rejection min (int)
RejectMax           = 3 ;          rejection max (int)
SeparateQuadrants   = no ;          separate quadrants for sky subtraction


#
# -------------------- Shift and add
#
# Shift and add is separated into the following sections:
# -> object acquisition (detection or file read)
# -> offset detection/estimation
# -> plane registration and stacking
#

[ShiftAndAdd]
Activate            = yes ;         activate shift and add

# Identify source of cross-correlating objects: auto or file
ObjectSource        = auto ;        auto/file

# Only valid if ObjectSource is 'auto'
AutoDetectImage     = diff   ;        diff/first
AutoThreshold       = 2.0 ;         peak detection sigma threshold
AutoMinPoints       = 1 ;           min # of peaks to detect
AutoMaxPoints       = 1 ;           max # of peaks to detect
AutoOutputObjects   = no ;          dump objects to separate file

# Only valid if ObjectSource is 'file'.
# The provided file is an ASCII file containing as many lines as
# provided objects, each line simply contains the x and y coordinates
# separated by a space.
ObjectFileName      = objects.in ;  name of the input object file

# Identify source of offsets between frames
OffsetInput         = header ;          header/file/blind

# Only valid if Input is file.
# The provided file is an ASCII file containing as many lines as
# input frames, each line simply contains the x and y offsets
# separated by a space.
OffsetInputFile     = offsets.in

# These parameters specify the cross-correlation search
OffsetRefine        = yes ;  activate offset refining
OffsetSearchSizeX   = 20 ;   search halfsize  (int)
OffsetSearchSizeY   = 20 ;   search halfsize  (int)
OffsetMeasureSizeX  = 65 ;   measure halfsize (int)
OffsetMeasureSizeY  = 65 ;   measure halfsize (int)

# Frame averaging is done with a 3d filter rejection
# Specify here the number of min and max pixels to reject
AverageRejectMin    = 3 ;   Number of min pixels to reject in stacking
AverageRejectMax    = 3 ;   Number of max pixels to reject in stacking
UnionFrame          = yes ;  Compute Union frame (no for intersection)


#
# -------------------- Post-processing
#
# RowSubtractMedian will compute the median pixel value for all
# rows in the image and subtract this value from all pixels in the
# row. It is a very efficient algorithm to remove saturation effects
# and it does not affect "normal" lines.
#
[PostProcessing]
Activate              = yes ; if not set none of the following occurs
RowSubtractMedian     = no ; to remove row saturation effects

# Included as 'post-processing' is the ability to start
# an image viewer to see the results when 'jitter' has
# finished working. Specify the command-line to start it,
# %s being the name of the output file

StartViewer         = no  ; to launch a viewer when finished
StartCommand        = "saoimage -fits %s" ;
#
# Examples:
#
# StartCommand        = "saoimage -fits %s" ;
# StartCommand        = "rtd %s" ;
# StartCommand        = "xv %s" ;
#


#
# -------------------- Saving results
#
# All files created by 'jitter' will be named according to the
# following convention: basename_[type].[extension]
# where basename is declared in the following section,
# [type] depends on the frame type
# and [extension] depends on the file format (fits, tfits, or paf)
#

[Output]
BaseName      = jittered_result ;


#
# ----- end of file
#
