;+ ;PROGRAM: get_3dt(funct,get_dat,ERANGE=erange,BINS=bins,NAME=name) ;INPUT: ; funct: function, function that operates on structures generated ; by get_pl, get_el, etc. ; e.g. "get_el" ; ; funct = 'n_3d','j_3d','v_3d','p_3d','t_3d', ; 'vth_3d', or 'c_3d' ; "n_3d" ; "j_3d" ; "v_3d" ; "p_3d" ; "t_3d" ; "vth_3d" ; "c_3d" ; get_dat:function, function that returns 3d data structures ; function name must be "get_"+"get_dat" ; get_dat = 'pl' for get_pl, ; get_dat = 'el' for get_el, etc. ;KEYWORDS: ; erange: fltarr(2), optional, min,max energy bin numbers for integration ; bins: bytarr(nbins), optional, angle bins for integration, see edit3dbins.pro ; 0,1=exclude,include, nbins = temp.nbins ; name: string New name of the Data Quantity ; Default: funct+'_'+get_dat ; times: dblarr(1or2)or Specifies start time (and end time) ; strarr(1or2) ; index: lonarr(1 or 2) Specifies starting index (and ending index) ; keyword time overrides keyword index ;PURPOSE: ; To generate time series data for "tplot" ;NOTES: ; NOTE: when getting phb moments with /rm2, use the ; file='write_phb.doc' with nlevel = 1e5 for best results. ; ; See "tplot_names". ; ;CREATED BY: J.McFadden ;LAST MODIFICATION: 97/10/01 ;FILE: @(#)get_3dt.pro 1.12 ;- pro get_3dt,funct,get_dat,ERANGE=er,BINS=bins,NAME=name,SILENT=silent,$ INDEX=index,TIMES=time,nr = nr,nlevel = nlevel,bottom = bottom,rmbins = rmbins,ang = ang,maxd = maxd,theta = theta,phi = phi,rm2=rm2,nlow = nlow,filename = filename,rs = rs, sr = sr if keyword_set(sr) then rm2 = 1 if keyword_set(rs) then rm2 = 1 if keyword_set(maxd) then get_data,'n_3d_ph',data = ndata cr = string(13b) form1 = "(a,i5,a,$)" if n_params() lt 2 then begin return endif get_raw = 'get_'+get_dat times = call_function(get_raw,/times) ntimes = n_elements(times) if ntimes lt 1 then begin print,'No data loaded' return endif if keyword_set(index) then ind = index ;don't change keyword value if keyword_set(time) then begin nt = n_elements(time) if nt ne 1 and nt ne 2 then begin message,'Keyword TIME must have (zero,) one or two elements.',/info return endif tim = time_double(time) ;don't change keyword value ind = nn(times,tim) if nt eq 1 then ind = [ind,ntimes-1] endif maxi = long(ntimes-1) CASE n_elements(ind) OF 2: ind = 0>indind