PRO qImage_cw_WedgeSection, state, azimuthal=azimuthal, radial=radial ;+ ; NAME: ; qImage_cw_WedgeSection ; PURPOSE: ; Calculate cross section in the azimuthal or radial directions in a wedge ; CATEGORY: ; Compound widget qImage_cw ; CALLING SEQUENCE: ; qImage_cw_WedgeSection, state, f_values [, /radial, /azimuthal] ; INPUTS: ; state array[1]; type: structure ; qImage_cw state structure ; OPTIONAL INPUT PARAMETERS: ; /azimuthal if set then a cross section in the azimuthal direction is returned ; /radial if set then a cross section in the radial direction is returned ; if neither or both are specified then both cross sections ; are returned ; OUTPUTS: ; result array[4,*] or array[4,*,2]; type: float ; minimum, maximum, average and standard deviation are returned ; in array[0..3,*,*], respectively. ; If both /radial and /azimuthal then array[4,*,0] contains ; the azimuthal cross section and array[4,*,1] the azimuthal ; cross section. ; INCLUDE: @compile_opt.pro ; On error, return to caller ; CALLS: ; InitVar, qImage_cw_Box, qImage_cw_ZWedge, qImage_cw_Transform, qLine ; PROCEDURE: ; STATE INFO USED: ; state.img_wedge used to determine whether a valid wedge is available ; from the last call to qImage_cw_Update ; MODIFICATION HISTORY: ; FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ;- InitVar, azimuthal, /key InitVar, radial , /key ; Get the limits for the whole wedge in polar coordinates qImage_cw_Box, state, p_box=p_box, /get widget_control, state.wid_phi[2], get_value=phi_d & phi_d = abs(phi_d)/!radeg widget_control, state.wid_rad[2], get_value=rad_d wnr = -1 IF widget_info(state.wid_draw, /valid) THEN BEGIN widget_control, state.wid_draw, get_value=wnr wold = !d.window wset, wnr widget_control, state.wid_whitebox, get_uvalue=color color = color*!p.background+(1-color)*!p.color ENDIF IF azimuthal THEN BEGIN n = ceil( (p_box[2]+(2*!pi)*fix(p_box[2] LT p_box[0])-p_box[0])/phi_d ) f = fltarr(5,n) p = p_box[0]+phi_d*findgen(n+1) FOR i=0,n-1 DO BEGIN p_box = [[p[i],p_box[1]],[p[i+1],p_box[3]]] ; Wedge i in polar coordinates zpix = qImage_cw_ZWedge(state, p_box, zval=zval, wedge=wedge, /noupdate) IF wnr NE -1 THEN plots, qImage_cw_Transform(state, fromimage=wedge, /toscreen), /device, color=color, linestyle=2 f[*,i] = [zval[[2,0,1,3]], zpix] ENDFOR p = (p[0:n-1]+0.5*phi_d)*!radeg ytitle = ['Azimuth (degrees)','Pixel value','Minimum','Maximum','Std. Dev','# Pixels'] skip = [0,0,0,0,1,1] use_sigma = [0,1,0,0,0,0] sigma_index = [0,4,0,0,0,0] newyaxis = [0,1,0,0,1,1] linestyle = [0,0,1,1,2,3] ENDIF IF radial THEN BEGIN n = ceil( (p_box[3]-p_box[1])/rad_d ) f = fltarr(5,n) p = p_box[1]+rad_d*findgen(n+1) FOR i=0,n-1 DO BEGIN p_box = [[p_box[0],p[i]],[p_box[2],p[i+1]]] ; Wedge i in polar coordinates zpix = qImage_cw_ZWedge(state, p_box, zval=zval, wedge=wedge, /noupdate) IF wnr NE -1 THEN plots, qImage_cw_Transform(state, fromimage=wedge, /toscreen), /device, color=color, linestyle=2 f[*,i] = [zval[[2,0,1,3]], zpix] ENDFOR p = p[0:n-1]+0.5*rad_d ytitle = ['Radial distance (pixels)','Pixel value','Minimum','Maximum','Std. Dev','# Pixels'] skip = [0,0,0,0,1,1] use_sigma = [0,1,0,0,0,0] sigma_index = [0,4,0,0,0,0] newyaxis = [0,1,0,0,1,1] linestyle = [0,0,1,1,2,3] ENDIF IF wnr NE -1 THEN wset, wold qLine, [transpose(p), f], ytitle=ytitle, newyaxis=newyaxis, linestyle=linestyle, xmargin=[10,10], $ skip=skip, use_sigma=use_sigma, sigma_index=sigma_index RETURN & END