[2] | 1 | ;------------------------------------------------------------ |
---|
| 2 | ;------------------------------------------------------------ |
---|
| 3 | ;------------------------------------------------------------ |
---|
| 4 | ;+ |
---|
| 5 | ; |
---|
[142] | 6 | ; @file_comments |
---|
| 7 | ; Allows to choose the type of the label we want to use at the time of a contour. |
---|
[2] | 8 | ; |
---|
[142] | 9 | ; @categories |
---|
[157] | 10 | ; Graphics |
---|
[2] | 11 | ; |
---|
[142] | 12 | ; @param CAS {in}{required} |
---|
| 13 | ; Number of the type of the label we want to trace |
---|
| 14 | ; |
---|
[226] | 15 | ; @param MIN {in}{required} |
---|
[142] | 16 | ; Smallest value for the drawing of the contour. |
---|
[2] | 17 | ; |
---|
[142] | 18 | ; @param MAX {in}{required} |
---|
| 19 | ; Biggest value for the drawing of the contour. |
---|
[2] | 20 | ; |
---|
[163] | 21 | ; @keyword INTERVALLE {default=20} |
---|
[226] | 22 | ; Value of an interval between two isolines. By default, it is calculated to |
---|
[163] | 23 | ; draw 20 isolines. In all cases, this keyword must be returned have a nice |
---|
[142] | 24 | ; caption. If levels do not contain regular intervals, put it at -1. |
---|
[2] | 25 | ; |
---|
[163] | 26 | ; @keyword NLEVEL {default=20} |
---|
| 27 | ; Number of contour to be drawn. Active if LABEL=0 or is not specified. |
---|
[2] | 28 | ; |
---|
[142] | 29 | ; @param NCONTOUR {out} |
---|
| 30 | ; Number of contour to be drawn. |
---|
[226] | 31 | ; |
---|
[142] | 32 | ; @param LEVEL_Z2D {out} |
---|
| 33 | ; Vector containing values of contours we draw. |
---|
[2] | 34 | ; |
---|
[142] | 35 | ; @param COLNUMB {out} |
---|
| 36 | ; Vector containing the number of colors which will serve to fill contours. |
---|
[2] | 37 | ; |
---|
[142] | 38 | ; @uses |
---|
| 39 | ; common.pro |
---|
[2] | 40 | ; |
---|
[226] | 41 | ; @history |
---|
[157] | 42 | ; Sebastien Masson (smasson\@lodyc.jussieu.fr) |
---|
[142] | 43 | ; 7/5/98 |
---|
[2] | 44 | ; |
---|
[226] | 45 | ; @version |
---|
[142] | 46 | ; $Id$ |
---|
[2] | 47 | ; |
---|
| 48 | ;- |
---|
[327] | 49 | PRO label, cas, min, max, ncontour, level_z2d, colnumb, NLEVEL=nlevel $ |
---|
| 50 | ,INTERVALLE=intervalle, STRICTFILL=strictfill |
---|
[114] | 51 | ; |
---|
| 52 | compile_opt idl2, strictarrsubs |
---|
| 53 | ; |
---|
[2] | 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 |
---|
[142] | 73 | ; nlevel label between the min and the max |
---|
[2] | 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) |
---|
[39] | 77 | colnumb = ncoul*(findgen(Ncontour))/Ncontour+ncoul/(2*ncontour) |
---|
[2] | 78 | intervalle = level_z2d[1]-level_z2d[0] |
---|
| 79 | end |
---|
| 80 | 1: begin |
---|
[142] | 81 | ; a certain number of label from the min to the nearest possible to the |
---|
| 82 | ; max with a constant step by interval |
---|
[2] | 83 | ncontour = fix((max-min)/intervalle) |
---|
| 84 | ncontour = 1 > ncontour |
---|
[226] | 85 | level_z2d = min + intervalle*findgen(Ncontour) |
---|
[39] | 86 | colnumb = ncoul*(findgen(Ncontour))/Ncontour+ncoul/(2*ncontour) |
---|
[114] | 87 | max=level_z2d[Ncontour-1]+intervalle |
---|
[2] | 88 | end |
---|
[142] | 89 | ; label to do same sss than dessier |
---|
[2] | 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 |
---|
[39] | 95 | colnumb = findgen(23)+1 |
---|
[2] | 96 | masx = 37.75 |
---|
| 97 | intervalle = -1 |
---|
| 98 | return |
---|
| 99 | end |
---|
| 100 | 3: begin |
---|
[142] | 101 | ; Readinf of intervals + palette in the file GMT |
---|
[2] | 102 | |
---|
[39] | 103 | label_gmt, min, max, intervalle, ncoul, ncontour, level_z2d, colnumb |
---|
[2] | 104 | |
---|
| 105 | end |
---|
| 106 | else: begin |
---|
[39] | 107 | ras = report('Le numero de label demande n''existe pas') |
---|
[2] | 108 | end |
---|
| 109 | ENDCASE |
---|
| 110 | if keyword_set(strictfill) then begin |
---|
| 111 | ncontour = ncontour+1 |
---|
| 112 | level_z2d = [level_z2d, max] |
---|
[39] | 113 | colnumb = [colnumb, ncoul-1] |
---|
[2] | 114 | endif |
---|
| 115 | return |
---|
| 116 | end |
---|