;+ ;PROCEDURE: get_3dp ;PURPOSE: Gets key parameter data for the 3DPlasma experiment from cdf ; files where it's stored. ;INPUTS: ; none, but calls "timespan" and asks for input if ; not already set ;KEYWORDS: ; TRANGE: 2 element vector specifying the time range desired. ; ;CREATED BY: Davin Larson ;LAST MODIFICATION: @(#)get_3dp.pro 1.15 96/08/05 ;- pro get_3dp ,trange=range ,polar=polar fname = 'wi_k0_3dp_files' environvar = 'CDF_DATA_DIR' dir = getenv(environvar) if not keyword_set(dir) then $ message,'Environment variable '+environvar+' is not defined!' get_file_names,filenames,TIME_RANGE=range,MASTERFILE=fname,ROOT=dir ndays = n_elements(filenames) if ndays eq 0 then begin print,"No 3DP 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) id = cdf_open(filenames(d)) loadcdf,id,'Time_PB5',pb5 ,/append loadcdf,id,'ion_density' ,Np ,/append loadcdf,id,'ion_temp' ,Tp ,/append loadcdf,id,'ion_vel' ,Vp ,/append loadcdf,id,'ion_flux' ,flux_i ,/append loadcdf,id,'elect_density',Nel ,/append loadcdf,id,'elect_temp' ,Te ,/append loadcdf,id,'elect_vel' ,Ve ,/append loadcdf,id,'elect_flux' ,flux_e ,/append cdf_close,id endfor t = pb5_to_time(pb5) bad = !values.f_nan ind = where(np le -1e20) & if ind(0) ne -1 then np(ind) = bad store_data,'Np_3dp',data={x:t,y:np} ind = where(Tp le -1e20) & if ind(0) ne -1 then Tp(ind) = bad store_data,'Tp_3dp',data={x:t,y:tp} ind = where(Vp le -1e20) & if ind(0) ne -1 then Vp(ind) = bad store_data,'Vp_3dp',data={x:t,y:vp} ind = where(Nel le -1e20) & if ind(0) ne -1 then Nel(ind) = bad store_data,'Ne_3dp',data={x:t,y:Nel} ind = where(Te le -1e20) & if ind(0) ne -1 then Te(ind) = bad store_data,'Te_3dp',data={x:t,y:Te} ind = where(Ve le -1e20) & if ind(0) ne -1 then Ve(ind) = bad store_data,'Ve_3dp',data={x:t,y:Ve} ind = where(flux_e le -1e20) & if ind(0) ne -1 then flux_e(ind) = bad store_data,'Fe_3dp',data={x:t,y:flux_e, ylog:1} ind = where(flux_i le -1e20) & if ind(0) ne -1 then flux_i(ind) = bad store_data,'Fi_3dp',data={x:t,y:flux_i, ylog:1} if keyword_set(polar) then begin xyz_to_polar,'Vp_3dp',/ph_0_360 xyz_to_polar,'Ve_3dp',/ph_0_360 endif end