Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
sequential_refinements_-_save_phase_pattern [2020/04/20 13:13]
iangie
sequential_refinements_-_save_phase_pattern [2021/05/13 05:07] (current)
iangie [Extracting the intensity contribution from a certain phase for a batch of dataset]
Line 2: Line 2:
 Intensity contribution from individual phase can be saved out from GUI interface "​right-click -> save if displayed..."​. Intensity contribution from individual phase can be saved out from GUI interface "​right-click -> save if displayed..."​.
  
-However, there were multiple questions asked in the forum concerning how to extract phase contribution through Launch Mode .inp file setup, and even do this for in-situ data set.+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 the Alan Coelho'​s 2-step refinement & Matthew Rowles'​s Sequential Refinement method.+The solution below has been enlightened by Alan Coelho'​s 2-step refinement ​solution ​& Matthew Rowles'​s Sequential Refinement method.
  
-TOPAS V6 allows a keyword //​num_runs//​ which instructs the programme to run an .inp file multiple times, which means above 2-step solution can be devised in one .inp file with "​num_runs 2" and several #if switches:+TOPAS V6 allows a keyword //​num_runs//​ which instructs the programme to run an .inp file multiple times. This means above 2-step solution can be devised in one .inp file with "​num_runs 2" and several #if switches:
  
 ====== 1. Extracting phase contribution from a single data ====== ​ ====== 1. Extracting phase contribution from a single data ====== ​
Line 46: Line 46:
       {       {
        "​ %11.6f ​ " = X + 2 samp_disp Cos(X Deg_on_2)/​Rp Rad;                     /* Correct sample displacement from an internal standard, hkl_Al in this case */               "​ %11.6f ​ " = X + 2 samp_disp Cos(X Deg_on_2)/​Rp Rad;                     /* Correct sample displacement from an internal standard, hkl_Al in this case */       
-       "​ %11.6f\n ​ " = Ycalc;+       "​ %11.6f\n ​ " = Ycalc; ​                                                   /* You can add Ln() in the equation , if you want to plot as the intensity of the 2D plot in logarithm scale. */
        }        }
 #endif #endif
Line 88: Line 88:
    
 </​code> ​     </​code> ​    
-It can be seen that, in the first run (Run_Number = 0), the #if switches ​allows ​a normal Pawley refinement which refines the sample displacement according to an internal standard (hkl_Al in this case). ​+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 turned ​on the phase of interest with "iters 0" and get the intensity saved out.+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 ====== ====== 2. Extracting phase contribution from a batch dataset ======
Line 102: Line 102:
 num_runs =2*100; ​               /* This set the Reserved Keywords "​Run_Number"​ goes from 0 to 199 */ num_runs =2*100; ​               /* This set the Reserved Keywords "​Run_Number"​ goes from 0 to 199 */
  
-#if (Mod(Run_Number,​2) == 1)    /* Normal Pawley refinement when Run_Number is an even number; Save the phase intensity when Run_Number is an odd number */+#if (Mod(Run_Number,​2) == 1)    /* Normal Pawley refinement when Run_Number is an even number; Save the phase intensity when Run_Number is an odd number. Refinements goes on like tik-tok tik-tok … */
 iters 0 iters 0
 #endif #endif
Line 116: Line 116:
 #​endif ​   #​endif ​  
  
-#prm filenum = Round((Run_Number+1)/​2); ​   /* This calculates the run number of the file, NOTE Round(0.5) evaluates to 0 in TOPAS V5, but evaluates to 1 in TOPAS V6! */+#prm filenum = Round((Run_Number+1)/​2); ​   /* This calculates the run number of the file, __NOTE ​Round(0.5) evaluates to 0 in TOPAS V5, but evaluates to 1 in TOPAS V6!__ */
  
 xdd Somepattern_#​out filenum##​.raw ​        /* This allow TOPAS to find the corresponding pattern ​ */ xdd Somepattern_#​out filenum##​.raw ​        /* This allow TOPAS to find the corresponding pattern ​ */
Line 137: Line 137:
       xdd_out OUTPUT_NMO_#​out filenum##​.xy load out_record out_fmt out_eqn       xdd_out OUTPUT_NMO_#​out filenum##​.xy load out_record out_fmt out_eqn
       {       {
-       "​ %11.6f ​ " = X + 2 samp_disp Cos(X Deg_on_2)/​Rp Rad;   /* Correct sample displacement of the phase  */        +       "​ %11.6f ​ " = X + 2 samp_disp Cos(X Deg_on_2)/​Rp Rad;   /* Correct sample displacement of the phase, because the in-situ cell pops up */        
-       "​ %11.6f\n ​ " = Ycalc;+       "​ %11.6f\n ​ " = Ycalc; ​                                 /* You can add Ln() in the equation , if you want to plot as the intensity of the 2D plot in logarithm scale. */
        }        }
 #endif #endif
Line 181: Line 181:
 </​code> ​     ​ </​code> ​     ​
  
 +====== 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://​cloudstor.aarnet.edu.au/​plus/​s/​3sjimyTzfPse30L | this]].
  

Personal Tools