Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge "TRHEPD_manybeam_with_limitation" into "develop". #56

Merged
merged 68 commits into from
Mar 13, 2024

Conversation

H-Iwamoto-research
Copy link
Collaborator

[Major Changes]

  • sim_trhepd_rheed.py: Updated to support calculations using many-beam condition data.
  • _runner.py, limitation.py, and montecarlo.py: Implementation of a "limitation" feature that limits the range of a variable by an inequality.
  • An description reflecting the above changes is included in the Japanese manual.
    (Editted sim-trhepd-rheed.rst, input.rst, tutorial/index.rst. Created tutorial/limitation.rst)

H-Iwamoto-research and others added 30 commits July 20, 2023 18:13
(WIP) edit manual
Created by N.Kinoshita (Tottori U).
- Define "self.log_mode" to measure detail_timer if self.log_mode=True.
- Add "normalization" section to "detail_timer".
- Prepare detail_timer with the "set_detail_timer" function.
- TODO: Operate log_mode with toml file. Generate txt of detail_timer.
[before]: Use lib_make_convolution.py to delete headers in the calculated data file and perform the convolution calculation.
[after]: Use sim_trhepd_rheed_mb_connect.py to remove the headers of the calculated data file and lib_make_convolution.py to perform the convolution calculation.
- Additional options: "reference_first_line", "reference_last_line". The former specifies the first line to read the reference data, and the latter specifies the last line to read the reference data.
- Changed the reading of reference data from the np.loadtxt function to using the open, read, readlines, and split functions.
- Using the coefficients co_a and co_b, you can make it search only the range that meets the following constraint formula.
---
co_a[1,1]*x_[1] + co_a[1,2]*x_[2] + ... + co_a[1,n]*x_[n] + co_b[1] > 0
co_a[2,1]*x_[1] + co_a[2,2]*x_[2] + ... + co_a[2,n]*x_[n] + co_b[2] > 0
...
co_a[m,1]*x_[1] + co_a[m,2]*x_[2] + ... + co_a[m,n]*x_[n] + co_b[m] > 0
---
- co_a and co_b can be defined in option [runner.limitation] in the toml file.
- When setting constraint formulas, both co_a and co_b must be set in the toml file.
- If neither co_a nor co_b are set in the toml file, the calculation can be performed without constraint formulas.
- If the initial_list set in [algorithm.param] does not fit the constraint formulas, an error occurs.
- If initial_list is not set in [algorithm.param], then initial coordinates that fit the constraint formulas are created.
- Added option "calculated_first_line", "calculated_last_line", "calculated_info_line"
- "calculated_first_line" specifies the first line to be read from the calculated data file.
- "calculated_last_line" specifies the last line to be read from the calculated data file.
- "calculated_info_line" specifies the line in the calculated data file where the number of beams and glancing angles are written.
- If the number of glancing angles read from the calculated data file does not match the user-specified number of lines to be read from the calculated data file ("calculated_last_line" - "calculated_first_line" + 1), WARNING is output.
If the normalization == "MAX" option is used, an exception.InputError will occur.
- Changed the argument of the function "_calc_Rfactor".
- Changed the R-factor code for calculations with "Rfactor_type = A" or "Rfactor_type = A2". The calculated values are exactly the same as before the code change.
- Change of the code normalization = "MS_NORM". The self.spot_weight is automatically calculated from the calculated intensity and used in the R-factor calculation.
- Some variable names in the code were changed.
- RockingCurve_calculated.txt can now be generated even if 'normalization = "MS_NORM"' is set.
- Minor changes related to variable names.
- The option "normalization" in [solver,post] can only specify "TOTAL" or "MULTI_SPOT" .
- The option "weight_type" of [SOLVER,POST] is newly added. calc" and "manual" can be specified.
- With the following settings, the same calculation as the previous code can be performed.
  <old option> -> <new option>
  normalization="MS_NORM" -> normalization="MULTI_SPOT", weight_type="calc"
  normalization="MS_NORM_SET_WGT" -> normalization="MULTI_SPOT", weight_type="manual"
- If normalization="MULTI_SPOT", the value of option "weight_type" is printed in RockingCurve_calculated.txt.
H-Iwamoto-research and others added 29 commits October 18, 2023 01:27
- Changed the method of generating "initial_list" for execution with [runner.limitation] set.
- Changed the constraint formula to include the judgment in the variable "in_range".
- If the constraint formula is not satisfied, out_of_range = true.
@yomichi yomichi merged commit d99a9b2 into develop Mar 13, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants