timespan,'2007-03-23'
thm_load_fgm, probe = 'b', level = 'l2'
tplot_options,'title','data_export_example'
print,'The SciSoft software package stores data in tplot variables by default'
print,'To get a list of available variables type "tplot_names"'
print,'(press .c to continue with crib)'
stop
tplot_names
print,'The most basic way to "export" data from the scisoft package is to access the data directly'
print,'You can do this by typing "get_data,tplot_var_name,time,data"'
print,'We just did this now'
get_data,'thb_fgs_dsl',time,data
help,/str,time
help,/str,data
print,'(press .c to continue with crib)'
stop
print,'We can export a plot to a file by first plotting the data with the command:'
print,'"tplot,tplot_var_name"'
print,'(You need to do this for makepng,makegif,and makeps)'
tplot,'thb_fgs_dsl'
print,'(press .c to continue with crib)'
stop
print,'Now we simply type: "makepng,plotname"'
makepng,'thb_fgs_dsl_plot'
print,'(press .c to continue with crib)'
stop
print,'You export data to gif format with the "makegif" function as well'
makegif,'thb_fgs_dsl_plot'
print,'(press .c to continue with crib)'
stop
print,'You can export to postscript format with the "popen & pclose" procedures'
popen,'thb_fgs_dsl_plot'
tplot
pclose
print,'(press .c to continue with crib)'
stop
print,'You can export to encapsulated postscript format with the /encapsulated keyword'
popen,'thb_fgs_dsl_plot',/encapsulated
tplot
pclose
print,'(press .c to continue with crib)'
stop
print,'We can also export data to an ascii file'
print,'Just type "tplot_ascii,tplot_var_name"'
print,'If you want to add a suffix type "tplot_ascii,tplot_var_name,ext=suffix"'
print,'We can do this now'
tplot_ascii,'thb_fgs_dsl',ext='_20070323'
print,'(press .c to continue with crib)'
stop
print,'All files go to your current idl directory by default'
print,'Check your current idl directory by typing "cwd"'
cwd
print,'(press .c to continue with crib)'
stop
print,'You can change your current by calling cwd,dirname'
cwd,'.'
print,'(The change directory command above is only an example and does nothing)'
print,'(press .c to continue with crib)'
stop
tplot_save,filename='current'
del_data,'*'
tplot_names
print,'Now the data has been saved to current.tplot and idl tplot variables have been deleted'
print,'(press .c to continue with crib)'
stop
tplot_restore,filename='current.tplot'
tplot_names
print,'And now our data is back'
print,'The End'
print,'(press .c to continue with crib)'
stop
options,'thb_fgs_dsl',xthick=2.0,ythick=2.0,thick=2.0,charthick=2.0
popen,'thb_fgs_dsl_plot'
tplot
pclose
print,'(press .c to continue with crib)'
stop
end