Changeset 224 for trunk/SRC/ReadWrite
- Timestamp:
- 03/15/07 11:22:28 (17 years ago)
- File:
-
- 1 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
Note: See TracChangeset
for help on using the changeset viewer.