;+ ;PROCEDURE: get_orbit ;PURPOSE: Gets orbital data and creates the plot quantity: ; 'GSE_pos_def' (or 'GSE_pos_pre' if PREDICTED is set) ;INPUT: none, but will call "timespan" and get ; time if time trange not set. ;KEYWORDS: ; TRANGE: 2 element vector specifying the time range desired. ; PREDICTED: Uses predicted files instead of definitive files if set ; ;CREATED BY: Jasper Halekas ;VERSION: get_orbit.pro 1.17 ;LAST MODIFICATION: 95/11/29 ;- pro get_orbit $ ,trange=trange $ ,predicted=pre, DEFINITIVE=def $ ,spcraft = sp @wind_com.pro init_wind_lib if keyword_set(pre) then ftype = 'pre' else ftype = 'def' if data_type(sp) ne 7 then sp = 'wi' ; Default to WIND fname = data_directory+sp+'_or_'+ftype+'_files' get_file_names,filenames,TIME_RANGE=trange,MASTERFILE=fname ndays=n_elements(filenames) if ndays eq 0 then begin print,"No orbital data available from", time_to_str(trange(0)),$ ' to ',time_to_str(trange(1)) return endif for d=0,ndays-1 do begin print,'Loading file: ',filenames(d),'...' loadcdf,filenames(d),'Time_PB5', t loadcdf,filenames(d),'GSE_POS' ,gse_pos if d eq 0 then begin t_tot = t gse_pos_tot = gse_pos endif else begin t_tot = [t_tot,t] gse_pos_tot = [gse_pos_tot, gse_pos] endelse endfor RE = 6400. gse_pos_tot = gse_pos_tot/RE t = pb5_to_time(t_tot) cart_to_sphere,gse_pos_tot(*,0),gse_pos_tot(*,1),gse_pos_tot(*,2),r,lat,phi xlt = 12.+phi/15. ytitle = 'GSE_pos_'+ftype store_data,ytitle,data={ytitle:ytitle,x:t,y:gse_pos_tot, t_pb5 :t_tot} store_data,'Re' ,data={ytitle:'Re',x:t,y:r} store_data,'LT' ,data={ytitle:'LT',x:t,y:xlt} store_data,'LAT' ,data={ytitle:'LAT',x:t,y:lat} store_data,'PHI' ,data={ytitle:'PHI',x:t,y:phi} return end