a2000omni.pro
1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
pro a2000omni, Time, Orbit
StepDefaut = 3600.0
FillValue = -1.e31
Number = N_elements(Time)
Bgsm = fltarr(3)
xyz = fltarr(3)
num31 = where(Orbit[0,*] ne FillValue, Index31)
if (Index31 le 0) then return
Time = Time[num31]
Orbit = Orbit[*,num31]
; StepAve = (Time[Number-1] - Time[0])/20.0 > StepDefaut
StepAve = StepDefaut;
TimeIntDst = StepAve > 3600.;
TimeIntDstS = call_external(!DDLIB + 'DD_idl.so','GetTime', double(TimeIntDst), /S_Value)
StepAveS = call_external(!DDLIB + 'DD_idl.so','GetTime', double(StepAve), /S_Value)
bm = fltarr(3);
bdd = fltarr(3,7);
UT = lonarr(7);
p = [2., 1., 1., 1., 1., 1., 1.];
result = call_external(!PROJLIB + 'a2012fa_idl.so', 'pstatus', p);
for TimeCurr = Time[0], Time[Number-1], double(StepAve) do begin
numOrb = where((Time - TimeCurr LT StepAve) AND (Time - TimeCurr GE 0.0), IndexOrb)
if (IndexOrb LE 0) then continue
params = sw_monitor_a99_omni_(TimeCurr,StepAve,Orbit[*,numOrb[IndexOrb/2]])
STime = call_external(!DDLIB + 'DD_idl.so','GetTime', double(TimeCurr+StepAve/2.0), /S_Value)
AE = ae_(STime, StepAveS, TimeDst, RetSize, Sampling, /CLOSE);
AL = RetSize GT 0 ? mean(AE[1,*]) : -100.0;
Dst = dst_(STime, TimeIntDstS, TimeDst, RetSize, Sampling, /CLOSE);
Dst_av = RetSize GT 0 ? mean(Dst) : -10.;
ro = params[0];
v = params[1];
bimf =params[2:4];
for i = 0, IndexOrb - 1 do begin
res = call_external(!DDLIB + 'DD_idl.so','GetGavTime', UT, double(TimeCurr+StepAve/2.0));
x = Orbit[*,numOrb[i]];
result = call_external(!PROJLIB + 'a2012fa_idl.so', 'model', $
UT[0], UT[1], UT[2], float(UT[3]),$
ro, v, bimf, Dst_av, AL, $
x, bm, bdd);
if bm[0] eq 0.0 then bm(*) = FillValue ;
Orbit[*,numOrb[i]] = bm;
endfor
endfor
return
end