automating_multiple_refinements
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
automating_multiple_refinements [2017/10/02 16:09] – johnsoevans | automating_multiple_refinements [2022/11/03 15:08] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Automating Refinements ====== | ||
+ | |||
+ | |||
+ | There are lots of ways to set topas up to perform multiple refinements. | ||
+ | |||
+ | This page was written for version 4-5 of Topas. | ||
+ | |||
+ | There is a tutorial example which works with either versions 4-5 or version 6 [[http:// | ||
+ | |||
+ | \\ | ||
+ | The key to automation is to use the command line version of topas: tc.exe. | ||
+ | - Set up refinements so that you can use the same input file in gui mode as dos mode | ||
+ | - Be able to "send in" information (e.g. experimental details) to each refinement | ||
+ | - Be able to write out results automatically. | ||
+ | |||
+ | \\ | ||
+ | |||
+ | 1. Ideally you want to use the same input file for performing a single refinement in gui mode as you're going to use in batch or command line mode. You therefore need an input file which contains all the commands needed for a gui (ta or tb) refinement but which can also be " | ||
+ | |||
+ | <code topas># | ||
+ | macro filename {d8_02339} | ||
+ | macro rangeuse { 12} | ||
+ | macro information {prm !te 0 prm !time 0 } | ||
+ | # | ||
+ | |||
+ | information | ||
+ | |||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | RAW(filename) | ||
+ | range rangeuse</ | ||
+ | |||
+ | 2. You can then run topas from the command line with the format below. | ||
+ | |||
+ | <code topas>tc C: | ||
+ | </ | ||
+ | |||
+ | 3. You can easily put a whole sequence of instructions like this in a command file. You can generate such files with a short program or e.g. using excel. | ||
+ | |||
+ | <code topas>tc seed (+ macros defining things for refinement one) | ||
+ | copy seed.out seed.inp | ||
+ | tc seed (+ macros defining things for refinement two) | ||
+ | copy seed.out seed.inp | ||
+ | etc | ||
+ | </ | ||
+ | |||
+ | 4.Information can be output directly to a results file in a number of ways. A typical results outputting section is below. You can format the output file however you like. Using the append command means that the results file just gets added to. It's therefore sensible to delete any old results file before you run multitopas. The format below will write out esd's if do_errors is defined. | ||
+ | |||
+ | <code topas>' | ||
+ | 'set up the output file stuff here | ||
+ | 'put a \n on last output information to force a new line | ||
+ | ' | ||
+ | |||
+ | out " | ||
+ | |||
+ | Out(rangeuse, | ||
+ | Out(te, " %11.5f" | ||
+ | Out(Get (r_wp), " %11.5f" | ||
+ | Out(lpa_al, " %11.5f", | ||
+ | Out(lpa_si, " %11.5f", | ||
+ | Out(lpa_sample, | ||
+ | Out(height_al, | ||
+ | Out(height_sample, | ||
+ | Out(height_si, | ||
+ | Out(bvalue1, | ||
+ | Out(bvalue2, | ||
+ | Out(scale_sample, | ||
+ | Out(scale_si, | ||
+ | Out(rangeuse, | ||
+ | Out_String(filename\n) | ||
+ | |||
+ | </ | ||
+ | |||
+ | 8. wgnuplot can be a very quick way to plot results. Try using a command file like the one below. It will automatically produce .gif files. Use " | ||
+ | |||
+ | <code topas> | ||
+ | set term gif | ||
+ | set output ' | ||
+ | set output ' | ||
+ | set output ' | ||
+ | set output ' | ||
+ | set output ' | ||
+ | set output ' | ||
+ | set output ' | ||
+ | set output ' | ||
+ | set output ' | ||
+ | set output ' | ||
+ | set output ' | ||
+ | set term win | ||
+ | replot</ | ||
+ | |||
+ | |||
automating_multiple_refinements.txt · Last modified: 2022/11/03 15:08 by 127.0.0.1