sequential_refinements_-_save_phase_pattern
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
sequential_refinements_-_save_phase_pattern [2020/04/20 13:05] – iangie | sequential_refinements_-_save_phase_pattern [2023/05/19 07:47] (current) – iangie | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Extracting the intensity contribution from a certain phase for a batch of dataset ====== | ||
+ | Intensity contribution from individual phase can be saved out from GUI interface " | ||
+ | |||
+ | However, there were multiple questions asked in the forum concerning how to extract phase contribution through Launch Mode .inp file setup, and how to do this even for a batch dataset. | ||
+ | |||
+ | The solution below has been enlightened by Alan Coelho' | ||
+ | |||
+ | TOPAS V6 allows a keyword // | ||
+ | |||
+ | ====== 1. Extracting phase contribution from a single data ====== | ||
+ | <code topas> | ||
+ | num_runs 2 | ||
+ | |||
+ | #if (Run_Number == 1) | ||
+ | iters 0 | ||
+ | #endif | ||
+ | |||
+ | #if Run_Number == 0; | ||
+ | system_before_save_OUT { copy INP_File## | ||
+ | # | ||
+ | |||
+ | out_file = Concat(String(INP_File), | ||
+ | |||
+ | #if Run_Number == 1; | ||
+ | system_after_save_OUT { copy INP_File## | ||
+ | # | ||
+ | | ||
+ | xdd " | ||
+ | |||
+ | #if (Run_Number == 0) | ||
+ | bkg @ 713.3525387 332.4034599 -218.0099371 | ||
+ | | ||
+ | #else bkg 1 /* A arbitrary 1 count is added to the phase contribution in case some plotting software does not like 0 intensity. | ||
+ | # | ||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | lpsd_equitorial_divergence_degrees | ||
+ | Full_Axial_Model(12, | ||
+ | | ||
+ | |||
+ | #if (Run_Number == 1) | ||
+ | xdd_out Output_phase_contribution.xy load out_record out_fmt out_eqn | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | #endif | ||
+ | |||
+ | #if (Run_Number == 0) | ||
+ | | ||
+ | xo @ 14.70505682 | ||
+ | peak_type spv | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | I 97.34548273 | ||
+ | |||
+ | | ||
+ | hkl_m_d_th2 1 1 1 8 2.33311367 38.5568314 I @ 74.14699402 | ||
+ | hkl_m_d_th2 2 0 0 6 2.02053571 44.8203506 I @ 96.76241314 | ||
+ | LVol_FWHM_CS_G_L( 1, 113.2882082, | ||
+ | Stephens_cubic(@, | ||
+ | r_bragg | ||
+ | phase_MAC 0 | ||
+ | phase_name " | ||
+ | MVW( 0, 65.99173092, | ||
+ | space_group Fm-3m | ||
+ | Cubic(!a_000040787 4.049) | ||
+ | |||
+ | #endif | ||
+ | |||
+ | | ||
+ | hkl_m_d_th2 0 0 2 2 5.54676771 15.9653101 I @ 2.664253279 | ||
+ | hkl_m_d_th2 0 0 4 2 2.77338386 32.2515259 I @ 10.48756371 | ||
+ | ... | ||
+ | LVol_FWHM_CS_G_L( 1, 173.7971979, | ||
+ | e0_from_Strain( 0.001701696021,, | ||
+ | r_bragg | ||
+ | phase_MAC 0 | ||
+ | phase_name " | ||
+ | MVW( 0, 78.20697387, | ||
+ | space_group P63/mmc | ||
+ | Hexagonal(a_040201752 2.853135761, | ||
+ | |||
+ | </ | ||
+ | It can be seen that, in the first run (Run_Number = 0), the #if switches allow a normal Pawley refinement which refines the sample displacement according to an internal standard (hkl_Al in this case). | ||
+ | |||
+ | In the second run (Run_Number = 1), the #if switches only turn on the phase of interest with "iters 0" and get the intensity saved out. | ||
+ | |||
+ | ====== 2. Extracting phase contribution from a batch dataset ====== | ||
+ | |||
+ | To apply this method for a batch of data set (e.g. in-situ data set), which contains, say 100 patterns, an .inp file with " | ||
+ | |||
+ | (The restriction of this setup is, the file names of the dataset must contain an increasing run number: e.g. ***_1.raw, ***_2.raw, ***_3.raw, ..... A simple windows/DOS batch rename can achieve this. ) | ||
+ | |||
+ | <code topas> | ||
+ | |||
+ | num_runs =2*100; | ||
+ | |||
+ | #if (Mod(Run_Number, | ||
+ | iters 0 | ||
+ | #endif | ||
+ | |||
+ | #if Run_Number == 0; | ||
+ | system_before_save_OUT { copy INP_File## | ||
+ | # | ||
+ | |||
+ | out_file = Concat(String(INP_File), | ||
+ | |||
+ | #if Run_Number == 2*100-1; | ||
+ | system_after_save_OUT { copy INP_File## | ||
+ | # | ||
+ | |||
+ | #prm filenum = Round((Run_Number+1)/ | ||
+ | |||
+ | xdd Somepattern_# | ||
+ | |||
+ | #if (Mod(Run_Number, | ||
+ | bkg @ 713.3525387 332.4034599 -218.0099371 | ||
+ | | ||
+ | #else bkg 1 /* A arbitrary 1 count is added to the phase contribution in case some plotting software does not like 0 intensity. | ||
+ | # | ||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | lpsd_equitorial_divergence_degrees | ||
+ | Full_Axial_Model(12, | ||
+ | | ||
+ | |||
+ | #if (Mod(Run_Number, | ||
+ | xdd_out OUTPUT_NMO_# | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | #endif | ||
+ | |||
+ | #if (Mod(Run_Number, | ||
+ | | ||
+ | xo @ 14.70505682 | ||
+ | peak_type spv | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | I 97.34548273 | ||
+ | |||
+ | | ||
+ | hkl_m_d_th2 1 1 1 8 2.33311367 38.5568314 I @ 74.14699402 | ||
+ | hkl_m_d_th2 2 0 0 6 2.02053571 44.8203506 I @ 96.76241314 | ||
+ | LVol_FWHM_CS_G_L( 1, 113.2882082, | ||
+ | Stephens_cubic(@, | ||
+ | r_bragg | ||
+ | phase_MAC 0 | ||
+ | phase_name " | ||
+ | MVW( 0, 65.99173092, | ||
+ | space_group Fm-3m | ||
+ | Cubic(!a_000040787 4.049) | ||
+ | |||
+ | #endif | ||
+ | |||
+ | | ||
+ | hkl_m_d_th2 0 0 2 2 5.54676771 15.9653101 I @ 2.664253279 | ||
+ | hkl_m_d_th2 0 0 4 2 2.77338386 32.2515259 I @ 10.48756371 | ||
+ | ... | ||
+ | LVol_FWHM_CS_G_L( 1, 173.7971979, | ||
+ | e0_from_Strain( 0.001701696021,, | ||
+ | r_bragg | ||
+ | phase_MAC 0 | ||
+ | phase_name " | ||
+ | MVW( 0, 78.20697387, | ||
+ | space_group P63/mmc | ||
+ | Hexagonal(a_040201752 2.853135761, | ||
+ | | ||
+ | </ | ||
+ | |||
+ | ====== 3. Plot the extracted phase intensity as 2D plot using TOPAS V6 ====== | ||
+ | Note the saved phase intensities .xy files will be in different X step positions. | ||
+ | |||
+ | Some algorithms require long time to create 2D plot when the data are not in an uniform mesh. | ||
+ | |||
+ | Surprisingly the 2D plot function in TOPAS v6 can create below 2D plot from 100 .xy data of non-uniform data step very quickly, which persuaded me no need to turn to other plotting software: | ||
+ | |||
+ | The example of the plot is like [[https:// | ||
+ | |||