pro mmaxpws, array_out ; ======= ; modified November, 19, 1998 by Olga Koutchmy ; read "maxpowsed" image in jpg format ; call madmax algorithm ; save "madmaxed" image in jpg format ; maxpows image is read from: ; 'spimaxpa.jpg' for all images ; 'spimaxpe.jpg' for even images ; 'spimaxpo.jpg' for odd images ; 'spimaxpf.jpg' for first 7 images ; 'spimaxpl.jpg' for last 8 images ; "madmaxed" image is saved to: ; 'spimada.jpg' for all images ; 'spimade.jpg' for even images ; 'spimado.jpg' for odd images ; 'spimadf.jpg' for first 7 images ; 'spimadl.jpg' for last 8 images ; to read: read_jpeg,fname,image,r,g,b; tvlct,r,g,b; tv,image choice = 0 print,'0: even files' print,'1: odd files' print,'2: all files' print,'3: 0 to 6 files' print,'4: 7 to 14 files' print,'choice = ?' read, choice ; read maxpows image case choice of 0:fname= 'spimaxpe.jpg' 1:fname= 'spimaxpo.jpg' 2:fname= 'spimaxpa.jpg' 3:fname= 'spimaxpf.jpg' 4:fname= 'spimaxpl.jpg' else: goto,endprog endcase read_jpeg, fname, restored_image ssz = size( restored_image ) n1 = ssz(1) n2 = ssz(2) set_plot,'x' window,1,xsize=n1,ysize=n2,title='MAXPOWed image' tvscl, restored_image answer = 'yes' m2 = 1 next: m2 = 2*m2 rim = rebin( restored_image, n1/m2, n2/m2 ) mrim = madmax( rim ) rim = 0 rmrim = rebin( mrim, n1, n2 ) ; if m2 eq 2 then begin array_out = rmrim ; endif else begin ; array_out = array_out + rmrim ; endelse mrim = 0 window,2,xsize=n1,ysize=n2,title='MADMAXed image' tvscl, array_out print,'next MADMAX?(yes/no)' read,answer if answer eq 'yes' then goto,next ; save the madmaxed image case choice of 0:fname= 'spimade.jpg' 1:fname= 'spimado.jpg' 2:fname= 'spimada.jpg' 3:fname= 'spimadf.jpg' 4:fname= 'spimadl.jpg' else: goto,endprog endcase write_jpeg,fname,tvrd() endprog: end