FUNCTION raypath,year,month,day,cam,filt ; define path to desired images dir='/jasper/cnsr3_data1/save/' ; define file name for desired file template=STRING(year MOD 100,month,day,cam,filt,FORMAT='(3I2.2,2I1,".*")') ; make list of available files of desired type files=FINDFILE(dir+template,COUNT=nfiles) CASE nfiles OF 0: BEGIN PRINT,'No files found; quitting.' template='/dev/null' END 1: BEGIN PRINT,files(0)+' available; opening file' template=files(0) END ELSE: BEGIN PRINT,'Files available:' FOR i=0,nfiles-1 DO PRINT,i,files(i),FORMAT='(I1,2X,A)' PRINT,'Select the file to display' READ,nd template=files(nd) END ENDCASE RETURN,template END