%N spwrite %F $MIR/src/subs/mir_io.c
%D Write the spectral window header for a MIR data set
%P dnf
%: low-level-i/o
%B
FORTRAN call sequence
       subroutine spWrite(sphid,blhid,inhid,igq,ipq,iband,ipstate,tau0,
                          vel,vres,ivtype,fsky,fres,tssb,integ,wt,
                          itaper,snoise,nch,nrec,dataoff,linid,itrans,
                          rfreq,pasid,gaiidamp,gaiidpha,flcid,atmid)

       integer sphid,blhid,inhid,igq,ipq,iband,ipstate,ivtype,itaper,
               nch,nrec,dataoff,linid,itrans,pasid,gaiidamp,gaiidpha,
               flcid,atmid
       real tau0,vres,fres,tssb,integ,wt,snoise
       double precision vel,fsky,rfreq

  This writes an entry into a MIR spectral window header

  Input:
    sphid      spectral header id (globally unique)
    blhid      baseline header id (globally unique, same as that in baseline header)
    inhid      integration header id (globally unique, same as that in integration header)
    igq        gain calibrator code
    ipq        passband calibrator code
    iband      spectral band code
    ipstate    polarization state code
    tau0       opacity
    vel        velocity of center channel
    vres       velocity resolution of channel (km/s)
    ivtype     velocity axis type
    fsky       sky frequency of window (centered in window, GHz)
    fres       frequency resolution (MHz)
    tssb       baseline based single sideband system temperature (K)
    integ      integration time
    wt         weight of data - based on integration time and system temp
    itaper     taper code
    snoise     single channel noise
    nch        number of spectral channels in window
    nrec       number of records
    dataoff    data offset in bytes
    linid      spectral line id
    itrans     transition code
    rfreq      rest frequency (GHz)
    pasid      passband function number
    gaiidamp   amp gain function number
    gaiidpha   phase gain function number
    flcid      flux cal id
    atmid      atm ospheric coherence id                                
