PRO singleclickaction, event @cm_4mesh @cm_4data return ;------------------------------------------------------------ widget_control, event.id, get_uvalue = uval widget_control, event.top, get_uvalue = top_uvalue actionid = widget_info(event.top, find_by_uname = 'action') type = widget_info(actionid, /combobox_gettext) IF type NE 'plt' THEN return ; on active la bonne fenetre widget_control, event.id, get_value = win wset, win ; choix du type d''action case uval.press of 1:BEGIN coor = (convert_coord(uval.x[0], uval.y[0], /device, /to_data)) x = coor[0] y = coor[1] help, x, y oldgrid = vargrid CASE strupcase(vargrid) OF 'T':vargrid = 'F' 'W':vargrid = 'F' 'U':vargrid = 'V' 'V':vargrid = 'U' 'F':vargrid = 'T' ENDCASE grille, -1, glam, gphi, -1, nx, ny, nz, firstx, firsty, firstz, lastx, lasty, lastz vargrid = oldgrid ; define the corner of the cells in the clockwise direction IF keyword_set(key_periodic) AND nx EQ jpi THEN BEGIN x1 = glam[*, 0:ny-2] y1 = gphi[*, 0:ny-2] x2 = glam[*, 1:ny-1] y2 = gphi[*, 1:ny-1] x3 = shift(glam[*, 1:ny-1], -1, 0) y3 = shift(gphi[*, 1:ny-1], -1, 0) x4 = shift(glam[*, 0:ny-2], -1, 0) y4 = shift(gphi[*, 0:ny-2], -1, 0) ENDIF ELSE BEGIN x1 = glam[0:nx-2, 0:ny-2] y1 = gphi[0:nx-2, 0:ny-2] x2 = glam[0:nx-2, 1:ny-1] y2 = gphi[0:nx-2, 1:ny-1] x3 = glam[1:nx-1, 1:ny-1] y3 = gphi[1:nx-1, 1:ny-1] x4 = glam[1:nx-1, 0:ny-2] y4 = gphi[1:nx-1, 0:ny-2] ENDELSE glam = -1 ; free memory gphi = -1 ; free memory ; ; What is the longitude? WHILE x GT !x.range[1] DO x = x-360 WHILE x LT !x.range[0] DO x = x+360 IF x GT !x.range[1] THEN RETURN IF y GT !y.range[1] THEN RETURN IF y LT !y.range[0] THEN RETURN ; cell = inquad(x, y, x1, y1, x2, y2, x3, y3, x4, y4 $ , onsphere = key_onearth) ; x1 = -1 ; free memory y1 = -1 ; free memory x2 = -1 ; free memory y2 = -1 ; free memory x3 = -1 ; free memory y3 = -1 ; free memory x4 = -1 ; free memory y4 = -1 ; free memory IF cell[0] EQ -1 OR n_elements(cell) GT 1 THEN RETURN ; yy = cell[0]/(nx-1+key_periodic*(nx EQ jpi)) xx = cell[0] MOD (nx-1+key_periodic*(nx EQ jpi)) ; CASE strupcase(vargrid) OF 'T':BEGIN xx = xx+firstx+1 yy = yy+firsty+1 END 'W':BEGIN xx = xx+firstx+1 yy = yy+firsty+1 END 'U':BEGIN xx = xx+firstx yy = yy+firsty+1 END 'V':BEGIN xx = xx+firstx+1 yy = yy+firsty END 'F':BEGIN xx = xx+firstx yy = yy+firsty END ENDCASE ; bad = where(xx GE jpi) IF bad[0] NE -1 THEN BEGIN xx[bad] = xx[bad]-jpi yy[bad] = yy[bad]+1 ENDIF bad = where(yy GE jpj) IF bad[0] NE -1 THEN stop ; print, glamt[xx, yy], gphit[xx, yy] ; cmd = buildcmd(event.top, boxzoom = boxzoom) ; END ELSE: endcase RETURN end