;+ ; Batch File: THM_CRIB_EXPORT ; ; Purpose: Demonstrate tplot export functions ; ; Calling Sequence: ; .run thm_crib_export, or using cut-and-paste. ; ; Arguements: ; None. ; ; Notes: ; None. ; ; $LastChangedBy: pcruce $ ; $LastChangedDate: 2007-07-20 16:47:50 -0700 (Fri, 20 Jul 2007) $ ; $LastChangedRevision: 1203 $ ; $URL $ ;- ;your exemplar themis data is magnetometer data timespan,'2007-03-23' thm_load_fgm,probe='a' 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,data=d"' print,'This takes the data from the tplot variable named tplot_var_name and stores it in a structure referenced by d' print,'We just did this now' get_data,'tha_fgs_dsl',data=d print,'(press .c to continue with crib)' stop print,'The command "help,/str,d" will help you see what data is stored in d' help,/str,d print,'(press .c to continue with crib)' stop print,'Timestamp data is stored in d.x' print,'Dependent data is stored in d.y' print,'Since fgm data is 3-d vector data y is a Nx3 array where N is the number of timesamples in the data' print,'If we want to just look at the x-coordinate of the data we can call' print,'"x=d.y[*,0]"' x = d.y[*,0] 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"' tplot,'tha_fgs_dsl' print,'(press .c to continue with crib)' stop print,'Now we simply type: "makepng,plotname"' makepng,'tha_fgs_dsl_plot' 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,'tha_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" print,'Change your current idl directory by typing "cd,new_dir_name"' cwd cd,'.' cwd print,'(press .c to continue with crib)' stop