# Set the projection to use
projection GLS

# The ordering of models in the main reduction pipeline. 
ordering offsets,drifts,decorrelate,time-weighting,whiten,weighting,despike,despike2,despike3,sky,accel,wafers,regions,boxes,cables,twisting,amps,neighbours,sourcemap

# In case an outputput name was set before loading default.cfg, clear it
forget name

# Turn this option on if you want to see intermediate maps as the reduction
# progresses. These are (over-)written to 'intermediate.fits'.
#intermediatemaps 

# Signal estimators to use ('median' or 'maximum-likelihood').
estimator median

# Solve for pixels gains (with specified estimator type)
gains maximum-likelihood

# Derive pixel weights (via 'rms', 'differential' or 'robust' method).
weighting robust

# Specify the range of acceptable pixel noise rel. to the median pixel noise
# Channels outside of this admissible range will be flagged.
relative-noise-range 0.3--10.0

# Time weighting (optionally with time-resolution in seconds or 'auto').
time-weighting 1.0

# Derive appropriate weights for the source-modeling separately...
sourceweights

# Specify an acceptable range fro time-weights. Frames with weights outside
# this range will be flagged.
time-weight-range 0.1--10.0

# In intermediate iterations use MEM correction to the source map.
sourcemap MEM

# Set the 'desirability' of MEM solution (0 -- 1)
MEM-lambda 0.1

# Solve for atmospheric gradients
#sky

# Solve for pixel drifts (1/f filtering) at given timescale
forget offsets
drifts 30.0
iteration.3 drifts auto

# Set the nunber of iterations required
rounds 5

# Despike with the specified method ('frames', 'features', 'absolute' or 
# 'gradual') above the critical S/N level.
despike neighbours 100.0

# Clip maps only to retain really bright source features, which have to
# be removed before despiking. As the despiking level is tightened, so the 
# clipping level will drop.
clip 30.0

# Blanking of bright sources is initially disabled, however, since 
# it may hinder despiking...
blank 30.0

# Now that the brightest features have been blanked, despike more tightly, and
# follow-up with clipping and blanking at lower S/N levels....
iteration.2 despike neighbours,30.0
iteration.2 clip 10.0
iteration.2 blank 10.0

# Continue going for fainter fluxes in the third iteration, while retaining
# clipping and blanking for non-significant features.
iteration.3 despike neighbours,10.0
iteration.3 clip 3.0
iteration.3 blank 3.0

# By now bright features should be well modeled. For fainter structures, switch
# to using maximum-likelihood estimators
#iteration.4 estimator maximum-likelihood

# In the last iteration, make unbiased (i.e. unclipped) maps. Before mapping,
# whiten noise to filter any remaining spectral misbehaviour...
iteration.last forget clip
iteration.last whiten

# Despiking options
spikefraction 1e-3
spikecount 10
framespikes 3
spikewidth auto

# Do not model acceleration response of bolometers
forget accel

# Weight each scan based on its measured map-noise (robust estimation)
#scanweighting robust

# Despiking of scanmaps above some S/N level.
forget scanmapdespike

# Minimum redundancy per scanmap pixel
scanmap-redundancy 2

# Correct map fluxes below clipping/blanking level for the filtering effect
# of auxillary models when map is iterated. When the map is not iterated, 
# the correction always takes place using a different method.
iteration.last scanmap-correction

# Noise clip the final map, s.t. map pixels with noise more than 10-times the
# least noisy part of the map are flagged.
forget noiseclip

# No need to waste time synching the source in the last iteration...
iteration.last sourcemap nosync

# Clip map points that have been integrated less than the specified fraction of
# the best covered part.
iteration.last exposureclip 0.04

# No need to waste time blanking in last iteration
iteration.last forget blank

# Do not smooth the final map (even if smoothing was used in intermediate
# source models...
iteration.last forget smooth

# Options for 'extended' mode
#extendedopts

# Unset bright, faint and deep keys...
forget bright
forget faint
forget deep
