;========================================================================= ; ; T96EXAMPLE.PRO; ; ; Example of usage of interface Level 2 for DD system ; This example allows to get T96 data along INTERBALL TAIL orbit ; ; A.Fedorov, June, 4, 1999 ;========================================================================= STime = '1996046010000000' ; Start Time of requested interval ; 1996 year, Feb. 16 (DDday = 046) ; 01:00:00:000 TInt = '0000000000100000' ; Time interval in the same format ORBID = long(-1) ; Orbit DataBase ID. Set -1 to open DataBase. DDLIB = getenv('DDLIB') ; Get environment variable to find right path ; to procedure Size = 2000 ; The Size of allocated for data arrays. orbit = fltarr(5,Size) ; OrbitData OTime = dblarr(Size) ; Array allocated for Times of spectra measurements DSTID = long(-1) ; ID of DST DSTsize = long(1) ; Size of DST values DST = fltarr(DSTsize) ; DST array DSTtime = dblarr(DSTSize) ; Time DST array DSTI = '0000000020000000' ; Time intreval for DST ParRet = fltarr(4) ; Array of parameters of Solar Wind by Wind ; ParRet(0) - Ram Pressure [nPa] ; ParRet(1-3) - IMF Bx, By, Bz [nT] B = fltarr(3) ; Model magnetic field XYZ = fltarr(3) ; point in GSM to get B DDLIB = getenv('DDLIB') ; Get environment variable to find right path ; to procedure ; Call to get orbit data OrbitSize = call_external(DDLIB+'orb_idl.so','GetIBALLorb',$ ORBID, $ orbit,$ OTime,$ Size,$ STime,$ TInt) ; Close orbit ID error = call_external(DDLIB+'DD_idl.so','CloseID',ORBID) if OrbitSize LE 0 then print, 'Error in orbital data' else begin ; Call to get DST ; Change time a little DT = call_external(DDLIB+'DD_idl.so','GetDTime',STime, /D_VALUE) DT = DT - double(1800.0) STN = ' ' STN = call_external(DDLIB+'DD_idl.so','GetTime',DT, /S_VALUE) RetSize=call_external(DDLIB+'getdst.so',$ 'get_dst',$ DSTID, $ DSTTime, $ STN, $ DSTI, $ DST, $ DSTSize) ; Close DST ID error = call_external(DDLIB+'DD_idl.so','CloseID',DSTID) ; If there is no DST data, set -5.0 if RetSize LE 0 then begin print, 'Error in DST, set -5.0 CDST = -5.0 endif else CDST = DST(0) ; Obtaining timelag between WIND and INTERBALL tm = double(0.0) ;Returned time lag - WIND - Magnetopause ta = double(0.0) ;Returned time lag - WIND - Auroral Probe tt = double(0.0) ;Returned time lag - WIND - Tail Probe error = call_external(DDLIB+'delay_idl.so','Delay',STime, tm, ta, tt); ; In case of error, setup zero delay if error LT 0 then print, 'Error in Delay, time lag set 0.0' lag = tt ; Initialization of Tzyganenko 96 model error = call_external(DDLIB+'Ts96.so','MFsetup',STime,lag,DST,ParRet); ; Obtaining data for i = 0, OrbitSize -1 do begin XYZ = [orbit(0,i), orbit(3,i), orbit(4,i)] err = call_external(DDLIB+'Ts96.so','MFpoint',xyz,B); DT = OTime(i) STN = call_external(DDLIB+'DD_idl.so','GetTime',DT, /S_VALUE) print, STN, B endfor endelse end