pro welldepth_reduce_batch indir='\\rabbit\sipin\H1RG-022-SIPIN\cold1\welldepth.9Jun05\' outdir=indir for j=1,8 do begin cd,indir list=file_search('ramp_'+strtrim(string(j),2)+'*.fits') infile=indir+'ramp_'+strtrim(string(j),2)+'.txt' openw,1,infile for i=0,n_elements(list)-1 do begin & printf,1,list(i) & endfor close,1 infile=indir+'ramp_'+strtrim(string(j),2)+'.txt' welldepth_reduce,indir,outdir=outdir,infile=infile,region=[100,900,100,900] file_copy,outdir +'H1RG-022-SIPIN_linsat.jpg',outdir +'H1RG-022-SIPIN_linsat_'+strtrim(string(j),2)+'.jpg' endfor end