Changeset 8
- Timestamp:
- 11/27/07 12:16:16 (17 years ago)
- Location:
- trunk/procs
- Files:
-
- 2 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/procs/macro_read.pro
r2 r8 6 6 @com_eg 7 7 8 IF debug_w THEN print, 'keyword_set(ALL_DATA) : ', keyword_set(ALL_DATA) 8 IF debug_w THEN print, ' ENTER macro_read...' 9 10 IF debug_w THEN print, ' keyword_set(ALL_DATA) : ', keyword_set(ALL_DATA) 9 11 ; 10 12 ; 1) read macro definition of field 11 13 ; 12 ; name of macro file 14 @get_macro_def 13 15 14 file_mac = hom_def+'fld_macros.def'15 IF debug_w THEN print, 'var_name in macro_read: ', var_name16 ;17 ; special case for stddev monthly18 stddev_mth = '00'19 pos_underscore = strpos(var_name,'_')20 IF pos_underscore GE 0 THEN BEGIN21 stddev_mth = STRMID(var_name, pos_underscore + 1, 2)22 var_name = STRMID(var_name, 0, pos_underscore)23 ENDIF24 25 ; find definition of macro26 spawn, 'grep -i " '+STRMID(var_name, 2, 16)+' " '+file_mac, line27 line = strcompress(strtrim(line[0], 2))28 length = strlen(line)29 30 IF length EQ 0 THEN BEGIN31 print, ' *** WARNING : No macro definition for field ', var_name, $32 ' in file ', file_mac33 return, -134 ENDIF35 36 37 ; Separate macro def and legend+unit38 ;39 leg_pos = strpos(line,'<')40 line_def = STRMID(line,0,leg_pos)41 line_def = strcompress(strtrim(line_def[0], 2))42 macro_def = str_sep(line_def, ' ')43 nfields = n_elements(macro_def)44 16 print, ' Computing macro : ', macro_def 45 ;46 ; extract legend and unit47 ;48 legend = extract_str(line, '<', '>')49 unit = extract_str(line, '[', ']')50 17 51 18 ; 2) loop to decode definition and build field … … 126 93 127 94 95 IF debug_w THEN print, ' ...EXIT macro_read' 96 128 97 129 98 return, fieldo
Note: See TracChangeset
for help on using the changeset viewer.