PRO qImage_Gain, state ;+ ; NAME: ; qImage_Gain ; PURPOSE: ; Assist qView widget in correcting for different gain through a sequence of images. ; CATEGORY: ; Widget qImage ; CALLING SEQUENCE: ; qImage_Gain, state ; INPUTS: ; state array[1]; type: structure ; qImage state structure ; OPTIONAL INPUT PARAMETERS: ; OUTPUTS: ; OPTIONAL OUTPUT PARAMETERS: ; INCLUDE: @compile_opt.pro ; On error, return to caller ; CALLS: ; qImage_cw_Box, qImage_cw_Update ; COMMON BLOCKS: ; SIDE EFFECTS: ; RESTRICTIONS: ; STILL UNDER DEVELOPMENT ; PROCEDURE: ; MODIFICATION HISTORY: ; FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ;- wid_child = widget_info(state.wid_qimage_cw, /child) widget_control, wid_child, get_uvalue=qimage_cw_state, /no_copy ; Save settings for geometric corrections. Then clear them: they ; are not applied to the background calculation. widget_control, qimage_cw_state.wid_smei, get_uvalue=smei_set IF smei_set THEN BEGIN widget_control, qimage_cw_state.wid_cos, get_uvalue=cos_set widget_control, qimage_cw_state.wid_cos, set_button=0, set_uvalue=0 ENDIF ; Background box box = state.boxes[*,*,1]-qimage_cw_state.img_offset#[1,1] ; Set background to zero. Set background box, Then update widget. widget_control, qimage_cw_state.wid_background, set_value=0 qImage_cw_Box, qimage_cw_state, box, /put qImage_cw_Update, qimage_cw_state zback = fltarr(4) FOR i=0,3 DO BEGIN widget_control, qimage_cw_state.wid_xyz[4+i], get_value=tmp zback[i] = tmp ENDFOR ; Reestablish settings for geometrical corrections. IF smei_set THEN BEGIN widget_control, qimage_cw_state.wid_cos, set_button=cos_set, set_uvalue=cos_set ENDIF ; Main normalization box box = state.boxes[*,*,0]-qimage_cw_state.img_offset#[1,1] ; Set background to background value just calculated. Set Box and update widget. widget_control, qimage_cw_state.wid_background, set_value=zback[2] qImage_cw_Box, qimage_cw_state, box, /put qImage_cw_Update, qimage_cw_state zbright = fltarr(4) FOR i=0,3 DO BEGIN widget_control, qimage_cw_state.wid_xyz[4+i], get_value=tmp zbright[i] = tmp ENDFOR widget_control, wid_child, set_uvalue=qimage_cw_state, /no_copy ; Set up the message to be send back to the qView widget. widget_control, state.wid_send, get_uvalue=receive widget_control, receive[0], send_event={QIMAGE_GAIN,ID:0L,TOP:0L,HANDLER:0L, $ GAINING:1, ZBACK:ZBACK, ZBRIGHT:ZBRIGHT} RETURN & END