1 | #pragma TextEncoding = "MacRoman" |
---|
2 | #pragma rtGlobals=3 // Use modern global access method and strict wave access. |
---|
3 | |
---|
4 | |
---|
5 | |
---|
6 | |
---|
7 | |
---|
8 | |
---|
9 | // |
---|
10 | // this is an empirical representation of the White Beam wavelength |
---|
11 | // distribution. |
---|
12 | // |
---|
13 | // using Integrate function -- |
---|
14 | // |
---|
15 | // integral = 20926 (cts*A) for "top" |
---|
16 | // integral = 19933 (cts*A) for "middle" |
---|
17 | // integration of interpolated data (100 pts) = 20051 (3 A to 9 A) |
---|
18 | // |
---|
19 | // |
---|
20 | // |
---|
21 | // of the three choices, using the fit to the "top" of the distribution gives the best-looking |
---|
22 | // result when compared to the AgBeh data |
---|
23 | // |
---|
24 | Function V_WhiteBeamDist(lam) |
---|
25 | Variable lam |
---|
26 | |
---|
27 | if(lam < 3.37) |
---|
28 | return(0) |
---|
29 | endif |
---|
30 | |
---|
31 | if(lam < 3.69) |
---|
32 | return(-31013 + 9198*lam) |
---|
33 | endif |
---|
34 | |
---|
35 | if(lam < 3.84) |
---|
36 | return(23715 -5649*lam) |
---|
37 | endif |
---|
38 | |
---|
39 | // the "middle" of the spikes |
---|
40 | // if(lam < 4.12) |
---|
41 | // return(-84962 + 22634*lam) |
---|
42 | // endif |
---|
43 | // if(lam < 8.37) |
---|
44 | // return(-2336 + 11422*exp(-( (lam-3.043)/4.234 )^2)) |
---|
45 | // endif |
---|
46 | |
---|
47 | // the "top" of the spikes |
---|
48 | if(lam < 4.16) |
---|
49 | return(-84962 + 22634*lam) |
---|
50 | endif |
---|
51 | if(lam < 8.25) |
---|
52 | return(-2336 + 12422*exp(-( (lam-3.043)/4.034 )^2)) |
---|
53 | endif |
---|
54 | |
---|
55 | // anything larger than 8.37, return 0 |
---|
56 | return(0) |
---|
57 | |
---|
58 | End |
---|
59 | |
---|
60 | // this is not used - there is no improvement in the results when using the "full" shape of the |
---|
61 | // WB distribution. |
---|
62 | Function V_WhiteBeamInterp(lam) |
---|
63 | Variable lam |
---|
64 | |
---|
65 | WAVE interp_lam = root:interp_lam |
---|
66 | WAVE interp_cts = root:interp_cts |
---|
67 | |
---|
68 | return(interp(lam,interp_lam,interp_cts)) |
---|
69 | End |
---|
70 | |
---|
71 | // change the x-scaling of cts_for_mean to 3,9 (beg,end) |
---|
72 | // 3309 is the average value of cts_for_mean |
---|
73 | // cts_for_mean = interp_cts*x/3309 |
---|
74 | // |
---|
75 | // gives an average wavelength of 5.302 A |
---|
76 | // median ~ 5.97 A |
---|
77 | // |
---|
78 | Function V_WB_Mean() |
---|
79 | |
---|
80 | WAVE cts_for_mean |
---|
81 | Variable tot=sum(cts_for_mean) |
---|
82 | Variable ans |
---|
83 | |
---|
84 | cts_for_mean = cts_for_mean*x |
---|
85 | ans = sum(cts_for_mean)/tot |
---|
86 | |
---|
87 | return(ans) |
---|
88 | End |
---|
89 | |
---|