function fzheader,fitshd
;converts a fits header into an fzero header
@info

  sh=size(fitshd)
  if sh(sh(0)+1) eq 1 then begin
    fzhead=info
    cr=13b
    fzhead.flag=1431677610L
    code=getfitsval(fitshd,'BITPIX')
    if code eq 12 then code=5 else code=code/16
    fzhead.datype=byte(code)
    fzhead.nod=long(getfitsval(fitshd,'NAXIS'))
    sub=where(['F','T'] eq getfitsval(fitshd,'VIDEODSK'))
    fzhead.vdsk=byte(sub(0))
    fzhead.eper=fix(getfitsval(fitshd,'EXT_COLS'))
    fzhead.eler=fix(getfitsval(fitshd,'EXT_ROWS'))
    fzhead.bls=fix(getfitsval(fitshd,'BLS'))
    for i=0,9 do $
      fzhead.temp(i)=fix(getfitsval(fitshd,'TEMP'+strtrim(string(i),2)))
    fzhead.imnum=long(getfitsval(fitshd,'MKSQSNUM'))
    for i=1,fzhead.nod do fzhead.dim(i-1)=$
      long(getfitsval(fitshd,'NAXIS'+strtrim(string(i),2)))
    date=getfitsval(fitshd,'DATE-OBS')
    month=['JAN','FEB','MAR','APR','MAY','JUN','JUL','AUG','SEP','OCT','NOV','DEC']
    month=month(fix(strmid(date,3,2))-1)
    fzhead.date=byte(strmid(date,0,2)+'-'+month+'-19'+strmid(date,6,2))
    fzhead.date(12:22)=byte(getfitsval(fitshd,'TIME-OBS'))
    fzhead.date(23)=cr
    fzhead.site=byte(getfitsval(fitshd,'SITE'))
    fzhead.site(20)=cr
    fzhead.inst=byte(getfitsval(fitshd,'INSTRUME'))
    fzhead.inst(20)=cr
    exposure=getfitsval(fitshd,'MKSHNEXP')
    fzhead.exp=byte(exposure)
    fzhead.exp(7)=cr
    fzhead.sum=byte(getfitsval(fitshd,'SUMMING'))
    fzhead.sum(3)=cr
    fzhead.frame=byte(getfitsval(fitshd,'FRAME'))
    fzhead.frame(10)=cr
    fzhead.ftype=byte(getfitsval(fitshd,'FTYPE'))
    fzhead.ftype(3)=cr
    mtm1=getfitsval(fitshd,'MKM1POS')
    mtm2=getfitsval(fitshd,'MKM2POS')
    cal1=getfitsval(fitshd,'MKC1POS')
    cal2=getfitsval(fitshd,'MKC2POS')
    paw=getfitsval(fitshd,'MKPAPOS')
    for i=strlen(exposure)+1,4 do exposure='0'+exposure
    for i=strlen(mtm1)+1,3 do mtm1='0'+mtm1
    for i=strlen(mtm2)+1,3 do mtm2='0'+mtm2
    for i=strlen(cal1)+1,3 do cal1='0'+cal1
    for i=strlen(cal2)+1,3 do cal2='0'+cal2
    for i=strlen(paw)+1,3 do paw='0'+paw
    fzhead.pc=byte('S'+exposure+'M'+mtm1+'m'+mtm2+'C'+cal1+'c'+cal2+'P'+paw)
    path=['DARK','FULL DISK','HIREZ','UNDEF']
    sub=where(path eq getfitsval(fitshd,'MKSHPATH'))
    if sub lt 0 then sub=3
    fzhead.pc(26)=byte(strmid(path(sub),0,1))
    fzhead.pc(27)=cr
    fzhead.comment=byte(getfitsval(fitshd,'COMMENT'))
    fzhead.comment(80)=cr
    fzhead.seq=byte(getfitsval(fitshd,'SEQUENCE'))
    fzhead.seq(16)=cr
    return,fzhead & endif $
  else return,fitshd

end