pro j15sum_dif,imn=imn,imset=imset,img=img ; if n_elements(imn) eq 0 then imn = '3200' if n_elements(imset) eq 0 then imset = 'jan15_' if n_elements(img) eq 0 then img = 2384 imgs = img imgq = 15 ; ; directory from where to get images ; namex = '[bjackson.lasco.datr]' ; ; directory into which to place difference images ; name='[bjackson.lasco.datns]' ; ; image/s to use as base ; starless = fltarr(5,5) nami0 = '2308' nami1 = '2312' nami2 = '2316' nami3 = '2320' fini1 = '.fts' fini2 = '.dif' for ii=0,3 do begin if ii eq 0 then nami = nami0 if ii eq 1 then nami = nami1 if ii eq 2 then nami = nami2 if ii eq 3 then nami = nami3 nameb = namex+imn+nami+fini1 base1 = readfits(nameb,hdrb) if ii eq 0 then begin base00 = base1 base00(*,*) = 0.0 base0 = base00 endif ; ; Remove stars from the base image by finding the minimum within an area ; for i=2,512-3 do begin for j=2,256-3 do begin starless=base1(i-2:i+2,j-2:j+2) minstarless = min(starless) base00(i,j) = minstarless endfor endfor ; ; Sum 4 base images together to remove any small-scale heliospheric density ; structure. (The structure will have moved over the time of the average.) ; base0 = base0 + base00 endfor base0(*,*) = base0(*,*)/4.0 start: ; ; Image to use name. ; namei = namex+imn+strcompress(img,/rem)+fini1 ; ; Difference result name ; namen = name+imset+strcompress(img,/rem)+fini2 ; second = readfits(namei,hdr) second = second - base0 ; writefits, namen, second, hdr tv, second img = img + 4 if img gt imgs + imgq*4 then goto, end1 ; goto, start ; end1: ; end