56 |
|
RowMax : 7*MF + 1; |
57 |
|
Rmax : raccum(RowMax); |
58 |
|
Rfindrow(r, rem) : if(rem-rnaz(r)-.5, Rfindrow(r+1, rem-rnaz(r)), r); |
59 |
< |
Rrow = if(Rbin-(Rmax +.5), RowMax, Rfindrow(0, Rbin)); |
59 |
> |
Rrow = if(Rbin-(Rmax-.5), RowMax-1, Rfindrow(0, Rbin)); |
60 |
|
Rcol = Rbin - raccum(Rrow) - 1; |
61 |
|
Razi_width = 2*PI / rnaz(Rrow); |
62 |
|
RAH : alpha*DEGREE; |
63 |
|
Razi = if(Rbin-.5, (Rcol + x2 - .5)*Razi_width, 2*PI*x2); |
64 |
< |
Ralt = if(Rbin-.5, (Rrow + x1)*RAH, asin(2*x1-1)); |
64 |
> |
Ralt = if(Rbin-.5, (Rrow + x1)*RAH, asin(-x1)); |
65 |
|
Romega = if(.5-Rbin, 2*PI, if(Rmax-.5-Rbin, |
66 |
|
Razi_width*(sin(RAH*(Rrow+1)) - sin(RAH*Rrow)), |
67 |
|
2*PI*(1 - cos(RAH/2)) ) ); |
89 |
|
my @bestdir; |
90 |
|
if (@sundir) { |
91 |
|
my $somega = ($sundir[3]/360)**2 * 3.141592654**3; |
92 |
< |
my $cmd = "cnt $nbins | rcalc -e '$rhcal' -e Rbin=recno " . |
92 |
> |
my $cmd = "cnt " . ($nbins-1) . |
93 |
> |
" | rcalc -e '$rhcal' -e Rbin=recno " . |
94 |
|
"-e 'dot=Dx*$sundir[0] + Dy*$sundir[1] + Dz*$sundir[2]' " . |
95 |
|
"-e 'cond=dot-.866' " . |
96 |
|
q{-e '$1=if(1-dot,acos(dot),0);$2=Romega;$3=recno' }; |