pro get_lvl3,year,month

;+
;NAME
;	get_lvl3
;PURPOSE
;	Prepare list of filenames of level-3 FITS images for every month
;	for use in making smoothies.
;CALLING SEQUENCE
;	get_goodfits,year,month,alok=alok
;INPUT
;	year, e.g, '1996'
;	month, e.g., '06'.  Must be string with leading 0.
;OPTIONAL KEYWORD INPUT
;OUTPUT
;	List of filenames in .genx file.
;HISTORY
;	18-May_2016 LWA Taken from Aki's ok_movimg_1996.pro.
;	19-May-2016 LWA Converted from get_goodfits.pro.
;-

stt=anytim(!stime)
yyyy=strtrim(year,2)
mm=strtrim(month,2)
help,yyyy,mm
alok=1
;--------
movdir='/disk/yla/www/archive/yohkoh/sxtmov35/'
;
;--------------------------------------------
; (1) Do not use Al.1 images after 1-Dec-1992
;--------------------------------------------
if anytim('1-Dec-92') le anytim(yyyy+'-'+mm+'-01T') then alok=0
if alok then mdpe=18 else mdpe=20
if not alok then begin
   file10=file_search(movdir+yyyy+'/'+mm+'/*/sx?m*31.fts')
endif else begin
   file10=file_search(movdir+yyyy+'/'+mm+'/*/sx?m*.fts')
endelse
file1=sort_sscfits(file10)
help,file1
;
;--------------------------------------------
; (2) remove low S/N images (DPE <= 19)
;--------------------------------------------
mreadfits,file1,index,/nodata
pmm,gt_dpe(index)
ss2=where(gt_dpe(index) ge mdpe)
file2=file1(ss2)
index=index(ss2)
help,file2
pmm,gt_dpe(index)
savegen,file2, $
   file='fil_list/ok_fts_'+yyyy+'_'+mm+'.genx'
;
ett=anytim(!stime)
dtt=(ett-stt)/60.
print,'  It took '+strtrim(dtt,2)+' minutes to do '+yyyy+'_'+mm+'.'

end
