Blame view

src/idl/dstmwrp_exp.pro 1022 Bytes
2910e8ce   Ilyes Choubani   Draft version of ...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
FUNCTION dstmwrp_exp, axis, index, number

;IC: modified so that a '1' isn't displayed before the values
 
  ;A special case.
  IF number EQ 0 THEN RETURN, '0'
 
  ; Assuming multiples of 10 with format.
  ex = String(number, Format='(e8.0)')
  pt = StrPos(ex, '.')
 
  first = StrMid(ex, 0, pt)
  sign = StrMid(ex, pt+2, 1)
  thisExponent = StrMid(ex, pt+3)
 
  ; Shave off leading zero in exponent
  WHILE StrMid(thisExponent, 0, 1) EQ '0' DO thisExponent = StrMid(thisExponent, 1)
 
  ; Fix for sign and missing zero problem.
  IF (Long(thisExponent) EQ 0) THEN BEGIN
     sign = ''
     thisExponent = '0'
  ENDIF
bc224f3e   Ilyes Choubani   Update of plottin...
24
25
26
27
  
     
  frmt = '10!U'
  IF !dustem_mlog then frmt='-'+frmt
2910e8ce   Ilyes Choubani   Draft version of ...
28
29
  ; Make the exponent a superscript.
  IF sign EQ '-' THEN BEGIN
bc224f3e   Ilyes Choubani   Update of plottin...
30
     IF first EQ 1 then RETURN, frmt + sign + thisExponent + '!N' ELSE RETURN, first + 'x' + frmt + sign + thisExponent + '!N'
2910e8ce   Ilyes Choubani   Draft version of ...
31
  ENDIF ELSE BEGIN
bc224f3e   Ilyes Choubani   Update of plottin...
32
     IF first EQ 1 then RETURN, frmt + thisExponent + '!N' ELSE RETURN, first + 'x' + frmt + thisExponent + '!N'
2910e8ce   Ilyes Choubani   Draft version of ...
33
  ENDELSE
bc224f3e   Ilyes Choubani   Update of plottin...
34
  
2910e8ce   Ilyes Choubani   Draft version of ...
35
36
 
END