outputting_publication_quality_plots_using_expgui
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| outputting_publication_quality_plots_using_expgui [2020/07/16 10:29] – external edit 127.0.0.1 | outputting_publication_quality_plots_using_expgui [2025/09/19 15:18] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Publication Quality Plots using Liveplot in EXPGUI ====== | ||
| + | |||
| + | Following an update to Liveplot in EXPGUI by Brian Toby, you can now simply produce publication quality plots, with a Yobs, YCalc, Diff, Background, and reflection markers for each phase. | ||
| + | |||
| + | For problems with this, please ask on the forum of this site, rather than contacting Brian Toby. | ||
| + | |||
| + | |||
| + | For this to work with TOPAS, output of various parts of information must be combined in one file: | ||
| + | |||
| + | |||
| + | * X, D, Observed, Calculated, Y_error | ||
| + | * H, K, L, M, D, X, Phase_number | ||
| + | * X, D, Background | ||
| + | |||
| + | |||
| + | Currently, The background has to be appended to the end of the file as it can not be output at the same time as the calculated pattern. | ||
| + | |||
| + | Two macros should be saved to the local.inc file: | ||
| + | |||
| + | <code topas> | ||
| + | { | ||
| + | xdd_out file load out_record out_fmt out_eqn | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | |||
| + | out file append | ||
| + | Out_String(" | ||
| + | |||
| + | for strs { | ||
| + | phase_out file append load out_record out_fmt out_eqn | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | } | ||
| + | } </ | ||
| + | |||
| + | and | ||
| + | |||
| + | <code topas> | ||
| + | { | ||
| + | iters 0 | ||
| + | out " | ||
| + | Out_String(" | ||
| + | |||
| + | xdd_out file append load out_record out_fmt out_eqn | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | | ||
| + | |||
| + | The following structure must be used in the relevant inp file to achieve the desired output: | ||
| + | |||
| + | <code topas> | ||
| + | /* | ||
| + | Normally have the "# | ||
| + | To output information (once happy with refinement), | ||
| + | 1. Uncomment the "# | ||
| + | 2. Run refinement - this will output X, D, Yobs, Ycalc, and sigYobs, as well as h, k, l, m, D, X, and phase number. | ||
| + | 3. Comment out "# | ||
| + | 4. Run refinement - this will do zero iterations and append your calculated background to the previous file. | ||
| + | */ | ||
| + | |||
| + | '# | ||
| + | #define OUT_Ycalc_and_Ticks_ | ||
| + | '# | ||
| + | |||
| + | xdd yourdata.xye | ||
| + | |||
| + | ... | ||
| + | ... | ||
| + | fit_obj | ||
| + | ... | ||
| + | ... | ||
| + | |||
| + | |||
| + | #ifdef OUT_Ycalc_and_Ticks_ | ||
| + | |||
| + | str | ||
| + | ... | ||
| + | local !phase_number 1 ' define for each str section ' | ||
| + | ... | ||
| + | |||
| + | str | ||
| + | ... | ||
| + | local !phase_number 2 ' define for each str section ' | ||
| + | ... | ||
| + | |||
| + | /* | ||
| + | The following should be placed at the end of all your str parts. | ||
| + | There is no need to edit them. | ||
| + | */ | ||
| + | |||
| + | #ifdef OUT_PUT_RUN_ | ||
| + | OUT_Ycalc_and_Ticks(liveplot_output.ascii) | ||
| + | #endif | ||
| + | #else | ||
| + | #ifdef OUT_BKG_Fit_Objs_ | ||
| + | #ifdef OUT_PUT_RUN_ | ||
| + | OUT_BKG_Fit_Objs(liveplot_output.ascii) | ||
| + | #endif | ||
| + | #endif | ||
| + | #endif | ||
| + | </ | ||
| + | The final output file should look something like this: | ||
| + | |||
| + | < | ||
| + | | ||
| + | | ||
| + | | ||
| + | ... | ||
| + | ... | ||
| + | ... | ||
| + | 29.99200 | ||
| + | 29.99600 | ||
| + | 30.00000 | ||
| + | HKL reflection markers: | ||
| + | | ||
| + | | ||
| + | | ||
| + | ... | ||
| + | ... | ||
| + | ... | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | ... | ||
| + | ... | ||
| + | ... | ||
| + | Background fit: | ||
| + | | ||
| + | | ||
| + | | ||
| + | ... | ||
| + | ... | ||
| + | ... | ||
| + | 29.99200 | ||
| + | 29.99600 | ||
| + | 30.00000 | ||
| + | </ | ||