pro zzderot If ( !version.os eq 'Win32' ) Then st = '\' If ( !version.os eq 'linux' ) Then st = '/' Print, 'Where is the data?' dir_read = DIALOG_PICKFILE( /DIRECTORY ) file_mkdir,dir_read+'rot' dir_write = dir_read+'rot'+st ang = (360./24./3600.) list = file_search(dir_read + '*sp.fts',count=nn) spos = Strpos( list[0], st, /reverse_search ) pos = STRPOS(list[0], 'sp.fts') sn = pos - spos listname = STRMID(list, spos+1, sn-1) time = fltarr(nn) spos = Strpos( list[0],'_', /reverse_search ) FOR i = 0,nn-1 DO BEGIN h = STRMID(list[i],spos-6,2) m = STRMID(list[i],spos-4,2) s = STRMID(list[i],spos-2,2) time[i] = h*3600.+ m*60.+ s print, h, m, s ENDFOR o = round(nn/2) dt = time[0] - time[o] imgg = fltarr(1450,1450) imgg[212:1235,212:1235] = readfits(list[0],head) imgg = rot(imgg,ang*dt) xtvscl,congrid(imgg,725,725) box_cursor,x,y,dx,dy img = fltarr(2*dx,2*dy) img = imgg[round(x*2):round(x*2)+2*dx-1,round(y*2):round(y*2)+2*dy-1] WRITEFITS, dir_write+listname[0]+'rt.fts', img, head for i = 1,nn-1 do begin Print, 'Image #' + Strtrim(String(i+1),2) + st + Strtrim(String(nn),2) dt = time[i] - time[o] imgg = fltarr(1450,1450) imgg[212:1235,212:1235] = readfits(list[i],head) imgg = rot(imgg,ang*dt) img = imgg[round(x*2):round(x*2)+2*dx-1,round(y*2):round(y*2)+2*dy-1] WRITEFITS, dir_write+listname[i]+'rt.fts', img, head endfor end