[157] | 1 | ;+ |
---|
[231] | 2 | ; |
---|
| 3 | ; @file_comments |
---|
[2] | 4 | ; Apply GMT palette into IDL color/intervals system |
---|
[231] | 5 | ; |
---|
[157] | 6 | ; @categories |
---|
[231] | 7 | ; |
---|
[157] | 8 | ; @param MIN {in}{required} |
---|
[369] | 9 | ; A real number specifying above what value we want to trace a contour |
---|
[2] | 10 | ; |
---|
[157] | 11 | ; @param MAX {in}{required} |
---|
[369] | 12 | ; A real number specifying below what value we want to trace a contour |
---|
[157] | 13 | ; |
---|
[231] | 14 | ; @param INTERVALLE |
---|
[157] | 15 | ; |
---|
[231] | 16 | ; @param NCOUL |
---|
| 17 | ; |
---|
[157] | 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 |
---|
[231] | 27 | ; |
---|
[157] | 28 | ; @examples |
---|
| 29 | ; |
---|
| 30 | ; @history |
---|
| 31 | ; |
---|
| 32 | ; @version |
---|
| 33 | ; $Id$ |
---|
[325] | 34 | ; |
---|
[157] | 35 | ;- |
---|
[2] | 36 | PRO label_gmt, min, max, intervalle, ncoul, ncontour, level_z2d, coul |
---|
[114] | 37 | ; |
---|
| 38 | compile_opt idl2, strictarrsubs |
---|
| 39 | ; |
---|
[2] | 40 | @common |
---|
| 41 | @com_eg |
---|
| 42 | |
---|
[231] | 43 | IF pal_type NE '2dom' THEN BEGIN |
---|
[2] | 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 | |
---|
[231] | 53 | ENDIF ELSE BEGIN |
---|
[2] | 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) |
---|
[369] | 58 | level_z2d = min + intervalle*findgen(ncontour) |
---|
| 59 | max=level_z2d[ncontour-1]+intervalle |
---|
[2] | 60 | |
---|
[240] | 61 | ras = report([' Number of contour intervals, plotting min & max ' + $ |
---|
| 62 | string(ncontour) + string(min)+ string(max),' ']) |
---|
[2] | 63 | |
---|
| 64 | ; color index |
---|
| 65 | |
---|
[231] | 66 | IF idx_pal EQ 0 THEN BEGIN |
---|
[2] | 67 | |
---|
| 68 | ; build palette |
---|
| 69 | red = lonarr(99) |
---|
| 70 | red[*] = 255 |
---|
| 71 | red[50:98] = long((100.-float(grey_shade))/100.*255.) |
---|
| 72 | |
---|
[231] | 73 | IF field.origin EQ 'diff' THEN BEGIN |
---|
| 74 | |
---|
[2] | 75 | ; difference plot : lighter below first negative interval |
---|
| 76 | red[51:98] = long((100.-float(grey_shade_2))/100.*255.) |
---|
[114] | 77 | red[1:48] = long((100.-float(grey_shade))/100.*255.) |
---|
[2] | 78 | red[50] = 255 |
---|
| 79 | |
---|
[231] | 80 | ENDIF |
---|
[2] | 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 | |
---|
[231] | 92 | ENDIF |
---|
| 93 | |
---|
[2] | 94 | mid_index = max(where(level_z2d LE fldatt.mid)) |
---|
[369] | 95 | coul = findgen(ncontour)+49-mid_index +2 |
---|
[2] | 96 | |
---|
[231] | 97 | ENDELSE |
---|
| 98 | END |
---|