!------------------------------------------------------------------------ ! LEVELS.GREG ! Procedure to define contour levels for multichannel image ! Variables defined in DEFINE.GRAPHIC ! S.Guilloteau 15-Oct-1992 !------------------------------------------------------------------------ define real range expo mant tmin tmax define integer n1 n2 ! if spacing.lt.0 then return endif if (&1%extrema.eq.0.or.(&1%min.eq.&1%max)) then ! means no extrema section compute tmin min &1 compute tmax max &1 ! let &1%extrema 2 else let tmin &1%min let tmax &1%max if tmin.eq.tmax then say "F-LEVELS, &1 has no range: max = min = " 'tmin' break endif endif if (spacing.eq.0) then let range = log10(tmax-tmin) let expo = int(range+20.)-21 let mant = range-expo-1 if (mant.lt.0.25) then let true_spacing 10**expo else if (mant.lt.0.60) then let true_spacing 2.*10**expo else if (mant.lt.0.90) then let true_spacing = 5.*10**expo else let true_spacing = 10**(expo+1) endif else let true_spacing = spacing endif let n1 nint(tmin|true_spacing) let n2 nint(tmax|true_spacing) if (n1.lt.0.and.n2.gt.0) then levels true_spacing*n1 to -0.95*true_spacing by true_spacing true_spacing to true_spacing*(n2+0.05) by true_spacing else if (n1.gt.0) then let n1 max(n1,1) levels true_spacing*n1 to true_spacing*(n2+0.05) by true_spacing else if (n1.lt.0.and.n2.lt.0) then let n1 -max(-n1,1) levels true_spacing*n1 to true_spacing*(n2+0.05) by true_spacing else if (n1.lt.0.and.n2.eq.0) then let n1 -max(-n1,1) levels true_spacing*n1 to -0.95*true_spacing by true_spacing else if (n1.eq.0.and.n2.ne.0) then levels true_spacing*(n1+1) to true_spacing*(n2+0.05) by true_spacing endif let level_min true_spacing*n1 let level_max true_spacing*n2