source: trunk/procs/fld_pltint.pro @ 13

Last change on this file since 13 was 2, checked in by post_it, 17 years ago

Initial import from ~/POST_IT/

File size: 2.7 KB
Line 
1;-----------------------------------------------
2; Define field plot attributes min/max/int/mult
3; EG 25/2/99
4;-----------------------------------------------
5FUNCTION fld_pltint,  var_name, plttyp, dimplot, hotyp
6
7@common
8@com_eg
9
10; arguments var_name = variable name,
11;           plttyp   = plot type
12;           dimplot  = dimension of plot (1,2)
13; outputs structure
14; define variable plot attributes (contour intervals)
15
16   fldintr = {name:'', int: 0.0, mult: 0.0, add: 0.0,  unit: '', mid: 0.0}
17
18; name of defaults files
19
20   CASE plttyp of
21      'plt': file_iso = 'fld_glo_iso.def'
22      'pltz': file_iso = 'fld_glo_iso.def'
23      'pltt': file_iso = 'fld_glo_iso.def'
24      ELSE: file_iso = 'fld_glo_iso.def'
25   ENDCASE
26   IF field.origin EQ 'diff' THEN file_iso = 'fld_zoo_iso.def'
27
28   print, field.origin
29
30   print,' '
31   print,'    Reading iso/mult of ',var_name,' from : ', file_iso
32   
33   spawn, 'grep -i "\ '+var_name+' " '+hom_def+file_iso, line
34   line = strcompress(strtrim(line[0], 2))
35   length = strlen(line)
36   
37   IF length EQ 0 THEN BEGIN
38     
39      print, '    *** field_pltint : no iso/mult for field ', var_name, $
40       ' in file ', file_iso
41      fldintr.int = !VALUES.F_NAN
42      fldintr.mult = 1.0
43      fldintr.add = 0.0
44      fldintr.unit = ''
45      fldintr.mid = 0.0
46     
47   ENDIF ELSE BEGIN
48      argvar = str_sep(line, ' ')
49      IF strmid(argvar[1], 0, 1) EQ '@' THEN BEGIN
50                                ; get info from other variable
51         friend_name = strmid(argvar[1], 1, strlen(argvar[1])-1)
52         print, '      -> linked to ', friend_name
53         fldintr = fld_pltint(friend_name, plttyp, dimplot, hotyp)
54      ENDIF ELSE BEGIN
55         fldintr.int = float(argvar[3])
56                                ; separation for iso =0 if difference
57                                ; plot
58         CASE field.origin OF
59            'diff': BEGIN
60               fldintr.mid = 0.
61               fldatt.max = fldatt.dmax
62               fldatt.min = -fldatt.dmax
63               fldatt.homax = fldatt.max
64               fldatt.homin = fldatt.min
65               fldatt.max1d = fldatt.max
66               fldatt.min1d = fldatt.min
67            END
68            ELSE: fldintr.mid = float(argvar[5])
69         ENDCASE
70         IF size(argvar, /N_ELEMENTS) eq 8  THEN BEGIN ; OR field.origin EQ 'diff'
71            fldintr.mult = 1.0
72            fldintr.add = 0.0
73            fldintr.unit = ''
74         ENDIF ELSE BEGIN 
75            fldintr.mult = float(argvar[8])
76            fldintr.add = float(argvar[9])
77            fldintr.unit = argvar[10]
78         ENDELSE
79         tempvar = SIZE(TEMPORARY(argvar))
80      ENDELSE
81   ENDELSE
82     
83   fldintr.name = var_name
84
85   return, fldintr
86END
Note: See TracBrowser for help on using the repository browser.