Changeset 226 for trunk/SRC/ToBeReviewed/HOPE/read_hope.pro
- Timestamp:
- 03/16/07 10:22:26 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/ToBeReviewed/HOPE/read_hope.pro
r163 r226 7 7 ; 8 8 ; @param EVENT 9 ; 9 ; 10 10 ; 11 11 ; @returns … … 16 16 ; 17 17 ; @examples 18 ; 19 ; 18 ; 20 19 ; @history 21 20 ; … … 244 243 ; A two elements vector [date1, date2]] 245 244 ; the boundary of the calendar with date1 and date2 246 ; fol owing the syntax yyyymmdd245 ; following the syntax yyyymmdd 247 246 ; 248 247 ; @keyword ODDPT 249 248 ; Activate to read only the sections located on ODD 250 ; points 249 ; points 251 250 ; 252 251 ; @keyword EVENPT 253 252 ; Activate to read only the sections located on even 254 ; points 253 ; points 255 254 ; 256 255 ; @keyword ODDEVENPT … … 332 331 compile_opt idl2, strictarrsubs 333 332 ; 334 @common ; usefull only for the definition of iodir 333 @common ; usefull only for the definition of iodir 335 334 if n_elements(filename) EQ 0 then filename = isafile(iodirectory = iodir, _extra = ex) 336 335 IF size(filename, /type) NE 7 THEN return, -1 337 336 filename = isafile(filename = filename, iodirectory = iodir, _extra = ex) 338 337 ; 339 cdfid = ncdf_open(filename) ; id of the netcdf file 338 cdfid = ncdf_open(filename) ; id of the netcdf file 340 339 wathinside = ncdf_inquire(cdfid) ; structure with global informations 341 ;------------------------------- 340 ;------------------------------- 342 341 ; dimensions 343 ;------------------------------- 342 ;------------------------------- 344 343 namedim = strarr(wathinside.ndims) ; name of the dimensions 345 344 typedim = strarr(wathinside.ndims) ; type of the dimensions (x,y,z,t) … … 349 348 ncdf_diminq, cdfid, dimiq, name, value 350 349 namedim[dimiq] = name 351 case 1 of 350 case 1 of 352 351 STRCMP(name, 'lon', 3, /FOLD_CASE):typedim[dimiq] = 'x' 353 352 STRCMP(name, 'lat', 3, /FOLD_CASE):typedim[dimiq] = 'y' … … 363 362 ; dimlist: structure which contains the name and the value of each 364 363 ; dimension 365 ; we suppose that there is always a variable which has the 364 ; we suppose that there is always a variable which has the 366 365 ; same name that the dimension and which gives the values of 367 366 ; this dimension … … 372 371 dimlist = create_struct(dimlist, namedim[dimiq], value) 373 372 endfor 374 ;------------------------------- 373 ;------------------------------- 375 374 ; variables 376 ;------------------------------- 375 ;------------------------------- 377 376 namevar = strarr(wathinside.nvars) ; names of the variables 378 377 ndimsvar = lonarr(wathinside.nvars) ; number of dim for each variable … … 388 387 ; we cut dimvar to select only the interessant part 389 388 dimvar = dimvar[0:max(ndimsvar)-1, *] 390 ; selection of the data variables which are diff rent from the389 ; selection of the data variables which are different from the 391 390 ; dimension variables 392 391 ; we suppose that that data variables are 4D array (with sometime … … 412 411 endfor 413 412 ; 414 ;--------------------------------------------------- 415 ;--------------------------------------------------- 416 ;--------------------------------------------------- 413 ;--------------------------------------------------- 414 ;--------------------------------------------------- 415 ;--------------------------------------------------- 417 416 ; definition of the widget 418 ;--------------------------------------------------- 419 ;--------------------------------------------------- 420 ;--------------------------------------------------- 417 ;--------------------------------------------------- 418 ;--------------------------------------------------- 419 ;--------------------------------------------------- 421 420 base = widget_base(/column) 422 ;--------------------------------------------------- 423 ; first base: 421 ;--------------------------------------------------- 422 ; first base: 424 423 ; droplist to select the type of section 425 424 ; droplist to select the variable 426 425 ; button to select type of line : odd, even or odd-even 427 ;--------------------------------------------------- 426 ;--------------------------------------------------- 428 427 base1 = widget_base(base, /row, /frame) 429 428 typechoice = sectype[uniq(sectype, sort(sectype))] … … 435 434 = 0L > (where(typechoice EQ selectedtype))[0] 436 435 ENDIF ELSE selectedtype = typechoice[0] 437 ; 436 ; 438 437 varchoice = namevar[uniq(namevar, sort(namevar))] 439 438 base12 = widget_droplist(base1, title = 'Available data', value = varchoice, uvalue = {name:'var choice'}, uname = 'var choice') … … 445 444 ; 446 445 base13 = widget_base(base1, /row, uname = 'linechoicebase') 447 ;--------------------------------------------------- 446 ;--------------------------------------------------- 448 447 ; base 2: base to select the domain of the odd points 449 448 ;--------------------------------------------------- 450 449 base2 = widget_base(base, /column, uname = 'basedomainodd', /frame) 451 ;--------------------------------------------------- 450 ;--------------------------------------------------- 452 451 ; base 3: base to select the domain of the even points 453 452 ;--------------------------------------------------- 454 453 base3 = widget_base(base, /column, uname = 'basedomaineven', /frame) 455 ;--------------------------------------------------- 454 ;--------------------------------------------------- 456 455 ; base 4: base to select the domain of the odd-even points 457 456 ;--------------------------------------------------- 458 457 base4 = widget_base(base, /column, uname = 'basedomainodd-even', /frame) 459 ;--------------------------------------------------- 458 ;--------------------------------------------------- 460 459 ; base 5: calendar 461 460 ;--------------------------------------------------- … … 468 467 base51 = cw_calendar(base5, time, uname = 'date1', uvalue = {name:'date1'}) 469 468 base52 = cw_calendar(base5, time, uname = 'date2', uvalue = {name:'date2'}) 470 ;--------------------------------------------------- 469 ;--------------------------------------------------- 471 470 ; base 6: base to select the min, max, ... and others keywords 472 471 ;--------------------------------------------------- 473 472 base6 = cw_specifie(base, /column, uname = 'specifie', uvalue = {name:'specifie'}) 474 ;--------------------------------------------------- 473 ;--------------------------------------------------- 475 474 ; base 7: last base with the action buttons 476 475 ;--------------------------------------------------- … … 478 477 base71 = widget_button(base7, value = 'Plot', uvalue = {name:'plot'}) 479 478 base72 = widget_button(base7, value = 'Cancel', uvalue = {name:'cancel'}) 480 ;--------------------------------------------------- 479 ;--------------------------------------------------- 481 480 ; determination of the selected variable ...... 482 ;--------------------------------------------------- 481 ;--------------------------------------------------- 483 482 goodname = 0 > where(strlowcase(namevar) EQ strlowcase(selectedname)) 484 483 goodtype = 0 > where(sectype EQ selectedtype) … … 568 567 endif 569 568 ENDIF 570 ;--------------------------------------------------- 569 ;--------------------------------------------------- 571 570 ; definition of the uvalue of the base which allows to share the 572 ; variables between programs. 573 ;--------------------------------------------------- 571 ; variables between programs. 572 ;--------------------------------------------------- 574 573 top_uvalue = ptrarr(2, 18, /allocate_heap) 575 574 *top_uvalue[0, 0] = 'type choice' & *top_uvalue[1, 0] = temporary(typechoice)
Note: See TracChangeset
for help on using the changeset viewer.