; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;; PRO LIGHTNING ;;;;;;; ;;;;;;; 01/31/01 ;;;;;;; ;;;;;;; modified: 02/12/01 ;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Open the file ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; OPENR, 1, 'n1361901831.raw' ;***** Enter raw data file name ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Image array size ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; XSIZE = 1024 ; pixels YSIZE = 1024 ; pixels A = INTARR(XSIZE, YSIZE) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Read data into A ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; READU, 1, A ;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Close the file ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; CLOSE, 1 ;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Correct image orientation ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TEMPO = ROTATE(A, 7) IMAGE = TEMPO / 16 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Display the image ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; MYDEVICE = !D.NAME WINDOW,0,XSIZE=1024, YSIZE=1024 TV, IMAGE SET_PLOT, MYDEVICE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Add row and column profiles ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;R = PROFILE(IMAGE) ; (Choose method) ;WINDOW, /FREE ; < -- Allows user to choose ; profile start and end points ;PLOT, R PROFILES, IMAGE ; <-- Moving the mouse within the original image ; imteractively creates profile plots in the newly ; created profile window. Pressing the left mouse ; button toggles between row and column profile. ; The right mouse button exits. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Surface plot ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; PRINT, '_____________________________________' PRINT, 'Enter any number to view surface plot' PRINT, '_____________________________________' READ, ABC SHADE_SURF, IMAGE, TITLE = 'shaded surface representation', $ ZTITLE = 'Data Number' SET_PLOT, 'PS' DEVICE, FILENAME = 'shade_a.ps' SHADE_SURF, IMAGE, TITLE = '1200 sec. dark', $ ZTITLE = 'Data Number' DEVICE, /CLOSE SET_PLOT, MYDEVICE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Create histogram ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; PRINT, '_______________________________________________' PRINT, 'Enter any number to view total data number plot' PRINT, '_______________________________________________' READ, BCD M = 256L COUNTS = make_array(M) for j = 0L, M -1 do begin dntotals = where(IMAGE eq j, count) COUNTS(j) = count PRINT, 'DN', j, '; Total elements = ', count endfor SET_PLOT, MYDEVICE PLOT, COUNTS, LINESTYLE = 2, XTITLE = 'DN', YTITLE = 'total tumber' SET_PLOT, MYDEVICE SET_PLOT, 'PS' DEVICE, FILENAME = 'totalperdn_a.ps' PLOT, COUNTS, LINESTYLE = 2, XTITLE = 'DN', YTITLE = 'total number' SET_PLOT, MYDEVICE ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;; Limit Y-axis of total data number plot ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; PRINT, '_____________________________________________' PRINT, 'What would you like to limit the Y-axis to?' PRINT, '_____________________________________________' READ, LIMIT PRINT, 'Y-range = ', LIMIT PLOT, COUNTS, LINESTYLE = 2, YRANGE = [0, LIMIT], XTITLE = 'DN', $ YTITLE = 'total number' SET_PLOT, MYDEVICE SET_PLOT, 'PS' DEVICE, FILENAME = 'totallimit_a.ps' PLOT, COUNTS, LINESTYLE =2, YRANGE = [0, LIMIT], XTITLE = 'DN', $ YTITLE = 'Total number' DEVICE, /CLOSE SET_PLOT, MYDEVICE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;; Plot fraction > threshold DN per line (later latitude) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; PRINT, '_________________________________________________________' PRINT, 'Enter any number to view fraction DN > threshold per line' PRINT, '_________________________________________________________' READ, DEF PRINT, 'What is the image exposure time in seconds?' ; Exposure time READ, EXPTIME PRINT, 'exposure time = ', EXPTIME, ' seconds' PRINT, ' ' PRINT, '_________________________________________________________' PRINT, 'Choose threshold (0 - 255)' READ, THRESHOLD PRINT, 'Threshold = ', THRESHOLD PRINT, ' ' N = YSIZE LINES = MAKE_ARRAY(N) FOR I = 0, N -1 DO BEGIN SOMETHING = WHERE(IMAGE[I, *] GT THRESHOLD, COUNT) LINES(I) = COUNT ENDFOR MX = WHERE(IMAGE GT THRESHOLD, COUNT) TOTALABOVE = COUNT PRINT, ' ' PRINT, 'Total number greater than threshold = ', TOTALABOVE PRINT, ' ' TEMP = LINES / YSIZE ; finds fraction per line above threshold THRESHDN = TEMP / EXPTIME ; normalize for varying exposure times PRINT, '_____________________________________________________' PRINT, 'Enter any number to view non-normailzed fraction plot' PRINT, '_____________________________________________________' READ, KSIEGF SET_PLOT, MYDEVICE PLOT, TEMP, LINESTYLE = 2, XTITLE = 'line number', YTITLE = 'fraction > threshold' PRINT, '________________________________________________' PRINT, 'Enter any number to view normailzed fraction plot' PRINT, '________________________________________________' READ, KSEHCF PLOT, THRESHDN, LINESTYLE = 2, XTITLE = 'line number', $ YTITLE = 'fraction > threshold per sec.' SET_PLOT, MYDEVICE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;; Limit Y-range of plot fraction above threshold plot ;;;;;;;;;;;;;;;;;;;;;;;;;;;; PRINT, '_____________________________________________' PRINT, 'What would you like to limit the Y-axis to?' PRINT, '_____________________________________________' READ, LIMIT2 PRINT, 'Y-range = ', LIMIT2 PLOT, THRESHDN, LINESTYLE = 2, YRANGE = [0, LIMIT2], XTITLE = 'Line Number', $ YTITLE = 'Fraction > threshold per sec.' SET_PLOT, MYDEVICE SET_PLOT, 'PS' DEVICE, FILENAME = 'normfrac_a.ps' PLOT, THRESHDN, LINESTYLE = 2, YRANGE = [0, LIMIT2], $ XTITLE = 'line number', $ YTITLE = 'fraction > threshold per sec.' DEVICE, /CLOSE SET_PLOT, MYDEVICE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; PRINT, '____________________________________________________' ;;;;;;;;;; PRINT, "That's all folks!" ;;;;;;;;;; PRINT, '____________________________________________________' ;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Begin 2nd image analysis ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;: PRINT, '______________________________________________' PRINT, 'Enter any number to continue to 2nd image...' PRINT, '______________________________________________' READ, TUV ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Open the second file ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; OPENR, 1, 'w1349702696.raw' ;****** Enter raw data file name ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Image array size ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; XSIZE = 1024 ; pixels YSIZE = 1024 ; pixels B = INTARR(XSIZE, YSIZE) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Read data into B ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; READU, 1, B ;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Close the file ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; CLOSE, 1 ;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Correct image orientation ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TEMPO2 = ROTATE(B, 7) IMAGE2 = TEMPO2 / 16 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Display the image ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; MYDEVICE = !D.NAME WINDOW,0,XSIZE=1024, YSIZE=1024 TV, IMAGE2 SET_PLOT, MYDEVICE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Add row and column profiles ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;R2 = PROFILE(IMAGE2) ; (Choose method) ;WINDOW, /FREE ; < -- Allows user to choose ;profile start and end points ;PLOT, R2 PROFILES, IMAGE2 ; <-- Moving the mouse within the original image ; imteractively creates profile plots in the newly ; created profile window. Pressing the left mouse ; button toggles between row and column profile. ; The right mouse button exits. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Surface plot ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; PRINT, '_____________________________________' PRINT, 'Enter any number to view surface plot' PRINT, '_____________________________________' READ, ABC SHADE_SURF, IMAGE2, TITLE = 'shaded surface representation', $ ZTITLE = 'data number' SET_PLOT, 'PS' ; Set plot to printer DEVICE, FILENAME = 'shade_b.ps' SHADE_SURF, IMAGE2, ZTITLE = 'data number' DEVICE, /CLOSE SET_PLOT, MYDEVICE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; create histogram ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; PRINT, '_______________________________________________' PRINT, 'Enter any number to view total data number plot' PRINT, '_______________________________________________' READ, BCD M = 256L COUNTS2 = make_array(M) for j = 0L, M -1 do begin dntotals2 = where(IMAGE2 eq j, count) COUNTS2(j) = count PRINT, 'DN', j, '; Total elements = ', count endfor SET_PLOT, MYDEVICE PLOT, LINESTYLE = 1, COUNTS2, XTITLE = 'DN', YTITLE = 'total number' SET_PLOT, MYDEVICE SET_PLOT, 'PS' DEVICE, FILENAME = 'totalperdn_b.ps' PLOT, COUNTS2, LINESTYLE = 1, XTITLE = 'DN', YTITLE = 'total number' DEVICE, /CLOSE SET_PLOT, MYDEVICE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;; Limit Y-axis of total data number plot ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; PRINT, '_____________________________________________' PRINT, 'What would you like to limit the Y-axis to?' PRINT, '_____________________________________________' READ, LIMIT3 PRINT, 'Y-range = ', LIMIT3 PLOT, COUNTS2, LINESTYLE = 1, YRANGE = [0, LIMIT3], XTITLE = 'DN', $ YTITLE = 'total number' SET_PLOT, MYDEVICE SET_PLOT, 'PS' DEVICE, FILENAME = 'totallimit_b.ps' PLOT, COUNTS2, LINESTYLE = 1, YRANGE = [0, LIMIT3], XTITLE = 'DN', $ YTITLE = 'total number' DEVICE, /CLOSE SET_PLOT, MYDEVICE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;; Plot fraction > threshold DN per line (later latitude) ;;;;;;;;;;;;;;;;;;;;;;;;; PRINT, '_________________________________________________________' PRINT, 'Enter any number to view fraction DN > threshold per line' PRINT, '_________________________________________________________' READ, DEF PRINT, 'What is the image exposure time in seconds?' ; Exposure time READ, EXPTIME2 PRINT, 'exposure time = ', EXPTIME2, ' seconds' PRINT, ' ' PRINT, '_________________________________________________________' PRINT, 'Choose threshold (0 - 255)' READ, THRESHOLD2 PRINT, 'Threshold = ', THRESHOLD2 PRINT, ' ' N = YSIZE LINES2 = MAKE_ARRAY(N) FOR I = 0, N -1 DO BEGIN SOMETHING2 = WHERE(IMAGE2[I, *] GT THRESHOLD2, COUNT) LINES2(I) = COUNT ENDFOR MX2 = WHERE(IMAGE2 GT THRESHOLD2, COUNT) TOTALABOVE2 = COUNT PRINT, ' ' PRINT, 'Total number greater than threshold = ', TOTALABOVE2 PRINT, ' ' TEMP2 = LINES2 / YSIZE ; finds fraction per line above threshold THRESHDN2 = TEMP2 / EXPTIME2 ; normalize for varying exposure times PRINT, '_____________________________________________________' PRINT, 'Enter any number to view non-normailzed fraction plot' PRINT, '_____________________________________________________' READ, KSIEGF SET_PLOT, MYDEVICE PLOT, TEMP, LINESTYLE = 1, XTITLE = 'line number', YTITLE = 'fraction > threshold' PRINT, '________________________________________________' PRINT, 'Enter any number to view normailzed fraction plot' PRINT, '________________________________________________' READ, KSEHCF PLOT, THRESHDN2, LINESTYLE = 1, XTITLE = 'line number', $ YTITLE = 'fraction > threshold per sec.' SET_PLOT, MYDEVICE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;; Limit Y-range of plot fraction above threshold plot ;;;;;;;;;;;;;;;;;;;;;;;;;;; PRINT, '____________________________________________' PRINT, 'What would you like to limit the Y-axis to?' PRINT, '____________________________________________' READ, LIMIT4 PRINT, 'Y-range = ', LIMIT4 PLOT, THRESHDN2, LINESTYLE = 1, YRANGE = [0, LIMIT4], XTITLE = 'line number', $ YTITLE = 'fraction > threshold per sec.' SET_PLOT, MYDEVICE SET_PLOT, 'PS' DEVICE, FILENAME = 'normalfrac_b.ps' PLOT, THRESHDN2, LINESTYLE = 1, YRANGE = [0, LIMIT4], $ XTITLE = 'line number', $ YTITLE = 'fraction > threshold per sec.' DEVICE, /CLOSE SET_PLOT, MYDEVICE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Composite Plots ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; histogram : PRINT, '_____________________________________________' PRINT, 'enter any number to view composite hisogram' PRINT, '_____________________________________________' READ, DHGFES SET_PLOT, MYDEVICE PLOT, COUNTS2, LINESTYLE =1, XTITLE = 'DN', YTITLE = 'total number' OPLOT, COUNTS, LINESTYLE = 2 XYOUTS, 180, 8E5, 'dotted = 560 sec. exp.' XYOUTS, 180, 9E5, 'dashed = 1200 sec. exp.' SET_PLOT, MYDEVICE SET_PLOT, 'PS' ; to printer DEVICE, FILENAME = 'hist_comp.ps' PLOT, COUNTS2, linestyle = 1, XTITLE = 'DN', YTITLE = 'total number' OPLOT, COUNTS, LINESTYLE = 2 XYOUTS, 180, 8E5, 'dotted = 560 sec. exp.' XYOUTS, 180, 9E5, 'dashed = 1200 sec. exp.' DEVICE, /CLOSE SET_PLOT, MYDEVICE ;;;;;;;;;;;;;;;;;;;;;;; limit y-range SET_PLOT, MYDEVICE PRINT, '________________' PRINT, 'limit y-range to?' PRINT, '________________' READ, LIMIT5 PLOT, COUNTS2, LINESTYLE = 1, YRANGE = [0, LIMIT5], XTITLE = 'DN', $ YTITLE = 'total number' OPLOT, COUNTS, LINESTYLE = 2 SET_PLOT, 'PS' DEVICE, FILENAME = 'limithist_comp.ps' PLOT, COUNTS2, LINESTYLE =1, YRANGE = [0, LIMIT5], XTITLE = 'DN', $ YTITLE = 'total number' OPLOT, COUNTS, LINESTYLE = 2 ;XYOUTS, 180, 250, 'Dotted = 560 sec. exp.' ;XYOUTS, 180, 275, 'dashed = 1200 sec. exp.' DEVICE, /CLOSE SET_PLOT, MYDEVICE ;SET_PLOT, 'PS' ;DEVICE, FILENAME = 'totalperdn_comp.ps' ;PLOT, COUNTS2, LINESTYLE = 1, XTITLE = 'DN', YTITLE = 'total number', $ ; TITLE = '1200 and 560 sec. WAC dark images' ;OPLOT, COUNTS, LINESTYLE = 2 ;XYOUTS, 180, 8E5, 'dotted = 560 sec. exp.' ;XYOUTS, 180, 9E5, 'dashed = 1200 sec. exp.' ;DEVICE, /CLOSE ;SET_PLOT, MYDEVICE ;SET_PLOT, 'PS' ;DEVICE, FILENAME = 'totallimit_comp.ps' ;PLOT, COUNTS2, LINESTYLE = 1, YRANGE = [0, 300], XTITLE = 'DN', $ ; YTITLE = 'total number', $ ; TITLE = '1200 and 560 sec. dark images ' ;OPLOT, COUNTS, LINESTYLE = 2 ;XYOUTS, 180, 250, 'dotted = 560 sec. exp.' ;XYOUTS, 180, 275, 'dashed = 1200 sec. exp.' ;DEVICE, /CLOSE ;SET_PLOT, MYDEVICE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Fraction above threshold: (not normailized) PRINT, '________________________________________________' PRINT, 'enter any number to view composite fraction plot' PRINT, '________________________________________________' READ, ASDFA SET_PLOT, mydevice ; this plots the fraction > threshold PLOT, TEMP, LINESTYLE = 2, $ XTITLE = 'line number', YTITLE = 'fraction greater than threshold' OPLOT, TEMP2, LINESTYLE =1 ;XYOUTS, 800, 0.13, 'dotted = 560 sec. exp.' ;XYOUTS, 800, 0.14, 'dashed = 1200 sec. exp.' ;to printer SET_PLOT, 'PS' DEVICE, FILENAME = 'proliles_comp.ps' PLOT, TEMP, LINESTYLE = 2, $ XTITLE = 'line number', YTITLE = 'fraction greater than threshold' OPLOT, TEMP2, LINESTYLE = 1 ;XYOUTS, 800, 0.13, 'dotted = 560 sec. exp.' ;XYOUTS, 800, 0.14, 'dashed = 1200 sec. exp.' DEVICE, /CLOSE SET_PLOT, MYDEVICE ; limit y-range of plots PRINT, '________________' PRINT, 'limit y-range to?' PRINT, '________________' READ, LIMIT6 SET_PLOT, mydevice ; this plots the fraction > threshold PLOT, TEMP, LINESTYLE = 2, YRANGE = [0, LIMIT6], $ XTITLE = 'line number', YTITLE = 'fraction greater than threshold' OPLOT, TEMP2, LINESTYLE =1 ;XYOUTS, 800, 0.13, 'dotted = 560 sec. exp.' ;XYOUTS, 800, 0.14, 'dashed = 1200 sec. exp.' SET_PLOT, 'PS' DEVICE, FILENAME = 'prolileslimit_comp.ps' PLOT, TEMP, LINESTYLE =2, YRANGE = [0, LIMIT6], $ XTITLE = 'line number', YTITLE = 'fraction greater than threshold' OPLOT, TEMP2, LINESTYLE =1 ;XYOUTS, 800, 0.13, 'dotted = 560 sec. exp.' ;XYOUTS, 800, 0.14, 'dashed = 1200 sec. exp.' DEVICE, /CLOSE SET_PLOT, MYDEVICE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; fraction above threshold (normailized) PRINT, '___________________________________________________' PRINT, 'enter any number to view normalized composite plots' PRINT, '___________________________________________________' READ, ASDKFHAL PLOT, THRESHDN, LINESTYLE = 2, $ XTITLE = 'line number', $ YTITLE = 'fraction > threshold per sec.' OPLOT, THRESHDN2, LINESTYLE =1 ;XYOUTS, 800, 4.5E-4, 'dotted = 560 sec. exp.' ;XYOUTS, 800, 4.8E-4, 'dashed = 1200 sec. exp.' SET_PLOT, MYDEVICE PRINT, '_______________________' PRINT, 'max y-range?' PRINT, '_______________________' READ, LIMIT7 SET_PLOT, MYDEVICE PLOT, THRESHDN, LINESTYLE = 2, YRANGE = [0, LIMIT7], $ XTITLE = 'line number', $ YTITLE = 'fraction > threshold per sec.' OPLOT, THRESHDN2, LINESTYLE =1 ;XYOUTS, 800, 4.5E-4, 'dotted = 560 sec. exp.' ;XYOUTS, 800, 4.8E-4, 'dashed = 1200 sec. exp.' SET_PLOT, MYDEVICE SET_PLOT, 'PS' DEVICE, FILENAME = 'norm_comp.ps' PLOT, THRESHDN, LINESTYLE = 2, YRANGE = [0, LIMIT7], $ XTITLE = 'line number', $ YTITLE = 'fraction > threshold per sec.' OPLOT, THRESHDN2, LINESTYLE =1 ;XYOUTS, 800, 4.5E-4, 'dotted = 560 sec. exp.' ;XYOUTS, 800, 4.8E-4, 'dashed = 1200 sec. exp.' DEVICE, /CLOSE SET_PLOT, MYDEVICE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Begin HAL image analysis ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;: PRINT, '______________________________________________' PRINT, 'Enter any number to continue to HAL image...' PRINT, '______________________________________________' READ, ihjrf ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Open the image file ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; OPENR, 1, 'n1357548370.raw' ;****** Enter raw data file name ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Image array size ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; XSIZE = 1024 ; pixels YSIZE = 1024 ; pixels C = BYTARR(XSIZE, YSIZE) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Read data into C ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; READU, 1, C ;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Close the file ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; CLOSE, 1 ;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Correct image orientation ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IMAGE3 = ROTATE(C, 7) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Display the image ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; WINDOW,0,XSIZE=1024, YSIZE=1024 TV, IMAGE3 SET_PLOT, MYDEVICE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Add row and column profiles ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;R3 = PROFILE(IMAGE3) ; (Choose method) ;WINDOW, /FREE ; < -- Allows user to choose ;profile start and end points ;PLOT, R3 PROFILES, IMAGE3 ; <-- Moving the mouse within the original image ; imteractively creates profile plots in the newly ; created profile window. Pressing the left mouse ; button toggles between row and column profile. ; The right mouse button exits. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Surface plot ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; PRINT, '_____________________________________' PRINT, 'Enter any number to view surface plot' PRINT, '_____________________________________' READ, YRKDG SHADE_SURF, IMAGE3, TITLE = 'shaded surface representation', $ ZTITLE = 'data number' SET_PLOT, 'PS' ; Set plot to printer DEVICE, FILENAME = 'shade_c.ps' SHADE_SURF, IMAGE3, TITLE = 'shaded surface representation', $ ; image name ZTITLE = 'data number' DEVICE, /CLOSE SET_PLOT, MYDEVICE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; create histogram ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; PRINT, '_______________________________________________' PRINT, 'Enter any number to view total data number plot' PRINT, '_______________________________________________' READ, wkshf M = 256L COUNTS3 = make_array(M) for j = 0L, M -1 do begin dntotals3 = where(IMAGE3 eq j, count) COUNTS3(j) = count PRINT, 'DN', j, '; Total elements = ', count endfor SET_PLOT, MYDEVICE PLOT, COUNTS3, XTITLE = 'DN', YTITLE = 'total number' SET_PLOT, MYDEVICE SET_PLOT, 'PS' DEVICE, FILENAME = 'totalperdn_c.ps' PLOT, COUNTS3, XTITLE = 'DN', YTITLE = 'total number' DEVICE, /CLOSE SET_PLOT, MYDEVICE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;; Limit Y-axis of total data number plot ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; PRINT, '_____________________________________________' PRINT, 'What would you like to limit the Y-axis to?' PRINT, '_____________________________________________' READ, LIMIT8 PRINT, 'Y-range = ', LIMIT8 PLOT, COUNTS3, YRANGE = [0, LIMIT8], XTITLE = 'DN', $ YTITLE = 'total number' SET_PLOT, MYDEVICE SET_PLOT, 'PS' DEVICE, FILENAME = 'totallimit_c.ps' PLOT, COUNTS3, YRANGE = [0, LIMIT8], XTITLE = 'DN', $ YTITLE = 'total number' DEVICE, /CLOSE SET_PLOT, MYDEVICE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;; Plot fraction > threshold DN per line (later latitude) ;;;;;;;;;;;;;;;;;;;;;;;;; PRINT, '_________________________________________________________' PRINT, 'Enter any number to view fraction DN > threshold per line' PRINT, '_________________________________________________________' READ, rkdi PRINT, 'What is the image exposure time in seconds?' ; Exposure time READ, EXPTIME3 PRINT, 'exposure time = ', EXPTIME3, ' seconds' PRINT, ' ' PRINT, '_________________________________________________________' PRINT, 'Choose threshold (0 - 255)' READ, THRESHOLD3 PRINT, 'Threshold = ', THRESHOLD3 PRINT, ' ' N = YSIZE LINES3 = MAKE_ARRAY(N) FOR I = 0, N -1 DO BEGIN SOMETHING3 = WHERE(IMAGE3[I, *] GT THRESHOLD3, COUNT) LINES3(I) = COUNT ENDFOR MX3 = WHERE(IMAGE3 GT THRESHOLD3, COUNT) TOTALABOVE3 = COUNT PRINT, ' ' PRINT, 'Total number greater than threshold = ', TOTALABOVE3 PRINT, ' ' TEMP3 = LINES3 / YSIZE ; finds fraction per line above threshold THRESHDN3 = TEMP3 / EXPTIME3 ; normalize for varying exposure times PRINT, '_____________________________________________________' PRINT, 'Enter any number to view non-normailzed fraction plot' PRINT, '_____________________________________________________' READ, wosur SET_PLOT, MYDEVICE PLOT, TEMP3, XTITLE = 'line number', YTITLE = 'fraction > threshold' PRINT, '________________________________________________' PRINT, 'Enter any number to view normailzed fraction plot' PRINT, '________________________________________________' READ, ekdiw PLOT, THRESHDN3, XTITLE = 'line number', $ YTITLE = 'fraction > threshold per sec.' SET_PLOT, MYDEVICE SET_PLOT, 'PS' DEVICE, FILENAME = 'nonnormalized_c.ps' PLOT, TEMP3, XTITLE = 'line number', YTITLE = 'fraction > threshold' DEVICE, /CLOSE PRINT, '________________________________________________' PRINT, 'Enter any number to view normailzed fraction plot' PRINT, '________________________________________________' READ, ekdiw PLOT, THRESHDN3, XTITLE = 'line number', $ YTITLE = 'fraction > threshold per sec.' SET_PLOT, MYDEVICE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;; Limit Y-range of plot fraction above threshold plot ;;;;;;;;;;;;;;;;;;;;;;;;;;; PRINT, '____________________________________________' PRINT, 'What would you like to limit the Y-axis to?' PRINT, '____________________________________________' READ, LIMIT9 PRINT, 'Y-range = ', LIMIT9 PLOT, THRESHDN3, YRANGE = [0, LIMIT9], XTITLE = 'line number', $ YTITLE = 'fraction > threshold per sec.' SET_PLOT, MYDEVICE SET_PLOT, 'PS' DEVICE, FILENAME = 'normalfrac_c.ps' PLOT, THRESHDN3, YRANGE = [0, LIMIT9], TITLE = '', $ XTITLE = 'line number', $ YTITLE = 'fraction > threshold per sec.' DEVICE, /CLOSE SET_PLOT, MYDEVICE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Composite all Plots ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; histogram : PRINT, '_____________________________________________' PRINT, 'enter any number to view composite hisogram' PRINT, '_____________________________________________' READ, DFRKCG SET_PLOT, MYDEVICE PLOT, COUNTS2, LINESTYLE = 1, XTITLE = 'DN', YTITLE = 'total number' OPLOT, COUNTS, LINESTYLE = 2 OPLOT, COUNTS3 XYOUTS, 180, 8.5E5, 'dotted = 560 sec. exp.' XYOUTS, 180, 8E5, 'solid =n1357547925.1' XYOUTS, 180, 9E5, 'dashed = 1200 sec. exp.' SET_PLOT, MYDEVICE SET_PLOT, 'PS' ; to printer DEVICE, FILENAME = 'hist_comp3.ps' PLOT, COUNTS2, LINESTYLE =1, XTITLE = 'DN', YTITLE = 'total number' OPLOT, COUNTS, LINESTYLE = 2 OPLOT, COUNTS3 XYOUTS, 180, 8.5E5, 'dotted = 560 sec. exp.' XYOUTS, 180, 8E5, 'solid =n1357547925.1' XYOUTS, 180, 9E5, 'dashed = 1200 sec. exp.' DEVICE, /CLOSE SET_PLOT, MYDEVICE ;;;;;;;;;;;;;;;;;;;;;;; limit y-range SET_PLOT, MYDEVICE PRINT, '________________' PRINT, 'limit y-range to?' PRINT, '________________' READ, LIMIT10 PRINT, 'Y-RANGE = ', LIMIT10 PLOT, COUNTS2, LINESTYLE = 1, YRANGE = [0, LIMIT10], XTITLE = 'DN', $ YTITLE = 'total number' OPLOT, COUNTS, LINESTYLE = 2 OPLOT, COUNTS3 SET_PLOT, 'PS' DEVICE, FILENAME = 'limithist_comp3.ps' PLOT, COUNTS2, LINESTYLE = 1, YRANGE = [0, LIMIT10], XTITLE = 'DN', $ YTITLE = 'total number' OPLOT, COUNTS, LINESTYLE = 2 OPLOT, COUNTS3 ;XYOUTS, 180, 250, 'dotted = 560 sec. exp.' ;XYOUTS, 180, 275, 'dashed = 1200 sec. exp.' DEVICE, /CLOSE SET_PLOT, MYDEVICE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Fraction above threshold: (not normailized) PRINT, '________________________________________________' PRINT, 'enter any number to view composite fraction plot' PRINT, '________________________________________________' READ, APEKDNF SET_PLOT, mydevice ; this plots the fraction > threshold PLOT, TEMP, LINESTYLE = 2, $ XTITLE = 'line number', YTITLE = 'fraction greater than threshold' OPLOT, TEMP2, LINESTYLE =1 OPLOT, TEMP3 ;XYOUTS, 800, 0.13, 'dotted = 560 sec. exp.' ;XYOUTS, 800, 0.14, 'dashed = 1200 sec. exp.' ;to printer SET_PLOT, 'PS' DEVICE, FILENAME = 'allproliles_comp.ps' PLOT, TEMP, LINESTYLE = 2, $ XTITLE = 'line number', YTITLE = 'fraction greater than threshold' OPLOT, TEMP2, LINESTYLE = 1 OPLOT, TEMP3 ;XYOUTS, 800, 0.13, 'dotted = 560 sec. exp.' ;XYOUTS, 800, 0.14, 'dashed = 1200 sec. exp.' DEVICE, /CLOSE SET_PLOT, MYDEVICE ; limit y-range of plots PRINT, '________________' PRINT, 'limit y-range to?' PRINT, '________________' READ, LIMIT11 PRINT, 'Y-RANGE = ', LIMIT11 SET_PLOT, mydevice ; this plots the fraction > threshold PLOT, TEMP, LINESTYLE = 2, YRANGE = [0, LIMIT11], $ XTITLE = 'line number', YTITLE = 'fraction greater than threshold' OPLOT, TEMP2, LINESTYLE =1 OPLOT, TEMP3 ;XYOUTS, 800, 0.13, 'dotted = 560 sec. exp.' ;XYOUTS, 800, 0.14, 'dashed = 1200 sec. exp.' SET_PLOT, 'PS' DEVICE, FILENAME = 'prolileslimit_all.ps' PLOT, TEMP, LINESTYLE =2, YRANGE = [0, LIMIT11], $ XTITLE = 'line number', YTITLE = 'fraction greater than threshold' OPLOT, TEMP2, LINESTYLE =1 OPLOT, TEMP3 ;XYOUTS, 800, 0.13, 'dotted = 560 sec. exp.' ;XYOUTS, 800, 0.14, 'dashed = 1200 sec. exp.' DEVICE, /CLOSE SET_PLOT, MYDEVICE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; fraction above threshold (normailized) PRINT, '___________________________________________________' PRINT, 'enter any number to view normalized composite plots' PRINT, '___________________________________________________' READ, EOSHEB PLOT, THRESHDN, LINESTYLE = 2, $ XTITLE = 'line number', $ YTITLE = 'fraction > threshold per sec.' OPLOT, THRESHDN2, LINESTYLE =1 OPLOT, THRESHDN3 ;XYOUTS, 800, 4.5E-4, 'dotted = 560 sec. exp.' ;XYOUTS, 800, 4.8E-4, 'dashed = 1200 sec. exp.' SET_PLOT, MYDEVICE PRINT, '______________' PRINT, 'max y-range?' PRINT, '______________' READ, LIMIT12 PRINT, 'max y-range = ', LIMIT12 PLOT, THRESHDN, LINESTYLE = 2, YRANGE = [0, LIMIT12], $ XTITLE = 'line number', $ YTITLE = 'fraction > threshold per sec.' OPLOT, THRESHDN2, LINESTYLE =1 OPLOT, THRESHDN3 ;XYOUTS, 800, 4.5E-4, 'dotted = 560 sec. exp.' ;XYOUTS, 800, 4.8E-4, 'dashed = 1200 sec. exp.' SET_PLOT, MYDEVICE SET_PLOT, 'PS' DEVICE, FILENAME = 'norm_all.ps' PLOT, THRESHDN, LINESTYLE = 2, YRANGE = [0, LIMIT12], $ XTITLE = 'line number', $ YTITLE = 'fraction > threshold per sec.' OPLOT, THRESHDN2, LINESTYLE =1 OPLOT, THRESHDN3 ;XYOUTS, 800, 4.5E-4, 'dotted = 560 sec. exp.' ;XYOUTS, 800, 4.8E-4, 'dashed = 1200 sec. exp.' DEVICE, /CLOSE SET_PLOT, MYDEVICE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; PRINT, '____________________________________________________' ;;;;;;;;;; PRINT, "That's all folks!" ;;;;;;;;;; PRINT, '____________________________________________________' ;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; END