function eis_mapper_eit_map, ttime, wave, local_file = local_file, quiet = quiet, $
  no_delete = no_delete, outdir = outdir
  compile_opt idl2

  ;+
  ; NAME:
  ;     EIS_MAPPER_EIT_MAP
  ;
  ; PURPOSE:
  ;     For a specified time and wavelength retrieve the EIT full-disk
  ;     file that is nearest in time to the requested time from the
  ;     VSO.
  ;
  ; CATEGORY:
  ;     SOHO/EIT; file access.
  ;
  ; CALLING SEQUENCE:
  ;     Result = EIS_MAPPER_EIT_MAP ( Time, Wave )
  ;
  ; INPUTS:
  ;     Ttime:  Time for which image is required. Can be in any format
  ;             accepted by the ANYTIM suite of routines.
  ;     Wave:   EIT wavelength (integer). Default: 195.
  ;
  ; OPTIONAL INPUTS:
  ;     Outdir: Specifies the directory where the EIT file will be
  ;             downloaded to. By default, it is $IDL_TMPDIR.
  ;
  ; KEYWORD PARAMETERS:
  ;     QUIET:  Do not print information to the screen.
  ;     NO_DELETE: If set, then the downloaded file is
  ;                not deleted.
  ;
  ; OUTPUTS:
  ;     Returns an IDL map containing the EIT image. If a problem occurs
  ;     then -1 is returned.
  ;
  ; OPTIONAL OUTPUTS:
  ;     Local_File: The name of the file that is downloaded. Only works
  ;                 if /no_delete is set.
  ;
  ; EXAMPLE:
  ;     IDL> map=eis_mapper_eit_image('15-feb-2011 02:00')
  ;     IDL> map=eis_mapper_eit_image('15-feb-2011 02:00',171)
  ;     IDL> map=eis_mapper_eit_image('15-feb-2011 02:00',/no_delete,local_file=local_file)
  ;
  ; MODIFICATION HISTORY:
  ;     Ver.1, 28-Aug-2013, Peter Young.
  ;     Ver.2, 26-Sep-2018, Peter Young
  ;       Now preps the data, but note that you need to have the
  ;       SSWDB/soho/eit directory installed.
  ;     Ver.3, 28-Sep-2018, Peter Young
  ;       Now searches 1 day either side of input time.
  ;     Ver.4, 19-Mar-2020, Peter Young
  ;       Tidied up header; now checks if user has the sswdb directory
  ;       before trying to prep; added "extent" to vso_search to prevent
  ;       partial frame images from being returned.
  ;     Ver.5, 23-Mar-2020, Peter Young
  ;       Renamed eis_mapper_eit_map; reproduces behavior of
  ;       eis_mapper_mdi_map; now filters out partial frame images.
  ;     Ver.6, 01-Apr-2020, Peter Young
  ;       Fixed out_dir keyword for vso_get call.
  ;     Ver.7, 19-Jan-2021, Peter Young
  ;       Fixed some information message text, no change to code.
  ;     Ver.8, 17-Apr-2024, Peter Young
  ;       Filtered VSO files so that I only use level-0 files.
  ;-

  if n_params() lt 1 then begin
    print, 'Use:  IDL> map=eis_mapper_eit_map( time, wave [, /quiet, /no_delete, outdir=, local_file= ])'
    return, -1
  endif

  if n_elements(outdir) eq 0 then outdir = getenv('IDL_TMPDIR')
  if n_elements(wave) eq 0 then wave = 195

  date = anytim2utc(/ccsds, ttime, /date)
  t_tai = anytim2tai(ttime)
  t_tai0 = t_tai - 1 * 86400d
  t_tai1 = t_tai + 1 * 86400d

  ;
  ; modified list below so that it only includes the level-0 files.
  ;
  list = vso_search(t_tai0, t_tai1, inst = 'eit', wave = wave, count = n, extent = 'FULLDISK', quiet = quiet)
  if n gt 0 then begin
    chck = strpos(list.fileid, '_L1.fits')
    k = where(chck lt 0, n)
    if n gt 0 then list = list[k]
  endif

  if n eq 0 then begin
    print, '% EIS_MAPPER_EIT_MAP: no file found for this date. Returning...'
    return, -1
  endif

  ;
  ; The loop and various if statements below is to catch any partial
  ; frame images as the "fulldisk" keyword doesn't actually work
  ; for EIT. My trick is to set the start time of a partial frame to far
  ; in the future, effectively removing it from the check.
  ;
  ; The EIT files downloaded from VSO are already calibrated (level-1)
  ; so I just need to read them with read_eit.
  ;
  swtch = 0
  while swtch eq 0 do begin
    list_tai = anytim2tai(list.time.start)
    getmin = min(abs(list_tai - t_tai), imin)
    if getmin le 5e5 then begin
      a = vso_get(list[imin], out_dir = outdir, local_file = local_file, quiet = quiet)
      eitdbdir = concat_dir(getenv('SSWDB'), 'soho/eit')
      chck = file_info(eitdbdir)
      if chck.exists eq 0 then begin
        read_eit, local_file, index, data
        print, '% EIS_MAPPER_EIT_MAP: The EIT SSWDB database was not found. The EIT image will not be prepped.'
      endif else begin
        eit_prep, local_file, index, data
      endelse
      s = size(data, /dim)
      if s[0] ne 1024 or s[1] ne 1024 then begin
        list[imin].time.start = '31-dec-2100 12:00'
      endif else begin
        index2map, index, data, map
        swtch = 1
      endelse
    endif else begin
      swtch = 2
    endelse
  endwhile

  if swtch eq 2 then return, -1

  if not keyword_set(no_delete) then file_delete, local_file

  if not keyword_set(no_delete) then junk = temporary(local_file)

  if keyword_set(no_delete) and not keyword_set(quiet) then begin
    print, '% EIS_MAPPER_EIT_MAP: file downloaded to ' + local_file
  endif

  return, map
end