Changeset 224
- Timestamp:
- 03/15/07 11:22:28 (17 years ago)
- Location:
- trunk/SRC
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/ReadWrite/ncdf_getaxis.pro
r221 r224 25 25 ; 26 26 ; @keyword START1 {default=0}{type=scalar: 0 or 1} 27 ; Index the axis from 1 instead of 0 when using /xyindex 28 ; 29 ; @keyword XDI RNAME {default='longitude', 'lon', 'x', 'longitude*', 'lon*', 'x*', '*longitude*', '*lon*' or '*x*'}{type=scalar string}27 ; Index the axis from 1 instead of 0 when using /xyindex 28 ; 29 ; @keyword XDIMNAME {default='longitude', 'lon', 'x', 'longitude*', 'lon*', 'x*', '*longitude*', '*lon*' or '*x*'}{type=scalar string} 30 30 ; A string giving the name of the x dimension 31 ; 32 ; @keyword YDI RNAME {default='latitude', 'lat', 'y', 'latitude*', 'lat*', 'y*', 'eta_*', '*latitude*', '*lat*', '*y*'}{type=scalar string}31 ; 32 ; @keyword YDIMNAME {default='latitude', 'lat', 'y', 'latitude*', 'lat*', 'y*', 'eta_*', '*latitude*', '*lat*', '*y*'}{type=scalar string} 33 33 ; A string giving the name of the y dimension 34 ; 34 ; 35 35 ; @keyword XAXISNAME {default='x', 'longitude', 'nav_lon', 'lon', 'lon_rho' or 'NbLongitudes'}{type=scalar string} 36 ; A string giving the name of the variable in the file 37 ; that contains the [xyz]axis. 38 ; 36 ; A string giving the name of the variable in the file 37 ; that contains the [xyz]axis. 38 ; 39 39 ; @keyword YAXISNAME {default='y', 'latitude', 'nav_lat','lat', 'lat_rho' or 'NbLatitudes'}{type=scalar string} 40 ; A string giving the name of the variable in the file 41 ; that contains the [xyz]axis. 40 ; A string giving the name of the variable in the file 41 ; that contains the [xyz]axis. 42 42 ; 43 43 ; @keyword XYINDEX {default=0}{type=scalar: 0 or 1} 44 44 ; To define the x/y axis with index instead of using 45 ; the values contained in X/YAXISNAME. 46 ; x/yaxis = keyword_set(start1) + findgen(jpi/jpj) 45 ; the values contained in X/YAXISNAME. 46 ; x/yaxis = keyword_set(start1) + findgen(jpi/jpj) 47 47 ; 48 48 ; @keyword XYINDEX {default=0}{type=scalar: 0 or 1} … … 72 72 namedim = strarr(inside.ndims) 73 73 for dimiq = 0, inside.ndims-1 do begin 74 ncdf_diminq, cdfid, dimiq, tmpname, value 74 ncdf_diminq, cdfid, dimiq, tmpname, value 75 75 namedim[dimiq] = strlowcase(tmpname) 76 76 ENDFOR … … 89 89 OR namevar EQ 'nav_lon' OR namevar EQ 'lon' $ 90 90 OR namevar EQ 'lon_rho' OR namevar EQ 'nblongitudes'))[0] 91 ; no xaxis variable found, we will build a fake xaxis based on the size of the x dimension 91 ; no xaxis variable found, we will build a fake xaxis based on the size of the x dimension 92 92 ; -> we must find the x dimension 93 93 IF xvarid EQ -1 THEN BEGIN … … 124 124 ENDCASE 125 125 ENDIF 126 romsgrid = 0b 127 ENDIF ELSE BEGIN 126 romsgrid = 0b 127 ENDIF ELSE BEGIN 128 128 romsgrid = strmid(namevar[xvarid], 0, 4) EQ 'lon_' 129 129 xinq = ncdf_varinq(cdfid, xvarid) … … 135 135 ncdf_diminq, cdfid, dimidx, blabla, jpifromx 136 136 ; should we read or compute the xaxis? 137 IF keyword_set(xyindex) OR xvarid EQ -1 THEN BEGIN 137 IF keyword_set(xyindex) OR xvarid EQ -1 THEN BEGIN 138 138 xaxis = keyword_set(start1) + findgen(jpifromx) 139 139 xyindex = 1 … … 143 143 ; make sure of the shape of xaxis 144 144 IF n_elements(jpjfromx) NE 0 THEN xaxis = reform(xaxis, jpifromx, jpjfromx, /over) 145 ENDELSE 145 ENDELSE 146 146 ENDIF 147 147 … … 154 154 OR namevar EQ 'lat_rho' OR namevar EQ 'nblatitudes'))[0] 155 155 yvarid = yvarid[0] 156 ; no yaxis variable found, we will build a fake yaxis based on the size of the y dimension 156 ; no yaxis variable found, we will build a fake yaxis based on the size of the y dimension 157 157 ; -> we must find the y dimension 158 158 if yvarid EQ -1 then begin … … 189 189 ENDCASE 190 190 ENDIF 191 ENDIF ELSE BEGIN 191 ENDIF ELSE BEGIN 192 192 yinq = ncdf_varinq(cdfid, yvarid) 193 193 IF yinq.ndims GE 2 THEN BEGIN 194 194 ncdf_diminq, cdfid, yinq.dim[0], blabla, jpifromy 195 IF jpifromy NE jpifromx THEN BEGIN 195 IF jpifromy NE jpifromx THEN BEGIN 196 196 dummy = report('x/y axes do not have the same x dimension...') 197 197 stop … … 204 204 ncdf_diminq, cdfid, dimidy, blabla, jpjfromy 205 205 IF n_elements(jpjfromx) NE 0 THEN BEGIN 206 IF jpjfromy NE jpjfromx THEN BEGIN 206 IF jpjfromy NE jpjfromx THEN BEGIN 207 207 dummy = report(' x/y axes do not have the same y dimension...') 208 208 stop 209 ENDIF 209 ENDIF 210 210 ENDIF 211 211 ; should we read or compute the xaxis? 212 IF keyword_set(xyindex) OR yvarid EQ -1 THEN BEGIN 212 IF keyword_set(xyindex) OR yvarid EQ -1 THEN BEGIN 213 213 yaxis = keyword_set(start1) + findgen(jpjfromy) 214 214 ENDIF ELSE BEGIN -
trunk/SRC/ToBeReviewed/CALCULS/hdyn.pro
r163 r224 5 5 ; 6 6 ; @file_comments 7 ; Calculate the height by rapport to a reference state for a depth reference. 8 ; See keywords for different possibilities. By default, the state reference 9 ; is rho=1020 and the depth reference is gdepw[ka] with ka the first W level 10 ; directly above 1000 m. 7 ; Calculate the height by rapport to a reference state for a depth reference. 8 ; See keywords for different possibilities. By default, the state reference 9 ; is rho=1020 and the depth reference is gdepw[ka] with ka the first W level 10 ; directly above 1000 m. 11 11 ; 12 12 ; @categories … … 17 17 ; 18 18 ; @param TABTN {in}{required} 19 ; array representing the temperature. Has the same size than SN19 ; array representing the temperature. Has the same size than SN. 20 20 ; 21 ; @keyword GILL We activate this key if we want to calculate the dynamic height 22 ; like in the GILL page 215, which means by rapport to a reference state which 23 ; vary in depth and which is determined by a reference temperature tref at 0°C 24 ; and a reference salinity sref at 35psu 21 ; @keyword GILL 22 ; We activate this key if we want to calculate the dynamic height 23 ; like in the GILL page 215, which means by rapport to a reference state which 24 ; vary in depth and which is determined by a reference temperature tref at 0°C 25 ; and a reference salinity sref at 35 psu. 25 26 ; 26 27 ; @keyword LEVEL 27 ; It is the same reference level to take. This level is defined like 28 ; It is the same reference level to take. This level is defined like 28 29 ; that gdepw[level] is the reference depth 30 ; 31 ; @keyword SREF 32 ; Give a value to this keyword to change the reference salinity used in the 33 ; calculation when GILL is activated. 29 34 ; 30 ; @keyword SREF31 ; Give a value to this keyword to change the reference salinity used in the32 ; calculation when GILL is activated.33 ;34 35 ; @keyword TREF 35 ; Give a value to this keyword to change the reference temperature used in the 36 ; calculation when GILL 37 ; 36 ; Give a value to this keyword to change the reference temperature used in the 37 ; calculation when GILL is activated. 38 ; 38 39 ; @keyword PROFREF 39 ; Give a depth to this keyword which will be considered as the reference depth 40 ; (in this case, LEVEL has not any effect). the calculation will be effectuated 41 ; until this depth effecting an interpolation between the the last W level above 40 ; Give a depth to this keyword which will be considered as the reference depth 41 ; (in this case, LEVEL has not any effect). the calculation will be effectuated 42 ; until this depth effecting an interpolation between the the last W level above 42 43 ; PROFREF and PROFREF. 43 44 ; … … 46 47 ; 47 48 ; @returns 48 ; An array of the same size of sn and tn representing the dynamic height calculated 49 ; An array of the same size of sn and tn representing the dynamic height calculated 49 50 ; from a reference depth nd by rapport to a reference state. 50 51 ; 51 ; @uses 52 ; @uses 52 53 ; common.pro 53 54 ; 54 55 ; @restrictions 55 ; Points for which we can not calculate the dynamic height (whose the batymetry 56 ; Points for which we can not calculate the dynamic height (whose the batymetry 56 57 ; is less deep than the reference depth) are put at the value !values.f_nan 57 58 ; 58 59 ; @restrictions 59 ; approximation: The pressure in decibars is equal to the depth in meters (the pressure increase of 1bar all 10m) 60 ; approximation: The pressure in decibars is equal to the depth in meters 61 ; (the pressure increase of 1 bar every 10 m) 60 62 ; 61 63 ; @history … … 69 71 ;------------------------------------------------------------ 70 72 ;------------------------------------------------------------ 71 FUNCTION hdyn, tabsn, tabtn, TREF = tref,SREF = sref, PROFREF = profref, LEVEL = level, GILL = gill, SURFACE_LEVEL = surface_level73 FUNCTION hdyn, tabsn, tabtn, TREF = tref, SREF = sref, PROFREF = profref, LEVEL = level, GILL = gill, SURFACE_LEVEL = surface_level 72 74 ; 73 75 compile_opt idl2, strictarrsubs … … 85 87 level = level-1 86 88 za = gdepw[level] 87 ENDIF ELSE BEGIN 88 if NOT keyword_set(level) then BEGIN 89 ENDIF ELSE BEGIN 90 if NOT keyword_set(level) then BEGIN 89 91 rien = where(gdepw LE 1000., level) 90 92 level = level-1 … … 92 94 profref = gdepw[level] 93 95 za = profref 94 ENDELSE 96 ENDELSE 95 97 tailles = size(tabsn) 96 98 taillet = size(tabtn) 97 99 if total(tailles[0:tailles[0]] NE taillet[0:taillet[0]]) NE 0 then $ 98 return, report(' Les tableaux sn et tn doivent avoir la meme taille')99 if tailles[3] NE jpk then return, report(' La dim verticale des tableaux sn et tn doit etre egalre ajpk')100 return, report('arrays sn and tn must have the same size') 101 if tailles[3] NE jpk then return, report('vertical dimension of sn and tn arrarrays must be equal to jpk') 100 102 nx = nxt 101 103 ny = nyt 102 104 case (size(tabsn))[0] OF 103 3:BEGIN 105 3:BEGIN 104 106 case 1 of 105 107 tailles[1] eq jpi and tailles[2] eq jpj: BEGIN … … 107 109 tn = tabtn[firstxt:lastxt, firstyt:lastyt, *] 108 110 end 109 tailles[1] eq nx and tailles[2] eq ny:BEGIN 111 tailles[1] eq nx and tailles[2] eq ny:BEGIN 110 112 sn = tabsn 111 113 tn = tabtn … … 128 130 endcase 129 131 END 130 4:BEGIN 132 4:BEGIN 131 133 case 1 of 132 134 tailles[1] eq jpi and tailles[2] eq jpj AND tailles[4] EQ jpt: BEGIN … … 134 136 tn = tabtn[firstxt:lastxt, firstyt:lastyt, *, *] 135 137 end 136 tailles[1] eq nx and tailles[2] eq ny AND tailles[4] EQ jpt:BEGIN 138 tailles[1] eq nx and tailles[2] eq ny AND tailles[4] EQ jpt:BEGIN 137 139 sn = tabsn 138 140 tn = tabtn … … 158 160 endcase 159 161 END 160 ELSE: return, report(' cas non code')162 ELSE: return, report('not implemented') 161 163 ENDCASE 162 164 varunit = 'cm' 163 165 varname = 'Dynamic Height (href='+strtrim(round(profref), 1)+'m)' 164 IF keyword_set(key_performance) THEN print, 'temps hdyn', systime(1)-tempsun 166 IF keyword_set(key_performance) THEN print, 'temps hdyn', systime(1)-tempsun 165 167 166 168 return, hdyn -
trunk/SRC/ToBeReviewed/CALCULS/level2depth.pro
r163 r224 17 17 ; To do not mask land points. 18 18 ; 19 ; @returns 19 ; @returns 20 20 ; 2d array containing depths 21 21 ; … … 50 50 ;--------------------------------------------------------------- 51 51 taille = size(niveaux) 52 if taille[0] NE 2 then return, report(' le champ en entree doit contenir un tableau 2d')52 if taille[0] NE 2 then return, report('input field must be a 2d array') 53 53 case 1 of 54 54 taille[1] eq jpi and taille[2] eq jpj:niveaux=niveaux[firstx:lastx, firsty:lasty] … … 73 73 endif 74 74 ; 75 if keyword_set(key_performance) THEN print, 'temps level2depth', systime(1)-tempsun 75 if keyword_set(key_performance) THEN print, 'temps level2depth', systime(1)-tempsun 76 76 return, gdep 77 77 end -
trunk/SRC/ToBeReviewed/CALCULS/projectondepth.pro
r163 r224 71 71 endcase 72 72 case 1 OF 73 taillearray[3] NE jpk:return, report(' Le tableau 3d doit avoir sa 3eme dimension egale ajpk')73 taillearray[3] NE jpk:return, report('2d array must have its 3d dimension equal to jpk') 74 74 taillearray[1] eq jpi and taillearray[2] eq jpj:array=array[firstx:lastx, firsty:lasty, *] 75 75 taillearray[1] eq nx and taillearray[2] eq ny: -
trunk/SRC/Utilities/createfunc.pro
r136 r224 32 32 ; IDL> , kwdlist ='two = two', two = 2) 33 33 ; 34 ; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) 34 ; @history 35 ; Sebastien Masson (smasson\@lodyc.jussieu.fr) 35 36 ; May 2005 36 37 ; 37 ; @version $Id$ 38 ; @version 39 ; $Id$ 38 40 ; 39 41 ;- -
trunk/SRC/Utilities/createpro.pro
r163 r224 38 38 ; IDL> , filename = 'test', kwdlist = ', ok = ok', /ok 39 39 ; 40 ; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) 40 ; @history 41 ; Sebastien Masson (smasson\@lodyc.jussieu.fr) 41 42 ; cleaning + new keywords: October 2005 42 43 ; Feb. 2006: supress keyword "kwdused" and use call_procedure instead of execute 43 44 ; 44 ; @version $Id$ 45 ; @version 46 ; $Id$ 45 47 ;- 46 48 ;------------------------------------------------------------ -
trunk/SRC/Utilities/def_myuniquetmpdir.pro
r157 r224 10 10 ; IDL> def_myuniquetmpdir 11 11 ; 12 ; @uses cm_general 12 ; @uses 13 ; cm_general 13 14 ; 14 ; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) 15 ; @history 16 ; Sebastien Masson (smasson\@lodyc.jussieu.fr) 15 17 ; June 2005 16 18 ; 17 ; @version $Id$ 19 ; @version 20 ; $Id$ 18 21 ; 19 22 ;- -
trunk/SRC/Utilities/demomode_compatibility.pro
r157 r224 1 1 ;+ 2 ; @categories Utilities 3 ; @uses cm_general 4 ; @version $Id$ 2 ; @categories 3 ; Utilities 4 ; 5 ; @uses 6 ; cm_general 7 ; 8 ; @version 9 ; $Id$ 5 10 ;- 6 11 PRO demomode_compatibility -
trunk/SRC/Utilities/find.pro
r163 r224 11 11 ; all file_search keywords can be used. 12 12 ; 13 ; @categories find a file 13 ; @categories 14 ; find a file 14 15 ; 15 16 ; @param FILEIN {in}{required} … … 99 100 ; /usr/local/rsi/idl_6.0/lib/mesh_obj.pro 100 101 ; 101 ; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) 102 ; @history 103 ; Sebastien Masson (smasson\@lodyc.jussieu.fr) 102 104 ; 28/4/1999 103 105 ; 6/7/1999: compatibility mac and windows 104 106 ; June 2005: Sebastien Masson: cleaning, use for file_* functions 105 107 ; 106 ; @version $Id$ 108 ; @version 109 ; $Id$ 107 110 ;- 108 111 ;------------------------------------------------------------ -
trunk/SRC/Utilities/fitintobox.pro
r163 r224 4 4 ;+ 5 5 ; 6 ; @file_comments 6 ; @file_comments 7 7 ; Check that the input array has size and dimensions 8 8 ; compatible with the domain that was defined with the previous call 9 9 ; of domdef. 10 10 ; 11 ; @categories 11 ; @categories 12 12 ; Compatibility 13 ; 14 ; @param sz {in}{required} 15 ; 13 ; 14 ; @param sz {in}{required} 15 ; 16 16 ; @param nx {in}{required} 17 17 ; … … 25 25 ; 26 26 ; @param jpk {in}{required} 27 ; 27 ; 28 28 ; @param jpt {in}{required} 29 29 ; 30 ; @returns -1 31 ; 32 ; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) 30 ; @returns 31 ; -1 32 ; 33 ; @history 34 ; Sebastien Masson (smasson\@lodyc.jussieu.fr) 33 35 ; 10 juin 2000. 34 36 ; June 2005: S. Masson rewrite all. 35 37 ; 36 ; @version $Id$ 38 ; @version 39 ; $Id$ 37 40 ; 38 41 ; @hidden … … 57 60 RETURN, report(['Error: ' $ 58 61 , 'the array dimensions ' + tostr(sz) + ' are incompatible' $ 59 , 'with the the domain dimensions ' $ 62 , 'with the the domain dimensions ' $ 60 63 , '[jpi/nx, jpj/ny, jpk/nz, jpt] = [' $ 61 64 + strtrim(jpi, 1) + '/' + strtrim(nx, 1) $ … … 67 70 ;+ 68 71 ; 69 ; @categories 72 ; @categories 70 73 ; Compatibility 71 74 ; 72 75 ; @param field {in}{required}{type=array or struct} 73 ; an array or a structure that can be read by the function 76 ; an array or a structure that can be read by the function 74 77 ; litchamp.pro 75 ; 78 ; 76 79 ; @param nx {in}{optional}{default=define by grille.pro} 77 80 ; … … 92 95 ; @param lastz {in}{optional}{default=define by grille.pro} 93 96 ; 94 ; @keyword WDEPTH 97 ; @keyword WDEPTH 95 98 ; To specify that we are at W level 96 99 ; 97 ; @returns 100 ; @returns 98 101 ; an array with dimensions matching the domain 99 102 ; or -1 if there is an error... … … 102 105 ; @uses cm_4cal 103 106 ; 104 ; @examples 107 ; @examples 105 108 ; IDL> help, fitintobox(findgen(jpi,jpj)) 106 109 ; <Expression> FLOAT = Array[41, 3] 107 110 ; IDL> help, fitintobox(findgen(jpi,jpj,78)) 108 ; Error: 111 ; Error: 109 112 ; the array dimensions [180,148,78] are incompatible 110 ; with the the domain dimensions 113 ; with the the domain dimensions 111 114 ; [jpi/nx, jpj/ny, jpk/nz, jpt] = [180/41, 148/3, 31/31, 1] 112 115 ; <Expression> INT = -1 113 116 ; 114 ; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) 117 ; @history 118 ; Sebastien Masson (smasson\@lodyc.jussieu.fr) 115 119 ; 10 juin 2000. 116 120 ; June 2005: S. Masson rewrite all. 117 121 ; 118 ; @version $Id$ 122 ; @version 123 ; $Id$ 119 124 ;- 120 125 ;------------------------------------------------------------ … … 152 157 CASE 1 OF 153 158 ; x arrays 154 sz[1] EQ jpi :arr = (temporary(arr))[firstx:lastx ] 155 sz[1] EQ nx : 159 sz[1] EQ jpi :arr = (temporary(arr))[firstx:lastx ] 160 sz[1] EQ nx : 156 161 ; y arrays 157 sz[1] EQ jpj :arr = (temporary(arr))[ firsty:lasty ] 158 sz[1] EQ ny : 162 sz[1] EQ jpj :arr = (temporary(arr))[ firsty:lasty ] 163 sz[1] EQ ny : 159 164 ; z arrays 160 sz[1] EQ jpk :arr = (temporary(arr))[ firstz:lastz ] 161 sz[1] EQ nz : 165 sz[1] EQ jpk :arr = (temporary(arr))[ firstz:lastz ] 166 sz[1] EQ nz : 162 167 ; t arrays 163 168 sz[1] EQ jpt : 164 ELSE:return, err_mess(sz[1], jpi, nx, jpj, ny, jpk, nz, jpt) 169 ELSE:return, err_mess(sz[1], jpi, nx, jpj, ny, jpk, nz, jpt) 165 170 ENDCASE 166 171 END … … 170 175 CASE 1 OF 171 176 ; xy arrays 172 sz[1] EQ jpi AND sz[2] EQ jpj :arr = (temporary(arr))[firstx:lastx, firsty:lasty ] 177 sz[1] EQ jpi AND sz[2] EQ jpj :arr = (temporary(arr))[firstx:lastx, firsty:lasty ] 173 178 sz[1] EQ jpi AND sz[2] EQ ny :arr = (temporary(arr))[firstx:lastx, * ] 174 179 sz[1] EQ nx AND sz[2] EQ jpj :arr = (temporary(arr))[ *, firsty:lasty ] 175 180 sz[1] EQ nx AND sz[2] EQ ny :arr = (temporary(arr))[ *, * ] 176 181 ; x(y)z arrays 177 sz[1] EQ jpi AND ny EQ 1 AND sz[2] EQ jpk :arr = (temporary(arr))[firstx:lastx, firstz:lastz ] 182 sz[1] EQ jpi AND ny EQ 1 AND sz[2] EQ jpk :arr = (temporary(arr))[firstx:lastx, firstz:lastz ] 178 183 sz[1] EQ jpi AND ny EQ 1 AND sz[2] EQ nz :arr = (temporary(arr))[firstx:lastx, * ] 179 184 sz[1] EQ nx AND ny EQ 1 AND sz[2] EQ jpk :arr = (temporary(arr))[ *, firstz:lastz ] 180 185 sz[1] EQ nx AND ny EQ 1 AND sz[2] EQ nz : 181 186 ; (x)yz arrays 182 nx EQ 1 AND sz[1] EQ jpj AND sz[2] EQ jpk :arr = (temporary(arr))[ firsty:lasty, firstz:lastz ] 187 nx EQ 1 AND sz[1] EQ jpj AND sz[2] EQ jpk :arr = (temporary(arr))[ firsty:lasty, firstz:lastz ] 183 188 nx EQ 1 AND sz[1] EQ jpj AND sz[2] EQ nz :arr = (temporary(arr))[ firsty:lasty, * ] 184 189 nx EQ 1 AND sz[1] EQ ny AND sz[2] EQ jpk :arr = (temporary(arr))[ *, firstz:lastz ] 185 190 nx EQ 1 AND sz[1] EQ ny AND sz[2] EQ nz : 186 191 ; xt arrays 187 sz[1] EQ jpi AND sz[2] EQ jpt:arr = (temporary(arr))[firstx:lastx , *] 192 sz[1] EQ jpi AND sz[2] EQ jpt:arr = (temporary(arr))[firstx:lastx , *] 188 193 sz[1] EQ nx AND sz[2] EQ jpt: 189 194 ; yt arrays … … 191 196 sz[1] EQ ny AND sz[2] EQ jpt: 192 197 ; zt arrays 193 sz[1] EQ jpk AND sz[2] EQ jpt:arr = (temporary(arr))[ firstz:lastz, *] 198 sz[1] EQ jpk AND sz[2] EQ jpt:arr = (temporary(arr))[ firstz:lastz, *] 194 199 sz[1] EQ nz AND sz[2] EQ jpt: 195 200 ELSE:return, err_mess(sz[1:2], jpi, nx, jpj, ny, jpk, nz, jpt) … … 201 206 CASE 1 OF 202 207 ; xyz arrays 203 sz[1] EQ jpi AND sz[2] EQ jpj AND sz[3] EQ jpk :arr = (temporary(arr))[firstx:lastx, firsty:lasty, firstz:lastz ] 208 sz[1] EQ jpi AND sz[2] EQ jpj AND sz[3] EQ jpk :arr = (temporary(arr))[firstx:lastx, firsty:lasty, firstz:lastz ] 204 209 sz[1] EQ jpi AND sz[2] EQ ny AND sz[3] EQ jpk :arr = (temporary(arr))[firstx:lastx, *, firstz:lastz ] 205 210 sz[1] EQ nx AND sz[2] EQ jpj AND sz[3] EQ jpk :arr = (temporary(arr))[ *, firsty:lasty, firstz:lastz ] 206 211 sz[1] EQ nx AND sz[2] EQ ny AND sz[3] EQ jpk :arr = (temporary(arr))[ *, *, firstz:lastz ] 207 sz[1] EQ jpi AND sz[2] EQ jpj AND sz[3] EQ nz :arr = (temporary(arr))[firstx:lastx, firsty:lasty, * ] 212 sz[1] EQ jpi AND sz[2] EQ jpj AND sz[3] EQ nz :arr = (temporary(arr))[firstx:lastx, firsty:lasty, * ] 208 213 sz[1] EQ jpi AND sz[2] EQ ny AND sz[3] EQ nz :arr = (temporary(arr))[firstx:lastx, *, * ] 209 214 sz[1] EQ nx AND sz[2] EQ jpj AND sz[3] EQ nz :arr = (temporary(arr))[ *, firsty:lasty, * ] 210 215 sz[1] EQ nx AND sz[2] EQ ny AND sz[3] EQ nz : 211 216 ; xyt arrays 212 sz[1] EQ jpi AND sz[2] EQ jpj AND sz[3] EQ jpt:arr = (temporary(arr))[firstx:lastx, firsty:lasty, *] 217 sz[1] EQ jpi AND sz[2] EQ jpj AND sz[3] EQ jpt:arr = (temporary(arr))[firstx:lastx, firsty:lasty, *] 213 218 sz[1] EQ jpi AND sz[2] EQ ny AND sz[3] EQ jpt:arr = (temporary(arr))[firstx:lastx, *, *] 214 219 sz[1] EQ nx AND sz[2] EQ jpj AND sz[3] EQ jpt:arr = (temporary(arr))[ *, firsty:lasty, *] 215 220 sz[1] EQ nx AND sz[2] EQ ny AND sz[3] EQ jpt: 216 221 ; (x)yzt arrays 217 nx EQ 1 AND sz[1] EQ jpj AND sz[2] EQ jpk AND sz[3] EQ jpt:arr = (temporary(arr))[ firsty:lasty, firstz:lastz, *] 222 nx EQ 1 AND sz[1] EQ jpj AND sz[2] EQ jpk AND sz[3] EQ jpt:arr = (temporary(arr))[ firsty:lasty, firstz:lastz, *] 218 223 nx EQ 1 AND sz[1] EQ jpj AND sz[2] EQ nz AND sz[3] EQ jpt:arr = (temporary(arr))[ firsty:lasty, *, *] 219 224 nx EQ 1 AND sz[1] EQ ny AND sz[2] EQ jpk AND sz[3] EQ jpt:arr = (temporary(arr))[ *, firstz:lastz, *] 220 225 nx EQ 1 AND sz[1] EQ ny AND sz[2] EQ nz AND sz[3] EQ jpt: 221 226 ; x(y)zt arrays 222 sz[1] EQ jpi AND ny EQ 1 AND sz[2] EQ jpk AND sz[3] EQ jpt:arr = (temporary(arr))[firstx:lastx, firstz:lastz, *] 227 sz[1] EQ jpi AND ny EQ 1 AND sz[2] EQ jpk AND sz[3] EQ jpt:arr = (temporary(arr))[firstx:lastx, firstz:lastz, *] 223 228 sz[1] EQ jpi AND ny EQ 1 AND sz[2] EQ nz AND sz[3] EQ jpt:arr = (temporary(arr))[firstx:lastx, *, *] 224 229 sz[1] EQ nx AND ny EQ 1 AND sz[2] EQ jpk AND sz[3] EQ jpt:arr = (temporary(arr))[ *, firstz:lastz, *] … … 232 237 CASE 1 OF 233 238 ; xyzt arrays 234 sz[1] EQ jpi AND sz[2] EQ jpj AND sz[3] EQ jpk AND sz[4] EQ jpt:arr = (temporary(arr))[firstx:lastx, firsty:lasty, firstz:lastz, *] 239 sz[1] EQ jpi AND sz[2] EQ jpj AND sz[3] EQ jpk AND sz[4] EQ jpt:arr = (temporary(arr))[firstx:lastx, firsty:lasty, firstz:lastz, *] 235 240 sz[1] EQ jpi AND sz[2] EQ ny AND sz[3] EQ jpk AND sz[4] EQ jpt:arr = (temporary(arr))[firstx:lastx, *, firstz:lastz, *] 236 241 sz[1] EQ nx AND sz[2] EQ jpj AND sz[3] EQ jpk AND sz[4] EQ jpt:arr = (temporary(arr))[ *, firsty:lasty, firstz:lastz, *] 237 242 sz[1] EQ nx AND sz[2] EQ ny AND sz[3] EQ jpk AND sz[4] EQ jpt:arr = (temporary(arr))[ *, *, firstz:lastz, *] 238 sz[1] EQ jpi AND sz[2] EQ jpj AND sz[3] EQ nz AND sz[4] EQ jpt:arr = (temporary(arr))[firstx:lastx, firsty:lasty, *, *] 243 sz[1] EQ jpi AND sz[2] EQ jpj AND sz[3] EQ nz AND sz[4] EQ jpt:arr = (temporary(arr))[firstx:lastx, firsty:lasty, *, *] 239 244 sz[1] EQ jpi AND sz[2] EQ ny AND sz[3] EQ nz AND sz[4] EQ jpt:arr = (temporary(arr))[firstx:lastx, *, *, *] 240 245 sz[1] EQ nx AND sz[2] EQ jpj AND sz[3] EQ nz AND sz[4] EQ jpt:arr = (temporary(arr))[ *, firsty:lasty, *, *] -
trunk/SRC/Utilities/isadirectory.pro
r163 r224 7 7 ; with the directory separator mark. 8 8 ; 9 ; @categories io 9 ; @categories 10 ; io 10 11 ; 11 ; @param DIRECTORYIN {in}{optional} 12 ; @param DIRECTORYIN {in}{optional} 12 13 ; a proposed directory. If neither dirname 13 14 ; input parameter of IODIRECTORY keyword are defined, 14 15 ; the ask the user to choose a directory. 15 16 ; 16 ; @keyword IODIRECTORY 17 ; @keyword IODIRECTORY 17 18 ; a proposed directory 18 19 ; 19 ; @keyword TITLE 20 ; @keyword TITLE 20 21 ; the title of the window 21 22 ; 22 ; @keyword _EXTRA 23 ; @keyword _EXTRA 23 24 ; used to pass your keywords 24 25 ; 25 ; @file_comments26 26 ; all dialog_pickfile keywords (like filter) can be used. 27 27 ; 28 ; @returns 28 ; @returns 29 29 ; the directory name 30 30 ; … … 37 37 ; IDL> print, isadirectory(!dir+'notgood') 38 38 ; 39 ; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) 39 ; @history 40 ; Sebastien Masson (smasson\@lodyc.jussieu.fr) 40 41 ; June 28, 2000 41 42 ; June 2005: Sebastien Masson: cleaning, use for file_* functions 42 43 ; 43 ; @version $Id$ 44 ; @version 45 ; $Id$ 44 46 ;- 45 47 ;------------------------------------------------------------ -
trunk/SRC/Utilities/isafile.pro
r163 r224 9 9 ; @categories io 10 10 ; 11 ; @param FILEIN {in}{optional} 12 ; a proposed name. If neither filein input parameter of filename keyword are 11 ; @param FILEIN {in}{optional} 12 ; a proposed name. If neither filein input parameter of filename keyword are 13 13 ; defined, the ask the user to choose a file. 14 14 ; 15 ; @keyword FILENAME 15 ; @keyword FILENAME 16 16 ; a proposed filename. 17 17 ; 18 ; @keyword IODIRECTORY 18 ; @keyword IODIRECTORY 19 19 ; a directory where we look for the file. this 20 20 ; keyword is taken into account only if the dirname 21 21 ; of filein or filename is '.' 22 22 ; 23 ; @keyword NEW 24 ; to specify that filename is a new file and that we should check only its 23 ; @keyword NEW 24 ; to specify that filename is a new file and that we should check only its 25 25 ; path 26 26 ; 27 ; @keyword ONLYPRO 27 ; @keyword ONLYPRO 28 28 ; force to look only at file ending with .pro 29 29 ; 30 ; @keyword ONLYNC 30 ; @keyword ONLYNC 31 31 ; force to look only at file ending with .nc 32 32 ; 33 ; @keyword RECURSIVE 33 ; @keyword RECURSIVE 34 34 ; performs recursive searching of directory hierarchies. 35 35 ; In a recursive search, find looks recursively for any and all 36 36 ; subdirectories in the file hierarchy rooted at the IODIRECTORY argument. 37 37 ; 38 ; @keyword _EXTRA 38 ; @keyword _EXTRA 39 39 ; used to pass your keywords 40 40 ; 41 ; @file_comments42 41 ; all find, file_search and dialog_pickfile keywords (like title) can be used 43 42 ; 44 ; @returns 43 ; @returns 45 44 ; the filename with its path 46 45 ; … … 59 58 ; IDL> print, isafile('fake_file.pro') 60 59 ; 61 ; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) 60 ; @history 61 ; Sebastien Masson (smasson\@lodyc.jussieu.fr) 62 62 ; 11/2/2000 63 63 ; June 2005: Sebastien Masson: cleaning, use for file_* functions 64 64 ; 65 ; @version $Id$ 65 ; @version 66 ; $Id$ 66 67 ;- 67 68 ;------------------------------------------------------------ -
trunk/SRC/Utilities/linearequation.pro
r163 r224 4 4 ;+ 5 5 ; 6 ; @file_comments 6 ; @file_comments 7 7 ; Calculate a linear equation of the type ax+by+c=0 8 8 ; thanks to coordinates of 2 points. 9 9 ; comment: we can have a table with pairs of points. 10 10 ; 11 ; @categories 12 ;Utilities13 ; 14 ; @param POINT1 {in}{required} 15 ; This is the first point of(the) straight line(s) whose we want to calculate 11 ; @categories 12 ; Utilities 13 ; 14 ; @param POINT1 {in}{required} 15 ; This is the first point of(the) straight line(s) whose we want to calculate 16 16 ; equation(s) 17 17 ; 18 ; @param POINT2 {in}{required} 18 ; @param POINT2 {in}{required} 19 19 ; This is the second point of(the) straight line(s) whose we want to calculate 20 20 ; equation(s) … … 25 25 ; For each row of the table, we have coordinates of the point. 26 26 ; 27 ; @returns 28 ; abc is a table of dimension 3, number_of_straight_line, 27 ; @returns 28 ; abc is a table of dimension 3, number_of_straight_line, 29 29 ; where for each line of the table we obtain the 3 parameters 30 30 ; a, b and c of the linear equation ax+by+c=0 31 31 ; 32 ; @examples 32 ; @examples 33 33 ; IDL> abc=linearequation(complex(1,2),[3,4]) 34 34 ; IDL> print, abc[0]*1+abc[1]*2+abc[2] 35 35 ; 0.00000 36 36 ; 37 ; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) 37 ; @history 38 ; Sebastien Masson (smasson\@lodyc.jussieu.fr) 38 39 ; 10 juin 2000 39 40 ; 40 ; @version $Id$ 41 ; @version 42 ; $Id$ 41 43 ; 42 44 ;- … … 67 69 vertical = where(x1 EQ x2) 68 70 novertical = where(x1 NE x2) 69 abc = fltarr(3, n_elements(x1)) 71 abc = fltarr(3, n_elements(x1)) 70 72 71 73 IF novertical[0] NE -1 then BEGIN 72 74 ; y=mx+p 73 nele = n_elements(novertical) 75 nele = n_elements(novertical) 74 76 m = (y2[novertical]-y1[novertical])/(x2[novertical]-x1[novertical]) 75 77 p = (x2[novertical]*y1[novertical]-y2[novertical]*x1[novertical])/(x2[novertical]-x1[novertical]) … … 78 80 IF vertical[0] NE -1 then BEGIN 79 81 ; x=ny+p 80 nele = n_elements(vertical) 82 nele = n_elements(vertical) 81 83 n = (x2[vertical]-x1[vertical])/(y2[vertical]-y1[vertical]) 82 84 p = (y2[vertical]*x1[vertical]-x2[vertical]*y1[vertical])/(y2[vertical]-y1[vertical]) -
trunk/SRC/Utilities/lineintersection.pro
r163 r224 4 4 ;+ 5 5 ; 6 ; @file_comments 7 ; Calculate coordinates of the intersection between 2 straight lines 6 ; @file_comments 7 ; Calculate coordinates of the intersection between 2 straight lines 8 8 ; or of a succession of 2 straight lines. 9 9 ; 10 ; @categories 10 ; @categories 11 11 ; Utilities 12 ; 12 ; 13 13 ; @param ABC1 {in}{required}{type=3d array} 14 ; is the first array of dimension 3, number_of_pairs_of_straight_lines, 15 ; whose each line contain the 3 parameters a,b and c of the first linear 14 ; is the first array of dimension 3, number_of_pairs_of_straight_lines, 15 ; whose each line contain the 3 parameters a,b and c of the first linear 16 16 ; equation of the type ax+by+c=0 17 17 ; 18 18 ; @param ABC2 {in}{required}{type=3d array} 19 ; is second array of dimension 3, number_of_pairs_of_straight_lines, 20 ; whose each line contain the 3 parameters a,b and c of the second linear 19 ; is second array of dimension 3, number_of_pairs_of_straight_lines, 20 ; whose each line contain the 3 parameters a,b and c of the second linear 21 21 ; equation of the type ax+by+c=0 22 22 ; 23 ; @keyword FLOAT 24 ; To return the output as a array of real numbers instead of vectors of 23 ; @keyword FLOAT 24 ; To return the output as a array of real numbers instead of vectors of 25 25 ; complex (by default) 26 26 ; 27 ; @returns 27 ; @returns 28 28 ; 2 possibilities: 29 ; 1) by default: it is a vector of complex whose each element is the coordinates 29 ; 1) by default: it is a vector of complex whose each element is the coordinates 30 30 ; of the intersection point of a pair of straight lines. 31 ; 2) if FLOAT is activated, it is a array of reels of dimension 2, 32 ; number_of_pairs_of_straight_lines whose each row is the coordinates 31 ; 2) if FLOAT is activated, it is a array of reels of dimension 2, 32 ; number_of_pairs_of_straight_lines whose each row is the coordinates 33 33 ; of the intersection point of a pair of straight line. 34 34 ; 35 ; @restrictions 36 ; If the 2 straight line are parallel, we return coordinates 35 ; @restrictions 36 ; If the 2 straight line are parallel, we return coordinates 37 37 ; (!values.f_nan,!values.f_nan) 38 38 ; 39 ; @restrictions 40 ; Beware of the precision of the machine which make 41 ; that calculated coordinates may not exactly verify 39 ; Beware of the precision of the machine which make 40 ; that calculated coordinates may not exactly verify 42 41 ; equations of the pair of straight lines. 43 42 ; 44 ; @examples 43 ; @examples 45 44 ; IDL> abc1=linearequation(complex(1,2),[3,4]) 46 45 ; IDL> abc2=linearequation(complex(1,2),[8,15]) … … 50 49 ; 1.00000 2.00000 51 50 ; 52 ; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) 51 ; @history 52 ; Sebastien Masson (smasson\@lodyc.jussieu.fr) 53 53 ; 10 juin 2000 54 54 ; 55 ; @version $Id$ 55 ; @version 56 ; $Id$ 56 57 ; 57 58 ;- … … 79 80 ; 80 81 if keyword_set(float) then begin 81 npts = n_elements(x) 82 npts = n_elements(x) 82 83 res = [reform(x, 1, npts, /over), reform(y, 1, npts, /over)] 83 84 ENDIF ELSE res = complex(x, y) -
trunk/SRC/Utilities/mergeonline_help.pro
r197 r224 7 7 ; 8 8 ; @restrictions 9 ; Needs at least version 6.2 9 ; Needs at least version 6.2 10 10 ; 11 11 ; @history … … 26 26 ENDIF 27 27 ;--------------------------------------------------------------- 28 ; check directories 28 ; check directories 29 29 ;--------------------------------------------------------------- 30 30 ; get the environment variable $HOME … … 60 60 ENDIF 61 61 ;--------------------------------------------------------------- 62 ; check exist ance and version of the file that need to be created62 ; check existence and version of the file that need to be created 63 63 ;--------------------------------------------------------------- 64 64 … … 79 79 IF line NE -1 THEN BEGIN 80 80 old = saxoadp[line] 81 ; are the 2 revision tags the same ??81 ; are the 2 revision tags the same ? 82 82 IF array_equal(old, new) THEN BEGIN 83 83 ; is IDL version the same of homesrc + 'home.html' ? … … 164 164 ; add some informattions: 165 165 about = [about, '', 'More informations on', 'http://forge.ipsl.jussieu.fr/saxo', ''] 166 ; 166 ; 167 167 putfile, homesrc + 'aboutsaxo.txt', temporary(about) 168 168 ;--------------------------------------------------------------- -
trunk/SRC/Utilities/protype.pro
r223 r224 29 29 ; proc 30 30 ; 31 ; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) 31 ; @history 32 ; Sebastien Masson (smasson\@lodyc.jussieu.fr) 32 33 ; Feb 2006 33 34 ; 34 ; @version $Id$ 35 ; @version 36 ; $Id$ 35 37 ;- 36 38 ;------------------------------------------------------------ -
trunk/SRC/Utilities/pwd.pro
r136 r224 4 4 ;+ 5 5 ; 6 ; @file_comments 6 ; @file_comments 7 7 ; print the current directory 8 8 ; 9 ; @categories like unix function 10 ; 11 ; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) 9 ; @categories 10 ; like unix function 12 11 ; 13 ; @version $Id$ 12 ; @history 13 ; Sebastien Masson (smasson\@lodyc.jussieu.fr) 14 ; 15 ; @version 16 ; $Id$ 14 17 ; 15 18 ;- -
trunk/SRC/Utilities/report.pro
r163 r224 4 4 ;+ 5 5 ; 6 ; @file_comments 7 ; Like dialog_message.pro if there is already some widget 8 ; active or like message.pro if there is not any widget active. 6 ; @file_comments 7 ; Like dialog_message.pro if there is already some widget 8 ; active or like message.pro if there is not any widget active. 9 9 ; To ask a question whose answer is not yes/no,use xquestion. 10 10 ; 11 ; @param TEXT {in}{required} 11 ; @param TEXT {in}{required} 12 12 ; one string or one vector of string. Si le string ne 13 13 ; comporte qu''un element, on cherche les eventuels characteres de … … 15 15 ; array element is displayed as a separate line of text. 16 16 ; 17 ; @keyword SIMPLE 17 ; @keyword SIMPLE 18 18 ; activate to print only the message without the name 19 19 ; and the line of the routine (defined by calling routine_name) 20 20 ; 21 ; @keyword _EXTRA 21 ; @keyword _EXTRA 22 22 ; used to pass keywords from dialog_message.pro and message.pro 23 23 ; 24 ; @keyword PARENT 24 ; @keyword PARENT 25 25 ; same as DIALOG_PARENT de dialog_message.pro 26 26 ; … … 29 29 ; 30 30 ; @keyword DEFAULT_NO {default="Yes"} 31 ; Set this keyword to make the "No" button the default selection for 32 ; "Question" dialog. 31 ; Set this keyword to make the "No" button the default selection for 32 ; "Question" dialog. 33 33 ; 34 ; @keyword SIMPLE 35 ; Activate to print the error message without printing the routine name with34 ; @keyword SIMPLE 35 ; Activate to print the error message without printing the routine name with 36 36 ; its full path. 37 37 ; 38 ; @returns 38 ; @returns 39 39 ; -1 if the keyword QUESTION is not activated 40 40 ; If the keyword is activated, return 1 for yes and 0 for no. 41 ; 42 ; @examples 41 ; 42 ; @examples 43 43 ; If there is not any widget activated: 44 44 ; … … 56 56 ; If widgets are already activated, it is the same thing but with widgets! 57 57 ; 58 ; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) 58 ; @history 59 ; Sebastien Masson (smasson\@lodyc.jussieu.fr) 59 60 ; 21/10/1999 60 61 ; 61 ; @version $Id$ 62 ; @version 63 ; $Id$ 62 64 ; 63 65 ;- … … 85 87 default_answer = answer 86 88 if n_elements(text) GT 1 THEN $ 87 for i = 0, n_elements(text)-2 do print,text[i] 89 for i = 0, n_elements(text)-2 do print,text[i] 88 90 read, text[n_elements(text)-1]+' y/n (default answer is '+default_answer+')' , answer 89 91 answer = strlowcase(answer) ; … … 103 105 IF keyword_set(simple) THEN prefix = '' ELSE prefix = '% '+routine_name(1)+': ' 104 106 if n_elements(text) GT 1 THEN $ 105 for i = 0, n_elements(text)-2 do print, prefix+text[i] 107 for i = 0, n_elements(text)-2 do print, prefix+text[i] 106 108 print, prefix+text[n_elements(text)-1] 107 109 ENDELSE -
trunk/SRC/Utilities/routine_name.pro
r163 r224 7 7 ; Give us the name of the routine (procedure or function) where we are. 8 8 ; 9 ; @categories 9 ; @categories 10 10 ; Utilities 11 11 ; … … 35 35 ; $MAIN$ 36 36 ; 37 ; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) 37 ; @history 38 ; Sebastien Masson (smasson\@lodyc.jussieu.fr) 38 39 ; 21/10/1999 39 40 ; 40 ; @version $Id$ 41 ; @version 42 ; $Id$ 41 43 ; 42 44 ;- -
trunk/SRC/Utilities/testvar.pro
r163 r224 4 4 ;+ 5 5 ; 6 ; @file_comments 7 ; A kind of keyword_set but when the value exist, it send it back 6 ; @file_comments 7 ; A kind of keyword_set but when the value exist, it send it back. 8 8 ; 9 ; @categories 9 ; @categories 10 10 ; Utilities 11 11 ; 12 ; @keyword VAR 12 ; @keyword VAR 13 13 ; any kind of 14 14 ; 15 ; @returns 16 ; 0 if the variable does not exist 15 ; @returns 16 ; 0 if the variable does not exist 17 17 ; 18 ; @examples 18 ; @examples 19 19 ; IDL> print, testvar(var=toto) 20 20 ; 0 … … 22 22 ; toto 23 23 ; 24 ; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) 24 ; @history 25 ; Sebastien Masson (smasson\@lodyc.jussieu.fr) 25 26 ; 14/12/1999 26 27 ; 27 ; @version $Id$ 28 ; @version 29 ; $Id$ 28 30 ; 29 31 ;- -
trunk/SRC/Utilities/text_box.pro
r163 r224 1 1 ;+ 2 2 ; 3 ; @file_comments 3 ; @file_comments 4 4 ; This procedure writes a short text message within a box-shaped 5 5 ; area in a graphics window. The message may be split at word 6 6 ; boundaries into several lines, and the character size and 7 7 ; orientation may be adjusted for the text to fit within the box. 8 ; 9 ; @param TEXT {in}{required} 8 ; 9 ; @param TEXT {in}{required} 10 10 ; ASCII text string containing the message. 11 11 ; 12 ; @keyword POS 12 ; @keyword POS 13 13 ; 4 element vector specifying the box position and size 14 14 ; pos[0],pos[1] specify the lower left corner coordinate … … 19 19 ; color of box and legend titles 20 20 ; 21 ; @keyword BG_COLOR 22 ; background color. Setting BG_COLOR erases the area 21 ; @keyword BG_COLOR 22 ; background color. Setting BG_COLOR erases the area 23 23 ; covered by the text box (filling it with color BG_COLOR) 24 24 ; prior to writing the text. If both BG_COLOR and !p.color 25 25 ; are zero then the background color is reset to 255 to 26 26 ; gaurantee a readability. 27 ; 28 ; @keyword RIGHT 27 ; 28 ; @keyword RIGHT 29 29 ; if set, right justify text 30 30 ; 31 ; @keyword CENTER 31 ; @keyword CENTER 32 32 ; if set, center the text 33 33 ; … … 35 35 ; vertical spacing of lines in units of character height 36 36 ; 37 ; @keyword _EXTRA 37 ; @keyword _EXTRA 38 38 ; used to pass your keyword 39 39 ; 40 ; @keyword BOX 40 ; @keyword BOX 41 41 ; activate to show the box on graphics window. 42 42 ; 43 ; @history Paul Ricchiazzi 7Jul93 43 ; @history 44 ; Paul Ricchiazzi 7Jul93 44 45 ; Institute for Computational Earth System Science 45 46 ; University of California, Santa Barbara 46 47 ; 47 ; @version $Id$ 48 ; @version 49 ; $Id$ 48 50 ; 49 51 ;- … … 80 82 print,strcompress(posstring,/remove_all) 81 83 82 84 83 85 endif else begin 84 86 85 87 xx1 = nnx[0]+pos[0]*(nnx[1]-nnx[0]) 86 88 xx2 = nnx[0]+pos[2]*(nnx[1]-nnx[0]) … … 103 105 blanklen=lenstr(' ')*!d.x_vsize 104 106 maxcharsize=(xx2-xx1)/(4*blanklen+max(wordlen)) 105 charsize=1 107 charsize=1 106 108 lpnt=intarr(nwords) 107 109 nomore=0 … … 123 125 sum=wlen[i]+blen 124 126 endif 125 lpnt[i]=ilines 126 127 lpnt[i]=ilines 128 127 129 ; print,f='(f8.2,4i8,3f8.2)',charsize,i,ilines,n_lines,lpnt[i],$ 128 130 ; wlen[i]+blen,sum+3*blen,xx2-xx1 129 endfor 131 endfor 130 132 case 1 of 131 133 ilines+1 lt n_lines: if charsize*1.1 gt maxcharsize then $ … … 135 137 ilines+1 gt n_lines: charsize=charsize*.9 136 138 endcase 137 endrep until nomore 139 endrep until nomore 138 140 139 141 lines=strarr(n_lines) … … 150 152 ; 151 153 align=.5*(1+justify) 152 154 153 155 case justify of 154 156 -1:xx = xx1+.5*((xx2-xx1)-maxlen) -
trunk/SRC/Utilities/undefine.pro
r163 r224 4 4 ;+ 5 5 ; 6 ; @file_comments 6 ; @file_comments 7 7 ; erase a variable 8 ; same thing that delvar but usable in a program and usable 8 ; same thing that delvar but usable in a program and usable 9 9 ; for one variable simultaneously 10 10 ; 11 ; @categories 12 ; Utilities 13 ; 14 ; @param VARNAME {in}{required} 11 ; @categories 12 ; Utilities 13 ; 14 ; @param VARNAME {in}{required} 15 15 ; The name of the variable we want erase 16 16 ; … … 22 22 ; A UNDEFINED = <Undefined> 23 23 ; 24 ; @history trouve sur la page web de D.Fanning 24 ; @history 25 ; trouve sur la page web de D.Fanning 25 26 ; http://www.dfanning.com : 26 ;QUESTION: How do I make an IDL variable have a type "undefined"? 27 ;QUESTION: How do I make an IDL variable have a type "undefined"? 27 28 ;ANSWER: At the main IDL level you can use the IDL procedure DELVAR to 28 29 ;delete an IDL variable and make it undefined. Inside of procedures … … 31 32 ;Adelaide, Australia. 32 33 ; 33 ; @version $Id$ 34 ; @version 35 ; $Id$ 34 36 ; 35 37 ;- … … 37 39 ;------------------------------------------------------------ 38 40 ;------------------------------------------------------------ 39 PRO undefine, varname 41 PRO undefine, varname 40 42 ; 41 43 compile_opt idl2, strictarrsubs -
trunk/SRC/Utilities/xhelp.pro
r223 r224 92 92 endwhile 93 93 if i EQ 0 then $ 94 ras = report(' le programme a etait mal ecrit, il n''y a pas d''en-tete... utiliser xfile.pro.') ELSE BEGIN94 ras = report('file is badly written, no header ... Use xfile') ELSE BEGIN 95 95 a = a[0:i-1] 96 96 ; we wrote the a's content in a widget … … 98 98 ENDELSE 99 99 FREE_LUN, unit ;free the file unit. 100 ENDIF ELSE ras = report(' le fichier demande n''existe pas...')100 ENDIF ELSE ras = report('file does not exist ...') 101 101 102 102 return
Note: See TracChangeset
for help on using the changeset viewer.