|
| 1 | +# XRD-TAF |
| 2 | + |
| 3 | +*X Ray Diffraction - Theoretical Absorption Factors* |
| 4 | + |
| 5 | +A GUI app to compute theoretical xray absorption factors (for xray diffracted in a capillary) efficiently on the device's GPU. Made with C#/Unity. |
| 6 | + |
| 7 | +## Installation |
| 8 | + |
| 9 | +Extract the zip file and put the folder wherever you want to run the app. |
| 10 | + |
| 11 | +## How to use |
| 12 | + |
| 13 | +### Folder structure |
| 14 | + |
| 15 | +Inside the XRD-TA folder containing the app, this is the folder/file structure: |
| 16 | + |
| 17 | + ├── Benchmark |
| 18 | + │ ├── benchmark.csv |
| 19 | + │ └── config.csv |
| 20 | + ├── Input |
| 21 | + │ ├── angle-list1.txt |
| 22 | + │ ├── angle-list2.txt |
| 23 | + │ ├── angle-list3.txt |
| 24 | + │ └── ... |
| 25 | + ├── Logs |
| 26 | + │ └── mode{mode}_debug.txt |
| 27 | + ├── Output |
| 28 | + │ ├── group |
| 29 | + │ │ ├── preset1 |
| 30 | + │ │ │ ├── [mode=<mode>][dim=(<res>,<n>,<m>,<k>)] Output.txt |
| 31 | + │ │ │ └── ... |
| 32 | + │ ├── preset2 |
| 33 | + │ │ └── [mode=<mode>][dim=(<res>,<n>,<m>,<k>)] Output.txt |
| 34 | + │ ├── preset3 |
| 35 | + │ │ └── [mode=<mode>][dim=(<res>,<n>,<m>,<k>)] Output.txt |
| 36 | + │ └── ... |
| 37 | + ├── Presets |
| 38 | + │ ├── preset1.json |
| 39 | + │ ├── preset2.json |
| 40 | + │ ├── preset3.json |
| 41 | + │ └── ... |
| 42 | + └── Settings |
| 43 | + └── settings.json |
| 44 | + |
| 45 | +All directories will be created on output, if not present. |
| 46 | + |
| 47 | +#### Benchmark |
| 48 | + |
| 49 | +Stores benchmark config and results. |
| 50 | + |
| 51 | +`config.csv` is a user-generated table containing parameters for each iteration of the benchmark. |
| 52 | +`benchmark.csv` contains a table of benchmark results for `config.csv`. The results will be overwritten on benchmark. |
| 53 | + |
| 54 | + |
| 55 | +#### Input |
| 56 | + |
| 57 | +The directory where the app searches for angle lists. Lists are expected to have one value per line and no header. |
| 58 | + |
| 59 | +#### Logs |
| 60 | + |
| 61 | +If enabled in the settings, log files will be saved in this folder. |
| 62 | +The log filename will be `mode<mode>_debug.txt`. Will be overwritten on each execution. |
| 63 | + |
| 64 | +#### Output |
| 65 | + |
| 66 | +Calculated absorption factors will be saved in this folder. They will be grouped in folders by preset name -- and if a parent folder is specified in the preset, the whole preset folder will be put in a parent folder see section [Folder structure](### Folder structure). |
| 67 | + |
| 68 | +The filename for each output is of the format `[mode=<mode>][dim=(<res>,<n>,<m>,<k>)] Output.txt`. |
| 69 | + |
| 70 | +#### Presets |
| 71 | + |
| 72 | +The directory where user-defined presets will be save, in the format `<preset name>.json`. |
| 73 | +The name specified in the preset is identical to the filename (without extension). |
| 74 | + |
| 75 | +#### Settings |
| 76 | + |
| 77 | +Stores global user settings in `setting.json`. |
| 78 | + |
| 79 | +## Benchmark |
| 80 | + |
| 81 | +### Preset |
| 82 | + |
| 83 | +The pre-defined preset `benchmark.json` will be used for benchmarks. Changes to this preset do not influence the benchmark, since `config.csv` contains all time-complexity-relevant parameters. |
| 84 | + |
| 85 | +### Config |
| 86 | + |
| 87 | +Configurable parameters to the benchmark are `mode`, `res`, `n`, `m`, `k`. |
| 88 | + |
| 89 | +`mode` is a value in (0,1,2), which stand for 0=point, 1=area, 2=integrated. |
| 90 | +`res` is the grid resolution of the capillary cross-section. |
| 91 | +`n`: The number of theta angles to use in the benchmark. In mode 1, `n` this is equivalent to the number of pixels on the horizontal axis of the detector. |
| 92 | +`m`: The number of pixels on the vertical axis of the detector. (Ignored in mode 0 and 2). |
| 93 | +`k`: Amount of angles in the projected ring segment of mode 2. (Ignored in mode 0 and 1). |
| 94 | + |
| 95 | +To add a benchmark iteration to a config, add a line containing these parameters in the exact same order to `Benchmark/config.csv`. |
| 96 | + |
| 97 | +Example: |
| 98 | + |
| 99 | +| mode | res | n | m | k | |
| 100 | +|------|-----|------|-----|----| |
| 101 | +| 0 | 60 | 1000 | 0 | 0 | |
| 102 | +| 0 | 200 | 1000 | 0 | 0 | |
| 103 | +| 1 | 60 | 256 | 256 | 0 | |
| 104 | +| 2 | 200 | 1000 | 0 | 30 | |
| 105 | + |
| 106 | + |
| 107 | +The app expects a tab as separator for the csv. |
| 108 | + |
| 109 | +## Value format |
| 110 | + |
| 111 | +All float input values, in the GUI and in input files, are expectd in invariant culture style, i.e. with `.` as decimal separator. |
| 112 | + |
| 113 | +All `.csv` files have to use tabs as separators. |
0 commit comments