pro an_to_fit, header,dir, times, start, finish, initialframe IF N_ELEMENTS(initialframe) EQ 0 THEN initial frame = 0L ; If the first file had 8000 frames, then the first frame in the second file would be start=0, initialframe=8000 ; If there are more than 12 files in the data set then the format in fname should be (I06) to fit FOR i=LONG(start),Long(finish) DO BEGIN image = get_an(header, dir, i, times=times,/top) fname = 'G:\lcross\Fits\LCROSS_NIR_'+STRING(i+initialframe, FORMAT='(I05)')+'.fit' Print, 'Writing file '+fname writefit, image, fname, antime=times, anframe=i, $ obj = 'South Lunar Pole - LCROSS impact location. crater Cabeus', $ tele = 'NMSU Tortugas Mtn 0.6m f40',$ inst = 'Goodrich SU640KTSX InGaAs ',$ obs = 'Suggs, Hamilton, Wu',$ notes = ' Gain = 47.0 e-/ADU OPR=10 origin bottom left',$ expo = 0.01877 ,$ filter=' None ',$ focal = 24384.0 ,$ diam = 609.6 ,$ xmic = 25.0 , $ ymic = 25.0 ENDFOR END ; pro an_to_fit, namestub, starttime, endtime