; NAME:
;	FITSTOFZ
; PURPOSE:
;	Convert a fits format file into a fzero format file.
; CATEGORY:
;	LP. File IO. High level.
; CALLING SEQUENCE:
;	FITSTOFZ,IFILE,OFILE
; INPUTS:
;	IFILE, input file name.
;	OFILE, output file name.
; KEYWORD PARAMETERS:
; OUTPUTS:
;	Creates an fzero file on the output directory with extension EXTEN
; COMMON BLOCKS:
; SIDE EFFECTS:
;	Write to disk.
; RESTRICTIONS:
;	Must have sufficient disk space.
; PROCEDURE:
; MODIFICATION HISTORY:
;	July  1992  I. Zayer    LPARL. Simplified for MDI testing & renamed
;	June. 1991  P. Milford  Stanford University.

pro fitstofz,ifile,ofile

  if n_params() eq 0 then begin
    print,'fitstofz,ifile,ofile - convert a fits file to fzero format file.'
    return
  endif

  fitsrd,ifile,image,head	;read fits
  if n_elements(ofile) le 0 then ofile=ifile+newname(header)+'.f0'
  fzw,ofile,image,head		;Write fzero file
  print,ofile+'  done...'

end