;+ ; ; @hidden ; ;- PRO thresholdstyle, limit, ltlstyle, gtlstyle, level_z2d, linestyle, thick ; compile_opt idl2, strictarrsubs ; dummy = where(level_z2d lt limit, n) IF n GT 0 THEN BEGIN IF limit EQ level_z2d[n < (n_elements(level_z2d) -1)] THEN BEGIN thick = [replicate(1, n), 2, replicate(1, 1 > (n_elements(level_z2d)-1-n))] linestyle = [replicate(ltlstyle, n), 0, replicate(gtlstyle, 1 > (n_elements(level_z2d)-1-n))] ENDIF ELSE BEGIN thick = [0] linestyle = [replicate(ltlstyle, n), replicate(gtlstyle, 1 > (n_elements(level_z2d) -n))] ENDELSE ENDIF ELSE BEGIN IF limit EQ level_z2d[n] THEN BEGIN thick = [2, replicate(1, 1 > (n_elements(level_z2d)-1))] linestyle = [0, replicate(gtlstyle, 1 > (n_elements(level_z2d)-1))] ENDIF ELSE BEGIN thick = [1] linestyle = [gtlstyle] ENDELSE ENDELSE return end ;+ ; ; @file_comments ; Choose the linestyle to trace iso-contour ; (Will define the keywords c_linestyle and c_thick) ; ; @categories ; Graphics ; ; @param LABSTYLE {in}{required} ; ; Two kind of labelstyle are accepted: ; ; 1) A number referring to the existing choices: ; 0 : Two thin continuous lines, one bold continuous line... ; 1 : before the middle of levels: thin dash. Then thin continuous ; line. and bold for the middle ; 2 : Same as case 1 but threshold value is defined by the user ; by answering a question ; 3 : Solid-Bold, solid-thin, dash Dot-thin, solid-thin, Solid-Bold... ; 4 : Solid-very-thin, except for contour O, that is solid-bold ; ; 2) for the labelstyle based on a threshold value (with a style ; before and after the threshold value and a bold solid line for the ; value itself, a more general definition can be given with a scalar ; string with the following structure: 'xxNN...NNyy' with ; xx and yy correspondind to one the following choices (with the ; corresponding meaning) ; so -> Solid ; do -> Dotted ; da -> Dashed ; dd -> Dash Dot ; ld -> Long Dashes ; and NN...NN any kind of number that will define the threshold value. ; for example 'do-6.6so' will do dotted line until -6.6 and solid line after. ; ; @param LEVEL_Z2D {in}{required} ; Vector containing values of isolignes to be traced. ; ; @param LINESTYLE {out} ; Used interbally by plt(z)(t) to define c_linestyle when calling pltbase. ; Vector used to define the isocontour's style. ; ; @param THICK {out} ; Used interbally by plt(z)(t) to define c_thick when calling pltbase. ; Vector used to define the isocontour's thickness. ; ; @history ; Sebastien Masson (smasson\@lodyc.jussieu.fr) ; Oct 2007 revisiting... ; ; @version ; $Id$ ; ;- PRO style, labstyle, level_z2d, linestyle, thick ; compile_opt idl2, strictarrsubs ; ; Just to remember.. there is the codes for c_linestyle ; 0 Solid ; 1 Dotted ; 2 Dashed ; 3 Dash Dot ; 4 Dash Dot Dot Dot ; 5 Long Dashes ; IF size(labstyle, /type) EQ 7 THEN BEGIN CASE strlowcase(strmid(labstyle, 0, 2)) OF 'so':ltlstyle = 0 'do':ltlstyle = 1 'da':ltlstyle = 2 'dd':ltlstyle = 3 'ld':ltlstyle = 5 ENDCASE CASE strlowcase(strmid(labstyle, 1, 2, /reverse_offset)) OF 'so':gtlstyle = 0 'do':gtlstyle = 1 'da':gtlstyle = 2 'dd':gtlstyle = 3 'ld':gtlstyle = 5 ENDCASE limit = float(strmid(labstyle, 2, strlen(labstyle)-4)) thresholdstyle, limit, ltlstyle, gtlstyle, level_z2d, linestyle, thick ENDIF ELSE BEGIN CASE labstyle OF 0: BEGIN ; Two thin continuous lines, one bold continuous line thick = [1, 1, 2] linestyle = [0] END 1: BEGIN ; Before the middle of levels: thin dash. Then thin continuous line. ; If the middle of the drawing is drawn, it is in bold continuous line. odd = n_elements(level_z2d)-2*fix(n_elements(level_z2d)/2) zero = replicate(0, fix(n_elements(level_z2d)/2)) one = replicate(1, fix(n_elements(level_z2d)/2)) two = replicate(2, fix(n_elements(level_z2d)/2)) IF odd THEN BEGIN thick = [one, 2, one] linestyle = [two, 0, zero] ENDIF ELSE BEGIN thick = [0] linestyle = [two, zero] ENDELSE END 2: BEGIN ; Before the threshold (defined by answering to a question): thin dash. ; Then thin continuous trait. If the sill is drawn, it is in boldface continuous trait. limit = xquestion('What is the threshold value between dashed and continues line? ', '0') limit = float(limit) thresholdstyle, limit, 2, 0, level_z2d, linestyle, thick END ; Solid-Bold, solid-thin, dash Dot-thin, solid-thin, Solid-Bold... 3: begin n = n_elements(level_z2d) limit = level_z2d[1+n/2] thick = intarr(n) thick[indgen(n/4)*4] = 1 thick[indgen(n/4)*4+1] = 1 thick[indgen(n/4)*4+2] = 2 thick[indgen(n/4)*4+3] = 1 linestyle = intarr(n) linestyle[indgen(n/4)*4] = 3 linestyle[indgen(n/4)*4+1] = 0 linestyle[indgen(n/4)*4+2] = 0 linestyle[indgen(n/4)*4+3] = 0 end 4: begin ; Boldface continuous trait. limit = 1.e-6 thick = replicate(.5, n_elements(level_z2d)) linestyle = [0] rien = where(abs(level_z2d)/max(abs(level_z2d)) LT limit) if rien[0] NE -1 then thick[rien[0]] = 3 end else: begin ras = report('Bab value of the style (can be from 0 to 4 or a scalar string)') stop end endcase ENDELSE return end