source: trunk/SRC/ToBeReviewed/PLOTS/LABEL/label_gmt.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: 2.1 KB
Line 
1;+
2;
3; @file_comments
4; Apply GMT palette into IDL color/intervals system
5;
6; @categories
7;
8; @param MIN {in}{required}
9; A real number specifying above what value we want to trace a contour
10;
11; @param MAX {in}{required}
12; A real number specifying below what value we want to trace a contour
13;
14; @param INTERVALLE
15;
16; @param NCOUL
17;
18; @param NCONTOUR {out}
19; Number of contour to be drawn.
20;
21; @param LEVEL_Z2D {in}{required}
22; Vector containing values of isolignes to be traced.
23;
24; @param COUL
25;
26; @restrictions
27;
28; @examples
29;
30; @history
31;
32; @version
33; $Id$
34;
35;-
36PRO label_gmt, min, max, intervalle, ncoul, ncontour, level_z2d, coul
37;
38  compile_opt idl2, strictarrsubs
39;
40@common
41@com_eg
42
43   IF pal_type NE '2dom' THEN BEGIN
44
45;  color defined in lec_pal_gmt.pro
46
47      ncontour = ncont_gmt
48      level_z2d = levels_gmt
49      coul = coul_gmt
50      max = max_gmt
51      intervalle =  -1
52
53   ENDIF ELSE BEGIN
54
55      ; grey_shade palette (case 1 in label)
56      IF finite(min) EQ 0 THEN read, ' Grey shade needs a min,max :', min, max
57      ncontour  = fix((max-min)/intervalle)
58      level_z2d = min + intervalle*findgen(ncontour)
59      max=level_z2d[ncontour-1]+intervalle
60
61      ras = report(['     Number of contour intervals, plotting min & max ' + $
62string(ncontour) + string(min)+ string(max),' '])
63
64      ; color index
65
66      IF idx_pal EQ 0 THEN BEGIN
67
68         ; build palette
69         red = lonarr(99)
70         red[*] = 255
71         red[50:98] = long((100.-float(grey_shade))/100.*255.)
72
73         IF field.origin EQ 'diff' THEN BEGIN
74
75           ; difference plot : lighter below first negative interval
76            red[51:98] = long((100.-float(grey_shade_2))/100.*255.)
77            red[1:48] = long((100.-float(grey_shade))/100.*255.)
78            red[50] = 255
79
80         ENDIF
81
82         ; first color=black
83         ; last = white
84         red = [0, red]
85         red[99] = 255
86         ; gray scale
87         green = red
88         blue = red
89
90         tvlct, red, green, blue
91
92      ENDIF
93
94      mid_index = max(where(level_z2d LE fldatt.mid))
95      coul = findgen(ncontour)+49-mid_index +2
96
97   ENDELSE
98END
Note: See TracBrowser for help on using the repository browser.