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

  ;+
  ; NAME:
  ;     EIS_MAPPER_SUVI_MAP
  ;
  ; PURPOSE:
  ;     For a specified time and wavelength retrieve the SUVI full-disk
  ;     file that is nearest in time to the requested time from the
  ;     VSO.
  ;
  ; CATEGORY:
  ;     GOES/SUVI; 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:   SUVI wavelength (integer). Default: 195.
  ;
  ; OPTIONAL INPUTS:
  ;     Outdir: Specifies the directory where the SUVI 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 SUVI 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_suvi_image('7-sep-2024 02:00')
  ;
  ; MODIFICATION HISTORY:
  ;     Ver.1, 06-Dec-2024, Peter Young.
  ;       Modified from eis_mapper_eis_map
  ;-

  if n_params() lt 1 then begin
    print, 'Use:  IDL> map=eis_mapper_suvi_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 - 300d
  t_tai1 = t_tai + 300d

  ;
  ; modified list below so that it only includes the level-0 files.
  ;
  list = vso_search(t_tai0, t_tai1, inst = 'suvi', count = n, extent = 'FULLDISK', quiet = quiet)
  
  if n eq 0 then BEGIN
    message,/info,/cont,'No file found for this date. Returning...'
    return, -1
  endif

  k=where(list.wave.min EQ wave,nk)
  IF nk GT 0 THEN BEGIN
    list=list[k]
  ENDIF ELSE BEGIN 
    message,/info,/cont,'No file found for this date. Returning...'
    return, -1
  ENDELSE

  t_start_tai=anytim2tai(list.time.start)
  getmin=min(abs(t_start_tai-t_tai),imin)
  a = vso_get(list[imin], out_dir = outdir, local_file = local_file, quiet = quiet)
  fits2map,local_file,map

 ;
 ; The SUVI files seem to contain two images, so I just take the one with the
 ; longer exposure time.
 ;
  IF n_elements(map) GT 1 THEN BEGIN
    dur=map.dur
    getmax=max(map.dur,imax)
    map=map[imax]
  ENDIF

 ;
 ; SUVI images have large roll angles
 ;
  rmap=rot_map(map,-map.roll_angle,rcenter=map.roll_center)

  
  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
    message,/info,/cont,'File downloads to '+local_file
  endif

  return, rmap
end
