pro AstroIM_event, ev COMPILE_OPT hidden WIDGET_CONTROL, ev.TOP, GET_UVALUE=pile common commonAstroIM, cPath, cTask, cConf ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--- TAG --- I -- Drawing - Click Events -----------------------; ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--- TAG --- II -- Button Events -----------------------; ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--II.1-- General Directory Buttons ----------------------------------------------------- ;--II.1.1-- Change Root Directory Button ------------------------------------------------ if (ev.ID eq pile.b.path.mov) then begin cPath.root = dialog_pickfile( /DIRECTORY ) WIDGET_CONTROL, pile.f.path.root, SET_VALUE=cPath.root spawn, 'ls -d '+cPath.root+'*/', dir nbNight = n_elements(dir) for k=0, nbNight-1 do dir(k) = strmid(dir(k),strlen(cPath.root),strlen(dir(k))-strlen(cPath.root)-1) *cPath.dir = dir endif ;--II.1.2-- Refresh Content Button ----------------------------------------------------- if (ev.ID eq pile.b.path.ref) then begin spawn, 'ls -d '+cPath.root+'*/', dir nbNight = n_elements(dir) for k=0, nbNight-1 do dir(k) = strmid(dir(k),strlen(cPath.root),strlen(dir(k))-strlen(cPath.root)-1) *cPath.dir = dir endif ;--II.1.3-- Select Night List ---------------------------------------------------------- if (ev.ID eq pile.f.path.dir) then begin WIDGET_CONTROL, ev.ID, get_value=values dir = *cPath.dir dates = dir(where(values eq 1)) pile.f.path.night = values *cPath.night = dates endif ;--II.2-- Task Selection Buttons -------------------------------------------------------- ;--II.2.1-- Calibration File Processing if (ev.ID eq pile.b.task.cal) then begin WIDGET_CONTROL, ev.ID, get_value=values cTask.cal = values endif ;--II.2.2-- Science Frame Reduction if (ev.ID eq pile.b.task.sci) then begin WIDGET_CONTROL, ev.ID, get_value=values cTask.sci = values endif ;--II.2.3-- Satellite Search & Astrometry if (ev.ID eq pile.b.task.sat) then begin WIDGET_CONTROL, ev.ID, get_value=values cTask.sat = values endif ;--II.x-- General Action Buttons -------------------------------------------------------- ;--II.x.1-- Quit AstroIM if (ev.ID eq pile.b.action.quit) then begin WIDGET_CONTROL, /DESTROY, ev.TOP endif ;--II.x.2-- Launch the Binary or Redim Commands if (ev.ID eq pile.b.action.run) then begin ;--II.x.2/A-- Gather Configuration Values ;--II.x.2/A.1-- Bad-Pixel Treatment WIDGET_CONTROL, pile.f.conf.mask.yn, get_value=vYN WIDGET_CONTROL, pile.f.conf.mask.hot, get_value=vHOT WIDGET_CONTROL, pile.f.conf.mask.dead, get_value=vDEAD WIDGET_CONTROL, pile.f.conf.mask.width, get_value=vWIDTH WIDGET_CONTROL, pile.f.conf.mask.user, get_value=vUSER WIDGET_CONTROL, pile.f.conf.mask.file, get_value=vFILE maskINFO = {yn:1-vYN, file:vFILE(0), user:1-vUSER, sigma:float([vHOT,vDEAD]), width:round(float(vWIDTH(0)))} ;--II.x.2/A.2-- Fringes Treatment WIDGET_CONTROL, pile.f.conf.fringe.yn, get_value=vYN WIDGET_CONTROL, pile.f.conf.fringe.cp, get_value=vCP fringesINFO = {yn:1-vYN, cp: vCp(0)} ;--II.x.2/A.3-- Stripe Treatment WIDGET_CONTROL, pile.f.conf.stripe.yn, get_value=vYN WIDGET_CONTROL, pile.f.conf.stripe.dir, get_value=vDIR if vDir(0) eq 0 then begin if vDir(1) eq 0 then dir='none' $ else dir='vert' endif else begin if vDir(1) eq 0 then dir='hor' $ else dir='both' endelse WIDGET_CONTROL, pile.f.conf.stripe.mode, get_value=vMODE if vMODE eq 1 then mode='fine' else mode='median' WIDGET_CONTROL, pile.f.conf.stripe.samp, get_value=vSAMP WIDGET_CONTROL, pile.f.conf.stripe.cosmic, get_value=vCOSM stripeINFO = {yn:1-vYN, dir:dir, mode:mode, samp:vSAMP(0), cosmic:float(vCOSM(0)) } print, '' print, '---- Mask INFO ----' help, maskINFO, /STR print, '---- Fringes INFO ----' help, fringesINFO, /STR print, '---- Stripes INFO ----' help, stripeINFO,/STR ; print, cPath.dir ; print, pile.f.path.night dates = cPath.dir(where(pile.f.path.night eq 1)) ; help, cPath.root, dates, $ ; cTask.cal(0), $ ; cTask.cal(1), $ ; maskINFO, $ ; fringesINFO, $ ; stripeINFO, $ ; cTask.cal(0), $ ; cTask.sci(0), $ ; cTask.sci(1) ; print, 'redim, '+cPath.root+','+$ ; ' dates=[XXX], '+$ ; ' doMEDIAN='+string(cTask.cal(0),format='(I1)')+ ',' +$ ; ' doMASK='+string(cTask.cal(1),format='(I1)')+ ',' +$ ; ' maskINFO=maskINFO'+ ',' +$ ; ' fringesINFO=fringesINFO'+ ',' +$ ; ' doCALIBRATION='+string(cTask.cal(2),format='(I1)')+ ',' +$ ; ' doSCIENCE='+string(cTask.sci(0),format='(I1)')+ ',' +$ ; ' doALIGN='+string(cTask.sci(1),format='(I1)') ; ; tree = strsplit(cPath.root, '/', count=nbTree, /EXTRACT) redimProj = tree(nbTree-1) redimRoot = strmid(cPath.root,0,strlen(cPath.root)-strlen(redimProj)-1) workINFO={root:redimRoot} ; help, *cPath.night ; print, *cPath.night redim, redimProj, dates=*cPath.night, $ doMEDIAN=cTask.cal(0), $ doMASK=cTask.cal(1), $ maskINFO=maskINFO, $ fringesINFO=fringesINFO, $ stripeINFO=stripeINFO, $ doCALIBRATION=cTask.cal(2), $ doSCIENCE=cTask.sci(0), $ doALIGN=cTask.sci(1), $ workINFO=workINFO ; print, 'binary, '+$ ; ' doDC='+string(cTask.sat(0),format='(I1)')+ ',' +$ ; ' doASTRO='+string(cTask.sat(1),format='(I1)') ; endif end