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

Last change on this file since 327 was 327, checked in by pinsard, 17 years ago

modification of headers : mainly blanks around = sign for keywords in declaration of function and pro

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