;+ ;PROCEDURE: get_i8_mag ;PURPOSE: Gets key parameter data from the IMP-8 magnetic field ; experiment, such as Sc_pos_i8_mag, B_i8 (Bx, By, Bz), ; Bmag_i8,Bph_i8, Bth_i8, and Brms_i8 ;INPUT: ; none but will call "timespan" and ask for input if ; time range not already set ;KEYWORDS: ; none ; ;CREATED BY: Tai Phan (modified from Davin Larson's get_mfi) ;LAST MODIFICATION: @(#)get_mfi.pro 1.8 95/09/07 ;- pro get_i8_mag @wind_com.pro init_wind_lib fname = data_directory+'i8_k0_mag_files' get_file_names,filenames,TIME_RANGE=range,MASTERFILE=fname ndays = n_elements(filenames) if ndays eq 0 then begin print,"No IMP-8 B data available from ",time_to_str(range(0)), ' to ',time_to_str(range(1)) return endif for d=0,ndays-1 do begin print,'Loading file: ',filenames(d),'...' loadcdf,filenames(d),'Time_PB5',pb5 & t = pb5_to_time(pb5) loadcdf,filenames(d),'SC_pos_se' ,sc_pos loadcdf,filenames(d),'RMS' , rms loadcdf,filenames(d),'B_GSE_c' ,bexp if d eq 0 then begin t_tot = t rms_tot= rms bexp_tot = bexp sc_pos_tot= sc_pos/6380. ; convert to RE endif else begin t_tot = [t_tot,t] rms_tot= [rms_tot,rms] bexp_tot = [bexp_tot,bexp] sc_pos_tot= [sc_pos_tot,sc_pos/6380.] endelse endfor cart_to_sphere,bexp_tot(*,0),bexp_tot(*,1),bexp_tot(*,2),btot,th,ph ind = where(btot ge 1000,cnt) if cnt gt 0 then begin bexp_tot(ind,*) = 2e30 btot(ind) = 2e30 th(ind) = 2e30 ph(ind) = 2e30 rms_tot(ind)= 2e30 endif store_data,'Sc_i8',data={ytitle:'Sc_i8',x:t_tot,y:sc_pos_tot , max_value:1e30} store_data,'Brms_i8',data={ytitle:'Brms_i8',x:t_tot,y:rms_tot , max_value:1e30} store_data,'B_i8',data={ytitle:'B_i8',x:t_tot,y:bexp_tot , max_value:1e30} store_data,'Bmag_i8',data={ytitle:'Bmag_i8',x:t_tot,y:btot, max_value:1e30} store_data,'Bth_i8' ,data={ytitle:'Bth_i8',x:t_tot,y:th,yrange:[-90.,90.], max_value:1e30} store_data,'Bph_i8' ,data={ytitle:'Bph_i8',x:t_tot,y:ph,yrange:[-180.,180.], max_value:1e30} end