Differences

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

Link to this comparison view

list_command [2016/10/26 17:19]
johnsoevans
list_command [2020/07/16 11:29]
Line 1: Line 1:
-====== List #list Command ====== 
- 
-#list is a new feature in v6.  It's super-useful for running multiple refinements on different data sets or running multiple models against a single data set.  Some things you can do are below. ​ There are lots more! 
- 
-Typical syntax is: 
- 
-<code topas>​num_runs 5 
-Backup_INP 
-#list pa_val ​ { 
-0.1 
-0.2 
-0.3 
-0.4 
-0.5 
-} 
-prm pa = pa_val(Run_Number);</​code>​ 
- 
-By default the results aren't written to the INP file.  This can be changed with the lines below, where inp_filename.inp is the name of your INP file.  Note that out_file uses a "​string equation"​. ​ The "​Backup_INP"​ macro creates a backup of your input file.  This is useful as if you mess up with #list you can write a blank .inp file (essentially deleting your .inp). 
- 
-<code topas>​Backup_INP 
-out_file ="​inp_filename.inp";</​code>​ 
- 
-If you step through a set of pa values and fit the data with each value Topas won't save the "best answer"​ by default. ​ This can be changed with a simple macro: 
- 
-<code topas>​macro Save_Best 
-   { 
-                #if (Run_Number == 0) 
-                                prm Best_Rwp_ = 9999; 
-                #else 
-                                prm Best_Rwp_ = #include Best_Rwp_.txt;​ 
-                #endif 
-                out Best_Rwp_.txt Out(If(Get(r_wp) < Best_Rwp_, Get(r_wp), Best_Rwp_)) 
-                out_file = If(Get(r_wp) < Best_Rwp_, Concat(String(INP_File),​ "​.OUT"​),​ ""​);​ 
-   } </​code>​ 
- 
-You can easily automate refinements using the #list command and string equations. ​ Just give the filenames in the #list command and use something like "​xdd ​ filename(Run_Number)"​. ​ You can add experimental information like time/​temperature/​etc in the #list command. 
  

Personal Tools