;+
; NAME:
;     savemou
; PURPOSE:
;     Make the output file of SSMEM.
; CATEGORY:
;     OVSA APC imaging SSMEM
; CALLING SEQUENCE:
;     savemou, filename, f, nmap, xyint, cbm, alp, bet
; INPUTS:
;     filename  The name of the output file.
;     f     1D array of frequencies in [GHz].
;     nmap  3D array of temperature in [MK]. 1st and 2nd dimensions are of space
;           and the 3rd dimension is of frequency.
;           The same number of pixels are assumed in each spatial dimension.
;     xyint 1D array of the pixel size of each frequency in [arcsec].
;           The same pixel size is assumed in each spatial dimension.
;     cbm   1D array of the CLEAN beam parameters.
;           cbm[0]  Minor axis in pixels.
;           cbm[1]  Major axis in pixels.
;           cbm[2]  Position angle in degree.
;                   Counter clockwise from the y axis.
;     alp   1D array of Lagrange multiplier alpha of each frequency.
;     bet   1D array of Lagrange multiplier beta of each frequency.
; OPTIONAL (KEYWORD) INPUT PARAMETERS:
;
; ROUTINES CALLED:
;
; OUTPUTS:
;
; COMMENTS:
; SIDE EFFECTS:
; RESTRICTIONS:
; MODIFICATION HISTORY:
;     Written 2001 by Su-Chan Bong
;-
pro savemou, filename, f, nmap, xyint, cbm, alp, bet
    nf = n_elements(f)
    sz = size(nmap)
    m = sz[1]
    Bmin = float(cbm[0])
    Bmaj = float(cbm[1])
    PA = float(cbm[2])
    openw, lun, filename, /get_lun, /xdr
    writeu, lun, m, nf, {f_GHz : float(f), TB_xy : float(nmap), $
     xyint : float(xyint), Bmin : Bmin, Bmaj : Bmaj, PA : PA, $
     alp : float(alp), bet : float(bet)}
    free_lun, lun
end