;+ ; ; @file_comments ; Allows to choose the type of the label we want to use at the time of a ; contour. ; ; @categories ; Graphics ; ; @param CAS {in}{required} ; Number of the type of the label we want to trace ; ; @param MIN {in}{required} ; Smallest value for the drawing of the contour. ; ; @param MAX {in}{required} ; Biggest value for the drawing of the contour. ; ; @keyword INTERVALLE {default=20} ; Value of an interval between two isolines. By default, it is calculated to ; draw 20 isolines. In all cases, this keyword must be returned have a nice ; caption. If levels do not contain regular intervals, put it at -1. ; ; @keyword NLEVEL {default=20} ; Number of contour to be drawn. Active if LABEL=0 or is not specified. ; ; @param NCONTOUR {out} ; Number of contour to be drawn. ; ; @param LEVEL_Z2D {out} ; Vector containing values of contours we draw. ; ; @param COLNUMB {out} ; Vector containing the number of colors which will serve to fill contours. ; ; @uses ; common ; ; @history ; Sebastien Masson (smasson\@lodyc.jussieu.fr) ; 7/5/98 ; ; @version ; $Id$ ; ;- PRO label, cas, min, max, ncontour, level_z2d, colnumb, NLEVEL=nlevel $ ,INTERVALLE=intervalle, STRICTFILL=strictfill ; compile_opt idl2, strictarrsubs ; @common ; ncoul = !D.n_Colors < 256 case cas of 0: begin ; nlevel label between the min and the max if keyword_set(Nlevel) eq 0 then ncontour=20 else ncontour=nlevel ncontour = 1 > ncontour level_z2d = min + (max-min)*(findgen(Ncontour)/Ncontour) colnumb = ncoul*(findgen(Ncontour))/Ncontour+ncoul/(2*ncontour) intervalle = level_z2d[1]-level_z2d[0] end 1: begin ; a certain number of label from the min to the nearest possible to the ; max with a constant step by interval ncontour = fix((max-min)/intervalle) ncontour = 1 > ncontour level_z2d = min + intervalle*findgen(Ncontour) colnumb = ncoul*(findgen(Ncontour))/Ncontour+ncoul/(2*ncontour) max=level_z2d[Ncontour-1]+intervalle end ; label to do same sss than dessier 2: begin lct, 63, file = 'palette.tbl' level_z2d = [20, 25, 30, 31, 32, 33, 33.5, 34+.25*findgen(16)] ncontour=23 colnumb = findgen(23)+1 masx = 37.75 intervalle = -1 return end 3: begin ; Readinf of intervals + palette in the file GMT label_gmt, min, max, intervalle, ncoul, ncontour, level_z2d, colnumb end else: begin ras = report('Le numero de label demande n''existe pas') end ENDCASE if keyword_set(strictfill) then begin ncontour = ncontour+1 level_z2d = [level_z2d, max] colnumb = [colnumb, ncoul-1] endif return end