source: trunk/SRC/ToBeReviewed/PLOTS/LABEL/label.pro @ 369

Last change on this file since 369 was 369, checked in by pinsard, 16 years ago

improvements of some headers

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.2 KB
Line 
1;+
2;
3; @file_comments
4; Allows to choose the type of the label we want to use at the time of a
5; contour.
6;
7; @categories
8; Graphics
9;
10; @param CAS {in}{required}
11; Number of the type of the label we want to trace
12;
13; @param MIN {in}{required}
14; Smallest value for the drawing of the contour.
15;
16; @param MAX {in}{required}
17; Biggest value for the drawing of the contour.
18;
19; @keyword INTERVALLE {default=20}
20; Value of an interval between two isolines. By default, it is calculated to
21; draw 20 isolines. In all cases, this keyword must be returned have a nice
22; caption. If levels do not contain regular intervals, put it at -1.
23;
24; @keyword NLEVEL {default=20}
25; Number of contour to be drawn. Active if LABEL=0 or is not specified.
26;
27; @param NCONTOUR {out}
28; Number of contour to be drawn.
29;
30; @param LEVEL_Z2D {out}
31; Vector containing values of contours we draw.
32;
33; @param COLNUMB {out}
34; Vector containing the number of colors which will serve to fill contours.
35;
36; @uses
37; <pro>common</pro>
38;
39; @history
40; Sebastien Masson (smasson\@lodyc.jussieu.fr)
41;                  7/5/98
42;
43; @version
44; $Id$
45;
46;-
47PRO label, cas, min, max, ncontour, level_z2d, colnumb, NLEVEL=nlevel $
48          ,INTERVALLE=intervalle, STRICTFILL=strictfill
49;
50  compile_opt idl2, strictarrsubs
51;
52@common
53   if !d.name EQ 'PS' OR !d.name EQ 'Z' then BEGIN
54      old_dname = !d.name
55      thisOS = !VERSION.OS_FAMILY
56      thisOS = STRMID(thisOS, 0, 3)
57      thisOS = STRUPCASE(thisOS)
58      CASE thisOS of
59         'MAC': SET_PLOT, thisOS
60         'WIN': SET_PLOT, thisOS
61         ELSE: SET_PLOT, 'X'
62      ENDCASE
63      !p.BACKGROUND=(!d.n_colors-1) < 255
64      !p.color=0
65      if !d.n_colors gt 256 then !p.background='ffffff'x
66      ncoul = !D.n_Colors < 256
67      set_plot,old_dname
68   ENDIF ELSE ncoul = !D.n_Colors < 256
69   case cas of
70      0: begin
71; nlevel label between the min and the max
72         if keyword_set(Nlevel) eq 0 then ncontour=20 else ncontour=nlevel
73         ncontour = 1 > ncontour
74         level_z2d  = min + (max-min)*(findgen(Ncontour)/Ncontour)
75         colnumb    = ncoul*(findgen(Ncontour))/Ncontour+ncoul/(2*ncontour)
76         intervalle = level_z2d[1]-level_z2d[0]
77      end
78      1: begin
79; a certain number of label from the min to the nearest possible to the
80; max with a constant step by interval
81         ncontour  = fix((max-min)/intervalle)
82         ncontour = 1 > ncontour
83         level_z2d = min + intervalle*findgen(Ncontour)
84         colnumb   = ncoul*(findgen(Ncontour))/Ncontour+ncoul/(2*ncontour)
85         max=level_z2d[Ncontour-1]+intervalle
86      end
87; label to do same sss than dessier
88
89      2: begin
90         lct, 63, file = 'palette.tbl'
91         level_z2d  = [20, 25, 30, 31, 32, 33, 33.5, 34+.25*findgen(16)]
92         ncontour=23
93         colnumb    = findgen(23)+1
94         masx = 37.75
95         intervalle = -1
96         return
97      end
98      3: begin
99; Readinf of intervals + palette in the file GMT
100
101         label_gmt, min, max, intervalle, ncoul, ncontour, level_z2d, colnumb
102
103      end
104      else: begin
105         ras = report('Le numero de label demande n''existe pas')
106      end
107   ENDCASE
108   if keyword_set(strictfill) then begin
109      ncontour = ncontour+1
110      level_z2d = [level_z2d, max]
111      colnumb = [colnumb, ncoul-1]
112   endif
113   return
114end
Note: See TracBrowser for help on using the repository browser.