Changeset 125 for trunk/SRC/Interpolation/clickincell.pro
- Timestamp:
- 07/06/06 16:10:25 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/Interpolation/clickincell.pro
r121 r125 1 1 ;+ 2 ; @file_comments click on a map and find in which cell the click was 2 ; @file_comments 3 ; click on a map and find in which cell the click was 3 4 ; 4 5 ; @categories finding where is a point on a grid … … 9 10 ; points). 10 11 ; 11 ; @keyword /DRAWCELL to draw the cell in which we clicked12 ; @keyword DRAWCELL to draw the cell in which we clicked 12 13 ; 13 14 ; @keyword COLOR the color used to draw the cells (Clicking one more 14 15 ; time in the same cell will draw the cell with the white color) 15 16 ; 16 ; @keyword /ORIGINAL to get the position of the cell regarding the original17 ; @keyword ORIGINAL to get the position of the cell regarding the original 17 18 ; grid (with no key_shift, ixminmesh, iyminmesh...) 18 19 ; 19 ; @keyword /IJ see outpus20 ; @keyword IJ see outpus 20 21 ; 21 22 ; @keyword _EXTRA to pass extra keywords to inquad and plot (when /drawcell) … … 25 26 ; is in memory in the variable of the common. If /ij keyword is 26 27 ; activated give 2D array (2, n) which are the i,j position of the 27 ; n selected cells. 28 ; n selected cells. 28 29 ; 29 30 ; @uses common.pro 30 31 ; 31 ; @examples 32 ; @examples 32 33 ; 33 ; 34 ; IDL> res = clickincell() 34 35 ; Click with the left button to select a cell. Clicking one more 35 36 ; time in the same cell remove the cell from the selection. 36 ; Click on the right button to quit. 37 ; Click on the right button to quit. 37 38 ; 38 ; 39 ; 39 ; IDL> plt, findgen(jpi,jpj),/nodata,map=[90,0,0],/ortho 40 ; IDL> print, clickincell(/draw,color=150,/xy) 40 41 ; 41 42 ; @history … … 44 45 ; 45 46 ; @version $Id$ 46 ;47 47 ; 48 48 ;- … … 117 117 cellnum = [cellnum, cell] 118 118 selected = [selected, 1] 119 already = n_elements(selected)-1 119 already = n_elements(selected)-1 120 120 ENDIF ELSE selected[already] = 1-selected[already] 121 121 IF keyword_set(drawcell) THEN BEGIN … … 129 129 2: ; middle button 130 130 ELSE: 131 ENDCASE 131 ENDCASE 132 132 ; get mousse position on the reference map 133 133 outwhile: … … 136 136 ; 137 137 good = where(selected NE 0) 138 IF good[0] EQ -1 THEN RETURN, -1 138 IF good[0] EQ -1 THEN RETURN, -1 139 139 ; 140 140 cellnum = cellnum[good] … … 183 183 ENDIF 184 184 ; 185 ncell = n_elements(xx) 185 ncell = n_elements(xx) 186 186 IF keyword_set(ij) THEN $ 187 187 RETURN, [reform(xx, 1, ncell, /over) $ 188 , reform(yy, 1, ncell, /over)] 188 , reform(yy, 1, ncell, /over)] 189 189 ; 190 190 IF keyword_set(original) THEN RETURN, xx+jpiglo*yy $ 191 ELSE RETURN, xx+jpi*yy 192 END 191 ELSE RETURN, xx+jpi*yy 192 END
Note: See TracChangeset
for help on using the changeset viewer.