.ec _
.ll 76
.ad b
.in 4
.\"====================================================================
.ti -4
1 Language
.ti +10
DSB2SSB\ Language Summary

.nf
INITIALIZE
DECONVOLVE
.fi
.\"====================================================================
.ti -4
1 INITIALIZE
.ti +4
DSB2SSB_\INITIALIZE [Continuum__Offset]

Builds the data array for deconvolution from all spectra in the
index. A continuum offset can be provided.

This instruction MUST be called before your first call to DECONVOLVE.
.\"====================================================================
.ti -4
1 DECONVOLVE
.ti +4
DSB2SSB_\DECONVOLVE Tolerance Itmax [Lambda1 [Lambda2 [Lambda3]]]
[/GAIN [First__Guess]] [/KEEP]

Deconvolves DSB dataset loaded with INITIALIZE into SSB
spectrum. Minimizes the function:
.nf
        Chi^2 - lambda1 F1 - lambda2 F2
.fi
until either the difference in Chi^2 between the iterations is less
than the Tolerance, or the maximum number of iterations Itmax has been
reached.

Here:
.nf
  Chi^2 = Sum (dsb - ssb__lsb*gain__lsb - ssb__usb*gain__usb)^2
          /(weight * nu)

  F1 : entropy of the channels.
  F1 = - Sum ssb/SSB * log ssb/SSB

  F2 : entropy of the gains.
  F2 = - Sum gain__ssb/e * log gain__ssb/e
.fi
and
.nf
  dsb          - double sideband data
  ssb          - single sideband data
  gain         - gain of single sideband data
  weight       - T__sys^2/(integration_time * bandwidth)
  nu           - number of free parameters: 
  dsb__channels - ssb__channels - sideband__gains
  SSB          - Sum ssb
.fi

If Lambda1 or Lambda2 or Lambda3 are not specified, they are set to 0
and the algorithm does NOT try to maximize the entropy term.

By default the deconvolution makes no attempt at fitting the sideband
gains, unless the option /GAIN is specified.
.\"--------------------------------------------------------------------
.ti -4
2 /GAIN
.ti +4
DSB2SSB\DECONVOLVE /GAIN [First__Guess]

When this option is present, the deconvolution will try to adjust the
sideband gains, fitting one constant value per sideband for every LO
setting.

--> make sure you have run the deconvolution without gain fitting
first! Here's a typical sequence of commands to turn on the gain fitting
during the deconvolution:

.nf
  > initialize
  > deconvolve 1e-5 100 /keep
  > deconvolve 1e-5 100 /gain
.fi

First__Guess can be set to 1 or 0.

By default, First__Guess = 1 (the initial guess for signal and image
sideband gains is that they are equal to 1 for every LO setting).

Should any information on the sideband ratio be available in the
header variable GAINI, the user can enforce this as initial guess for
the gain fitting by setting First__Guess = 0.
.\"--------------------------------------------------------------------
.ti -4
2 /KEEP
.ti +4
DSB2SSB\DECONVOLVE /KEEP

Keeps the outcome of the deconvolution in memory and uses it as
initial guess for the next (if any) run. The initial guess is reset to
0 whenever the command INITIALIZE is used.
.\"====================================================================
.ti -4
1 ENDOFHELP
