FUNCTION THMAELU,source_in$,date$,ts,INFO$=info$ lblSource$ = source_in$ lblSource$ = STRSPLIT(lblSource$,':',/EXTRACT) source$ = STRLOWCASE(source_in$) source$ = STRSPLIT(source$,':',/EXTRACT) CASE source$[0] OF 'query': retData = '^thmae' ELSE : BEGIN timespan,date$,ts,/minutes startdate = time_double(date$) enddate = startdate + (ts * 60.) ;Download and obtain data for magnetometer; put that data into an IDL data structure ;called 'lhasa'. THM_MAKE_AE get_data,'thmAE',data=lhasa ;stop ;Create a 4 column array containing: ; [TimeVector Bx By Bz] ;Ensure that the array only contains data within the specified time range. upper = WHERE(lhasa.x GE startdate) retData = [[lhasa.x[upper]], [lhasa.y[upper,*]]] lower = WHERE(retData[*,0] LE enddate) retData = retData[lower,*] ; comp$ = STRMID(source$[2],0,1,/REVERSE_OFFSET) ; retData = comp(retData,comp$) ;Create Information Vector type$ = 'ae' name$ = 'THEMIS Pseudo AE Index' unit$ = 'Index' shortID$ = 'THM_AE' info$ = [source_in$, type$, name$, unit$, shortId$] END ENDCASE RETURN, retData END