bt96_init.pro 3.54 KB
; tsyganenko 96 field along the orbit
;  

pro bt96_init,   CLUSTER1 = Cluster1, CLUSTER2 = Cluster2, CLUSTER3 = Cluster3, CLUSTER4 = Cluster4, $
                     THEMISA = ThemisA, THEMISB = ThemisB, THEMISC = ThemisC, $
                     THEMISD = ThemisD, THEMISE = ThemisE, $
                     GEOTAIL = Geotail, $
                     OMNI = OMNI, AMDA = AMDA, $
                     PSYM = psym, COLOR = color, AY1TITLE = AY1Title, $                    
                     ; vector
                     X = x, Y = y, Z = z, TOTAL = total, FRAME = frame, $
                     DELAY = delay, $                    
                     ; all additional keywords
                    _EXTRA = e 

common GraphC, graph, GraphN, Item
 
 names = ['B!DX', 'B!DY', 'B!DZ', 'B']
 
 pen = !dnc-1 & comp = 100 & symbol = -3;
 
 if (KEYWORD_SET(COLOR)) then pen = color; 
 if (KEYWORD_SET(PSYM)) then symbol = psym;
     
     title = 'CL1';
     graph[GraphN].SetCommonF[0] = 'c1_xyz_com';
     graph[GraphN].GetDataF[0] = 'getc1_xyz'; 
 
  if KEYWORD_SET(CLUSTER2) then begin
     title = 'CL2';
     graph[GraphN].SetCommonF[0] = 'c2_xyz_com';
     graph[GraphN].GetDataF[0] = 'getc2_xyz'; 
   endif
  if KEYWORD_SET(CLUSTER3) then begin     
     title = 'CL3';
     graph[GraphN].SetCommonF[0] = 'c3_xyz_com';
     graph[GraphN].GetDataF[0] = 'getc3_xyz'; 
   endif
  if KEYWORD_SET(CLUSTER4) then begin     
     title = 'CL4'
     graph[GraphN].SetCommonF[0] = 'c4_xyz_com';
     graph[GraphN].GetDataF[0] = 'getc4_xyz'; 
   endif
  if KEYWORD_SET(THEMISA) then begin
    title = 'THA'
    graph[GraphN].SetCommonF[0] = 'tha_xyz_com'; 
    graph[GraphN].GetDataF[0] ='gettha_xyz';
   endif
 if KEYWORD_SET(THEMISB) then begin
    title = 'THB'
    graph[GraphN].SetCommonF[0] = 'thb_xyz_com'; 
    graph[GraphN].GetDataF[0] ='getthb_xyz';
   endif
 if KEYWORD_SET(THEMISC) then begin
    title = 'THC'
    graph[GraphN].SetCommonF[0] = 'thc_xyz_com'; 
    graph[GraphN].GetDataF[0] ='getthc_xyz';
   endif
 if KEYWORD_SET(THEMISD) then begin
    title = 'THD'
    graph[GraphN].SetCommonF[0] = 'thd_xyz_com'; 
    graph[GraphN].GetDataF[0] = 'getthd_xyz';
   endif
 if KEYWORD_SET(THEMISE) then begin
    title = 'THE'
    graph[GraphN].SetCommonF[0] = 'the_xyz_com'; 
    graph[GraphN].GetDataF[0] = 'getthe_xyz';
   endif
 if KEYWORD_SET(GEOTAIL) then begin
    title = 'GTL'
    graph[GraphN].SetCommonF[0] = 'gtl_xyz_com'; 
    graph[GraphN].GetDataF[0] = 'getgtl_xyz';
   endif

t96Function = KEYWORD_SET(OMNI) ? 'T96OMNI' : 'T96';
 
frame = "GSM";
graph[GraphN].ProcessF= t96Function; 
  
if (KEYWORD_SET(FRAME)) then begin 
  if (frame eq "GSE") then graph[GraphN].ProcessF= t96Function + ';gsm2gse';
  if (frame eq "SM")  then graph[GraphN].ProcessF= t96Function + ';gse2sm';
endif 

graph[GraphN].names = PTR_NEW(/ALLOCATE_HEAP)
graph[GraphN].Type = 'T96_T'
graph[GraphN].DataN = 1 
graph[GraphN].DeltaT = (Graph[GraphN].TotalTime + 120.0D0) < 36000.0D0 ;

yTitle = title + ' T96 B '+frame+', nT';

if (KEYWORD_SET(AY1TITLE)) then graph[GraphN].Ly.title = AY1Title $
else graph[GraphN].Ly.title = yTitle

graph[GraphN].AxisF = 'lineaxis,' + string(Graph[GraphN].TotalTime)

if (KEYWORD_SET(X)) then comp = 0;
if (KEYWORD_SET(Y)) then comp = 1;
if (KEYWORD_SET(Z)) then comp = 2;
if (KEYWORD_SET(TOTAL)) then comp = 3;

graph[GraphN].PlotF = comp eq 100 ? 'PlotVec': 'PlotVec_Comp_New, ' + string(comp) +','+ string(pen ) +','+ string(symbol)
graph[GraphN].names = PTR_NEW(/ALLOCATE_HEAP)
*(graph[GraphN].names) = (comp le 3) ? names : names[0:2];
 
graph[GraphN].LastPlotF = 'nodatalast' 
return
end