;+ ; ; NAME: ; HXISHISTO ; ; PURPOSE: ; Make a histogram plot of a selected plot from the CPLOT display ; (# pixels vs. count rate/temperature/emission measure) ; ; CATEGORY: ; HXIS display ; ; CALLING SEQUENCE: ; HXISHISTO ; ; CALLED BY: ; HXISWIDGET ; ; CALLS TO: ; HXISAREA, HXISSTRLABEL, HXISGETWINDOW, HXISHARD ; ; INPUTS: ; none ; ; OPTIONAL INPUTS: ; none ; ; OPTIONAL OUTPUTS: ; none ; ; OUTPUTS: ; none ; ; COMMON BLOCKS: ; hxisarea.common ; hxiscolor.common ; hxisdata_info.common ; hxislayout.common ; hxiswindow.common ; localhisto ; ; PROCEDURE: ; If not already selected, the plot is selected using the mouse. ; The necessary quantities are extracted from the structure INFO and the ; array PROC_IMG ; ; SIDE EFFECTS: ; If info.hard is set then the plot is printed. ; ; RESTRICTIONS: ; none ; ; MODIFICATION HISTORY: ; NOV-1990, Paul Hick (ARC) ; MAR-1993, Elaine Einfalt (HSTX) - converted to widgets ;- pro hxisHISTo @hxisarea.common @hxiscolor.common @hxisdata_info.common @hxislayout.common @hxiswindow.common common localhisto, hist_bin, hist_field if not(info.hard) then begin error = 0 ; assume success if pixels(0) eq -1 then hxisarea, /select_plot, error=error if error then return hist_bin = bin hist_field = field endif info.cplot_up = 0 ; about to erase current window if not info.hard then hxisgetwindow $ ; Get a new window or reuse old one else hxishard, /fileopen, colo=info.colo ; ; Each BTYP gets it's own colored line ; colors = my_colors ; ; When doing hard copy to grayscale printer lines should be in black ; if info.hard and not(info.colo) then colors = colors * 0 A = hist_BIN*432 & X = PROC_IMG(A:A+431) hxisstrlabel, INFO.BTYP(hist_BIN), INFO.BLOW(hist_BIN), $ INFO.BUP(hist_BIN), CLAB, QUANT, A QUANT = QUANT+' ['+A+']' if hist_FIELD eq 0 then begin A = fltarr(20,20, /nozero) B = where(FPOS ne -1) & A(B) = X(FPOS(B)) A(where(FPOS eq -1)) = -1 ;The corners of the array ; outside the fov are set to -1 endif else begin A = fltarr(12,12, /nozero) B = where(CPOS ne -1) & A(B) = X(CPOS(B)) A(where(CPOS eq -1)) = -1 ;The corners of the array ; outside the fov are set to -1 endelse A = A(where(A gt 0)) & B = fix(min(A)) & C = fix(max(A)+1) X = B+.5+indgen(C-B+1) A = histogram(A,binsize=1,min=B,max=C) plot, X, A, /nodata, title=CLAB, xtitle=QUANT, ytitle='Number of pixels' oplot, X, A, PSYM=10, color=colors(info.btyp(hist_bin)) ; ; Plot complete, close and print. ; if info.hard then hxishard, /fileclose, colo=info.colo return & end