# Clear all iteration-based settings
iterations clear

# Clear the list of options for 'extended' mode
extendedopt clear

# Set the number of iterations
rounds 8

# Solve models with maximum-likelihood estimator
estimator maximum-likelihood

# Use RMS weighting
#weighting rms

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

# Solve for sky gradients accross array
sky
extendedopt forget sky

# Don't solve for source until everything is well modeled, expect allow to
# solve for the high S/N regions at the beginning
sourcemap
clip 30.0
blank 30.0
iteration.2 forget sourcemap
iteration.3 drifts auto

# Despike a more heavily than in the standard configuration. Careful, because
# a bright source in the timestream may fall causalty to this if you are not
# watching out...
# Apart from the initially identified brightish features, it is assumed that
# everything else is faint signals which are not apparent in the timestream...
despike absolute 100.0
iteration.2 despike absolute,10.0
iteration.3 despike absolute,8.0
#iteration.4 despike absolute,6.0

# Use noise whitening to clean off any residual spectral features starting
# in an advanced iteration...
iteration.4 whiten 2.0
extendedopt iteration.4 whiten 10.0

# Now that the signals have been sufficiently cleaned, it is time to start 
# modeling the faint source structures, after a whitening step to tame any
# remianing (unmodeled) spectral features. Proceed gradually, lowering 
# clipping and blanking...
iteration.last-2 sourcemap
iteration.last-2 clip 5.0
iteration.last-2 blank 5.0

# Correct fluxes for faint structures below clipping/blanking levels
iteration.last scanmap-correction

# Finally, make unbiased source maps (no clipping).
iteration.last forget clip

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

# clip underexposed parts of the final map
iteration.last exposureclip 0.04

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

# Despike scan maps at 100-sigma (immediate neighbours method)
#scanmapdespike 100.0

# for the last few iterations (after source) do a second despiking...
# This is a little too aggressive perhaps, not recommended if you have sources
# >1 Jy present in your field...
#iteration.5 despike2 features,10.0

# When filtering extended structures (only applicable in 'faint' or  'deep'
# mode when sourceSize is also specified!) what type of filter to use. 
# 'FFT' or 'convolution'.
filter convolution 6.0
extendedopt forget filter
extendedopt scanweighting robust

