FUNCTION RAWTHMMAG,source_in$,date$,ts,INFO$=info$ ;This version does not subtract the average. lblSource$ = source_in$ lblSource$ = STRSPLIT(lblSource$,':',/EXTRACT) source$ = STRLOWCASE(source_in$) source$ = STRSPLIT(source$,':',/EXTRACT) CASE source$[0] OF 'query': retData = '^rawthmmag' 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_load_gmag,site=source$[1],VARNAME_OUT=varnames get_data,'thg_mag_'+source$[1],data=lhasa STORE_DATA,varnames,/DELETE ;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$ = source$[2] retData = comp(retData,comp$) ;Create Information Vector type$ = 'mag' name$ = STRUPCASE(source$[1]) + ' THEMIS Mag (' + lblSource$[2] + ')' unit$ = 'nT' shortID$ = STRUPCASE(source$[1]) + ':' + lblSource$[2] info$ = [source_in$, type$, name$, unit$, shortID$ ] PRINT,'You are in thmmagraw.pro.' END ENDCASE RETURN, retData END