syncmoss 0.8.0__tar.gz → 0.8.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (305) hide show
  1. {syncmoss-0.8.0/syncmoss.egg-info → syncmoss-0.8.1}/PKG-INFO +1 -1
  2. syncmoss-0.8.1/syncmoss/Expressions/ASM P(m) from m.mdl +7 -0
  3. syncmoss-0.8.1/syncmoss/Expressions/ASM m from P(m).mdl +7 -0
  4. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library_io.py +1 -1
  5. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/fitting_io.py +13 -2
  6. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/legacy.py +45 -1
  7. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/main.py +1 -1
  8. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/minimi_lib.py +50 -5
  9. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/model_io.py +4 -4
  10. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/models.py +73 -69
  11. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/models_dual.py +29 -36
  12. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/models_positions.py +2 -9
  13. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/parameters/help_extended.md +24 -3
  14. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/parameters/models_description.md +2 -2
  15. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/parameters_table.py +1 -1
  16. {syncmoss-0.8.0 → syncmoss-0.8.1/syncmoss.egg-info}/PKG-INFO +1 -1
  17. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss.egg-info/SOURCES.txt +4 -0
  18. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss.egg-info/scm_file_list.json +4 -0
  19. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/golden_models.json +49 -49
  20. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/resource_profile.json +578 -122
  21. syncmoss-0.8.1/tests/test_asm_p.py +186 -0
  22. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_expressions.py +3 -0
  23. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_fit_core.py +14 -2
  24. syncmoss-0.8.1/tests/test_jacobi_elliptic.py +52 -0
  25. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_jit_cache.py +1 -1
  26. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_legacy.py +38 -2
  27. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_minimi_batch_eval.py +41 -1
  28. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_models_dual.py +23 -1
  29. {syncmoss-0.8.0 → syncmoss-0.8.1}/.gitattributes +0 -0
  30. {syncmoss-0.8.0 → syncmoss-0.8.1}/.github/workflows/Tests.yml +0 -0
  31. {syncmoss-0.8.0 → syncmoss-0.8.1}/.github/workflows/_MacOS.yml +0 -0
  32. {syncmoss-0.8.0 → syncmoss-0.8.1}/.github/workflows/_PyPI.yml +0 -0
  33. {syncmoss-0.8.0 → syncmoss-0.8.1}/.github/workflows/_TagRelease.yml +0 -0
  34. {syncmoss-0.8.0 → syncmoss-0.8.1}/.github/workflows/_Tests.yml +0 -0
  35. {syncmoss-0.8.0 → syncmoss-0.8.1}/.github/workflows/_UploadRelease.yml +0 -0
  36. {syncmoss-0.8.0 → syncmoss-0.8.1}/.github/workflows/_Version.yml +0 -0
  37. {syncmoss-0.8.0 → syncmoss-0.8.1}/.github/workflows/_Wheels.yml +0 -0
  38. {syncmoss-0.8.0 → syncmoss-0.8.1}/.github/workflows/_WindowsExe.yml +0 -0
  39. {syncmoss-0.8.0 → syncmoss-0.8.1}/.github/workflows/release.yml +0 -0
  40. {syncmoss-0.8.0 → syncmoss-0.8.1}/.gitignore +0 -0
  41. {syncmoss-0.8.0 → syncmoss-0.8.1}/.vscode/settings.json +0 -0
  42. {syncmoss-0.8.0 → syncmoss-0.8.1}/COPYING.txt +0 -0
  43. {syncmoss-0.8.0 → syncmoss-0.8.1}/LICENSE +0 -0
  44. {syncmoss-0.8.0 → syncmoss-0.8.1}/Lib_test/test.mdl +0 -0
  45. {syncmoss-0.8.0 → syncmoss-0.8.1}/NOTICE.txt +0 -0
  46. {syncmoss-0.8.0 → syncmoss-0.8.1}/README.md +0 -0
  47. {syncmoss-0.8.0 → syncmoss-0.8.1}/bundle/MacOS.spec +0 -0
  48. {syncmoss-0.8.0 → syncmoss-0.8.1}/bundle/SYNCmoss.png +0 -0
  49. {syncmoss-0.8.0 → syncmoss-0.8.1}/bundle/Windows.spec +0 -0
  50. {syncmoss-0.8.0 → syncmoss-0.8.1}/bundle/bundle.py +0 -0
  51. {syncmoss-0.8.0 → syncmoss-0.8.1}/bundle/dmg_background.pdf +0 -0
  52. {syncmoss-0.8.0 → syncmoss-0.8.1}/bundle/licenses/GPL-3.0.txt +0 -0
  53. {syncmoss-0.8.0 → syncmoss-0.8.1}/bundle/licenses/LGPL-3.0.txt +0 -0
  54. {syncmoss-0.8.0 → syncmoss-0.8.1}/bundle/macos_bundle.py +0 -0
  55. {syncmoss-0.8.0 → syncmoss-0.8.1}/bundle/third_party_licenses.py +0 -0
  56. {syncmoss-0.8.0 → syncmoss-0.8.1}/docs/thick_models.md +0 -0
  57. {syncmoss-0.8.0 → syncmoss-0.8.1}/docs/thick_vs_thin.md +0 -0
  58. {syncmoss-0.8.0 → syncmoss-0.8.1}/pyproject.toml +0 -0
  59. {syncmoss-0.8.0 → syncmoss-0.8.1}/requirements.txt +0 -0
  60. {syncmoss-0.8.0 → syncmoss-0.8.1}/setup.cfg +0 -0
  61. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/CMS_source_geometry_calibration.py +0 -0
  62. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Calibration.py +0 -0
  63. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Expressions/Central shift vs temperature.mdl +0 -0
  64. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Expressions/Hyperfine field in applied field, Langevin.mdl +0 -0
  65. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Expressions/Hyperfine field vs temperature, Bloch.mdl +0 -0
  66. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Expressions/Hyperfine field vs temperature, critical.mdl +0 -0
  67. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Expressions/Hyperfine field vs temperature, empirical.mdl +0 -0
  68. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Expressions/Lamb-Mossbauer factor vs temperature.mdl +0 -0
  69. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Expressions/Lifetime from line width.mdl +0 -0
  70. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Expressions/Neel relaxation time vs temperature.mdl +0 -0
  71. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Expressions/Paramagnetic quadrupole shift from Hamiltonian.mdl +0 -0
  72. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Expressions/Quadrupole splitting, doublet.mdl +0 -0
  73. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Expressions/Quadrupole splitting, sextet.mdl +0 -0
  74. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Expressions/Thickness PDF, Gamma.mdl +0 -0
  75. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Expressions/Thickness PDF, pressed window (clamped plate).mdl +0 -0
  76. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Expressions/Thickness PDF, pressed window (membrane).mdl +0 -0
  77. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Hamiltonian_helper.py +0 -0
  78. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Aegirine.mdl +0 -0
  79. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Akaganeite.mdl +0 -0
  80. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Almandine.mdl +0 -0
  81. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Antitaenite.mdl +0 -0
  82. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Arsenopyrite.mdl +0 -0
  83. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Bornite.mdl +0 -0
  84. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Bridgmanite (Fe,Al-bearing) @100 GPa.mdl +0 -0
  85. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Bridgmanite (Fe,Al-bearing).mdl +0 -0
  86. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Celadonite.mdl +0 -0
  87. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Cementite.mdl +0 -0
  88. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Chalcopyrite.mdl +0 -0
  89. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Clinopyroxene (augite).mdl +0 -0
  90. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Copiapite.mdl +0 -0
  91. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Cubanite.mdl +0 -0
  92. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Epidote.mdl +0 -0
  93. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Fayalite (Fe-olivine).mdl +0 -0
  94. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Ferrihydrite (2-line).mdl +0 -0
  95. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Ferropericlase.mdl +0 -0
  96. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Goethite.mdl +0 -0
  97. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Green rust (fougerite, carbonate).mdl +0 -0
  98. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Haegg carbide.mdl +0 -0
  99. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Hedenbergite.mdl +0 -0
  100. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Hematite.mdl +0 -0
  101. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Heterosite (FePO4).mdl +0 -0
  102. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Ilmenite.mdl +0 -0
  103. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Iron phosphide.mdl +0 -0
  104. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Isocubanite.mdl +0 -0
  105. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Jarosite.mdl +0 -0
  106. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Kamacite.mdl +0 -0
  107. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Lepidocrocite.mdl +0 -0
  108. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Maghemite.mdl +0 -0
  109. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Magnetite.mdl +0 -0
  110. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Marcasite.mdl +0 -0
  111. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Melanterite.mdl +0 -0
  112. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Orthopyroxene (enstatite-ferrosilite).mdl +0 -0
  113. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Prussian blue (ferric ferrocyanide).mdl +0 -0
  114. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Pyrite.mdl +0 -0
  115. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Pyrrhotite.mdl +0 -0
  116. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Rhomboclase.mdl +0 -0
  117. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Roemerite.mdl +0 -0
  118. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Siderite.mdl +0 -0
  119. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Szomolnokite.mdl +0 -0
  120. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Taenite.mdl +0 -0
  121. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Talnakhite.mdl +0 -0
  122. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Tetrataenite.mdl +0 -0
  123. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Triphylite (LiFePO4).mdl +0 -0
  124. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Troilite.mdl +0 -0
  125. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Vivianite.mdl +0 -0
  126. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Voltaite.mdl +0 -0
  127. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/alpha-Fe (metallic iron, bcc).mdl +0 -0
  128. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library_window.py +0 -0
  129. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/app_paths.py +0 -0
  130. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/bliss_channel.py +0 -0
  131. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/compile_functions.py +0 -0
  132. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/compile_window.py +0 -0
  133. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/components_results.py +0 -0
  134. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/components_search.py +0 -0
  135. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/components_window.py +0 -0
  136. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/console_io.py +0 -0
  137. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/constants.py +0 -0
  138. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/dual_kernels.py +0 -0
  139. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/dual_numbers.py +0 -0
  140. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/error_reporter.py +0 -0
  141. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/exclusion_bar.py +0 -0
  142. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/exclusion_regions.py +0 -0
  143. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/experimental_features.py +0 -0
  144. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/expression_eval.py +0 -0
  145. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/expressions_io.py +0 -0
  146. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/expressions_window.py +0 -0
  147. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/fit_quality.py +0 -0
  148. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/frozen_cache_locator.py +0 -0
  149. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/hamiltonian_dual.py +0 -0
  150. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/icons/CheckBox.png +0 -0
  151. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/icons/CheckBox_.png +0 -0
  152. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/icons/CheckBox_L.png +0 -0
  153. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/icons/CheckBox_L2.png +0 -0
  154. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/icons/DU.png +0 -0
  155. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/icons/Switch.png +0 -0
  156. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/icons/UD.png +0 -0
  157. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/icons/icon_r.ico +0 -0
  158. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/instrumental_dialogs.py +0 -0
  159. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/instrumental_io.py +0 -0
  160. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/instrumental_window.py +0 -0
  161. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/jit_cache.py +0 -0
  162. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/license_window.py +0 -0
  163. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/models_description_window.py +0 -0
  164. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/models_removed.py +0 -0
  165. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/one_model.py +0 -0
  166. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/one_spectrum.py +0 -0
  167. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/parameters/ABSorber3.txt +0 -0
  168. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/parameters/Be.txt +0 -0
  169. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/parameters/Calibration.dat +0 -0
  170. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/parameters/GCMS.txt +0 -0
  171. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/parameters/INS_APS.txt +0 -0
  172. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/parameters/INSexp.txt +0 -0
  173. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/parameters/INSint.txt +0 -0
  174. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/parameters/INSth.txt +0 -0
  175. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/parameters/KB.txt +0 -0
  176. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/parameters/NFS.txt +0 -0
  177. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/parameters/Standard_CMS.dat +0 -0
  178. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/parameters/Standard_SMS.dat +0 -0
  179. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/parameters/calibr.png +0 -0
  180. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/parameters/help.md +0 -0
  181. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/result_window.py +0 -0
  182. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/results_table.py +0 -0
  183. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/sms_theory.py +0 -0
  184. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/spectrum_io.py +0 -0
  185. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/spectrum_model.py +0 -0
  186. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/spectrum_parameters.py +0 -0
  187. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/spectrum_plotter.py +0 -0
  188. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/spectrum_reference.py +0 -0
  189. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/spectrum_reference_window.py +0 -0
  190. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/supp_menu.py +0 -0
  191. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/support_math.py +0 -0
  192. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/syncmoss_main.py +0 -0
  193. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/test_graf.txt +0 -0
  194. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/test_param.txt +0 -0
  195. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/theme_dark.json +0 -0
  196. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/theme_light.json +0 -0
  197. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/thickness_distribution.py +0 -0
  198. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss.egg-info/dependency_links.txt +0 -0
  199. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss.egg-info/entry_points.txt +0 -0
  200. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss.egg-info/requires.txt +0 -0
  201. {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss.egg-info/top_level.txt +0 -0
  202. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/README.md +0 -0
  203. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/compile_stand_ins.py +0 -0
  204. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/conftest.py +0 -0
  205. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/data/Distr_corr.mdl +0 -0
  206. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/data/Distr_distr.mdl +0 -0
  207. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/data/alpha_fe_sms_000.mca +0 -0
  208. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/data/calibration_000_golden.json +0 -0
  209. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/data/generate_cal_fixtures.py +0 -0
  210. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/data/parameters/Calibration.dat +0 -0
  211. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/data/parameters/GCMS.txt +0 -0
  212. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/data/parameters/INSexp.txt +0 -0
  213. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/data/parameters/INSint.txt +0 -0
  214. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/data/parameters/INSth.txt +0 -0
  215. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/data/synthetic_alpha_fe_cms_linear.mca +0 -0
  216. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/data/synthetic_alpha_fe_cms_sinus.mca +0 -0
  217. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/profile_resources.py +0 -0
  218. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/syncmoss_test.py +0 -0
  219. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_baseline_polynomial.py +0 -0
  220. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_bliss_channel.py +0 -0
  221. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_calculation_time.py +0 -0
  222. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_calibrate_menu.py +0 -0
  223. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_calibration.py +0 -0
  224. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_calibration_helpers.py +0 -0
  225. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_calibration_path.py +0 -0
  226. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_channel_average.py +0 -0
  227. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_chi2_spread.py +0 -0
  228. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_cms_source_geometry_calibration.py +0 -0
  229. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_components_search.py +0 -0
  230. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_console_io.py +0 -0
  231. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_contact_author.py +0 -0
  232. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_cosine_smearing.py +0 -0
  233. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_create_spectrum_from_model.py +0 -0
  234. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_default_settings.py +0 -0
  235. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_distr_composition.py +0 -0
  236. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_distr_expansion.py +0 -0
  237. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_distr_mdl.py +0 -0
  238. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_distr_t.py +0 -0
  239. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_distr_targets.py +0 -0
  240. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_distr_text_references.py +0 -0
  241. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_dual_kernels.py +0 -0
  242. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_dual_numbers.py +0 -0
  243. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_error_reporter.py +0 -0
  244. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_exclusion_fit.py +0 -0
  245. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_exclusion_gui.py +0 -0
  246. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_exclusion_regions.py +0 -0
  247. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_expression_fit_start.py +0 -0
  248. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_expression_validation.py +0 -0
  249. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_find_bar.py +0 -0
  250. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_fit_one_spectrum.py +0 -0
  251. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_fit_quality.py +0 -0
  252. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_golden_models.py +0 -0
  253. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_gui_smoke.py +0 -0
  254. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_hamiltonian_dual.py +0 -0
  255. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_hamiltonian_texture.py +0 -0
  256. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_impurity_presets.py +0 -0
  257. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_instrumental_joint.py +0 -0
  258. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_instrumental_metadata.py +0 -0
  259. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_instrumental_method_choice.py +0 -0
  260. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_instrumental_recentre.py +0 -0
  261. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_instrumental_window.py +0 -0
  262. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_integral_points.py +0 -0
  263. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_interrupt.py +0 -0
  264. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_library_dir.py +0 -0
  265. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_library_io.py +0 -0
  266. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_license_window.py +0 -0
  267. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_link_chains.py +0 -0
  268. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_minimi_bounds.py +0 -0
  269. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_minimi_covariance.py +0 -0
  270. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_model_append.py +0 -0
  271. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_model_io.py +0 -0
  272. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_model_only_mode.py +0 -0
  273. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_model_pointwise.py +0 -0
  274. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_nbaseline_multidistr.py +0 -0
  275. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_nbaseline_results.py +0 -0
  276. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_node_sum_reuse.py +0 -0
  277. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_one_model_expand.py +0 -0
  278. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_one_model_gui.py +0 -0
  279. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_overwrite_dat_instrumental.py +0 -0
  280. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_parameter_links.py +0 -0
  281. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_polarization.py +0 -0
  282. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_recon_composition.py +0 -0
  283. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_recon_mdl.py +0 -0
  284. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_recon_results.py +0 -0
  285. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_recon_variants.py +0 -0
  286. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_reference_shift.py +0 -0
  287. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_replaced_component_skip.py +0 -0
  288. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_result_window.py +0 -0
  289. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_results_table_image.py +0 -0
  290. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_results_table_rows.py +0 -0
  291. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_save_result_model.py +0 -0
  292. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_sdw_grid.py +0 -0
  293. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_search_guards.py +0 -0
  294. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_sms_theory.py +0 -0
  295. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_source_norm.py +0 -0
  296. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_spectrum_model.py +0 -0
  297. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_spectrum_parameters.py +0 -0
  298. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_support_math.py +0 -0
  299. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_table_marks.py +0 -0
  300. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_take_result.py +0 -0
  301. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_texture_s1.py +0 -0
  302. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_theory_search.py +0 -0
  303. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_thick_gui.py +0 -0
  304. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_voigt_complex.py +0 -0
  305. {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/worker_plan.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: syncmoss
3
- Version: 0.8.0
3
+ Version: 0.8.1
4
4
  Summary: SYNCmoss — Mössbauer spectroscopy analysis application
5
5
  Author: Sergey Yaroslavtsev
6
6
  License: MIT
@@ -0,0 +1,7 @@
1
+ #@Comment P(m) of the ASM from its anharmonicity m (a published value, say): a start, or a comparison.
2
+ #@Comment $P=\mathrm{sign}(m)\,\frac{L}{L+\ln 16},\ L=-\ln(1-|m|)$
3
+ #@Comment {m} - the anharmonicity m, |m| < 1.
4
+ baseline Expression
5
+ red red
6
+ 10000 1 False 0 True 0 True 0 True 0 True =[1,1] True =[2,1] True =[3,1] True False False False False False False False False False False False False False False False False False False False
7
+ sign({m})*log(1-abs({m}))/(log(1-abs({m}))-log(16)) True False False False False False False False False False False False False False False False False False False False False False False False False False False
@@ -0,0 +1,7 @@
1
+ #@Comment The anharmonicity m of the ASM - the parameter of the Jacobi function sn(x|m) of the moment's angle - from its fitted P(m).
2
+ #@Comment $m=\mathrm{sign}(P)\,\left(1-16^{-|P|/(1-|P|)}\right)$
3
+ #@Comment {P} - P(m) of the ASM row: p[k], k its number. P = 0 is m = 0 (harmonic cycloid), P = ±1 is m = ±1 (collinear).
4
+ baseline Expression
5
+ red red
6
+ 10000 1 False 0 True 0 True 0 True 0 True =[1,1] True =[2,1] True =[3,1] True False False False False False False False False False False False False False False False False False False False
7
+ sign({P})*(1-16**(-abs({P})/(1-abs({P})))) True False False False False False False False False False False False False False False False False False False False False False False False False False False
@@ -41,7 +41,7 @@ MODEL_PARAMETER_NAMES = {
41
41
  'Hamilton_pc': ['T', 'δ, mm/s', 'Q, mm/s', 'H, T', 'L, mm/s', 'G, mm/s', 'η', 'θH, °', 'φH, °'],
42
42
  'Relax_MS': ['T', 'δ, mm/s', 'ε, mm/s', 'H, T', 'L, mm/s', 'θk, °', 'φh, °', 'A', 'R', 'alfa', 'S'],
43
43
  'Relax_2S': ['T', 'δ1, mm/s', 'ε1, mm/s', 'H1, T', 'δ2, mm/s', 'ε2, mm/s', 'H2, T', 'L, mm/s', 'θk, °', 'φh, °', 'A', 'Am', 'Ω12', 'P1/P2'],
44
- 'ASM': ['T', 'δ, mm/s', 'εm, mm/s', 'εl, mm/s', 'His, T', 'Han, T', 'L, mm/s', 'G, mm/s', 'm', 'θk, °', 'φh, °', 'A', 'Num', 'I13', 'ω, °'],
44
+ 'ASM': ['T', 'δ, mm/s', 'εm, mm/s', 'εl, mm/s', 'His, T', 'Han, T', 'L, mm/s', 'G, mm/s', 'P(m)', 'θk, °', 'φh, °', 'A', 'Num', 'I13', 'ω, °'],
45
45
  'Spectrum': ['T', 'δ, mm/s', 'G, mm/s', 'Lines'],
46
46
  'SCDW': ['T', 'δ, mm/s', 'ε, mm/s', 'H0, T', 'L, mm/s', 'G, mm/s', 'θk, °', 'φh, °', 'A', 'Am', 'KδH', 'KεH', 'Φ, °', 'h1, T', 'h3, T', 'h5, T', 'h7, T', 'h9, T', 'h11, T', 'h13, T', 'h15, T', 'd2, mm/s', 'd4, mm/s', 'd6, mm/s', 'd8, mm/s', 'N/Γ', 'I13'],
47
47
  'Be': ['T', 'δ, mm/s', 'ε, mm/s', 'L, mm/s', 'G, mm/s', 'θk, °', 'φh, °', 'A', 'G2/G1'],
@@ -803,6 +803,15 @@ def fit_model(app, inputs, spectrum_files, pool):
803
803
  print(f'[Fitting] Derivatives by differences: {reason}')
804
804
  jacobian = None
805
805
  print(f"[Fitting] Derivatives: {'exact' if jacobian is not None else 'differences'}")
806
+ # A step that fails with the Jacobian of an earlier point is tried again
807
+ # with the Jacobian of its own (minimi_hi's refresh_jacobian): the fit of
808
+ # one spectrum with exact derivatives, where a Jacobian costs 1-2 trial
809
+ # steps -- 1.25-1.7 times faster on synthetic spectra, about even on real
810
+ # ones. Not with differences (a Jacobian is an evaluation per free
811
+ # parameter), nor in a simultaneous fit: a Jacobian there costs 5-7
812
+ # trial steps -- about even over different starts, 1.2-1.5 times slower
813
+ # from a previous result (docs/minimization.md, section 12)
814
+ refresh_jacobian = jacobian is not None and not is_simultaneous
806
815
 
807
816
  # Perform minimization
808
817
  tau0 = 10 ** -3
@@ -833,7 +842,8 @@ def fit_model(app, inputs, spectrum_files, pool):
833
842
  batch_eval=batch_eval,
834
843
  weights='P',
835
844
  chi2_correction=chi2_correction(app),
836
- jacobian=jacobian
845
+ jacobian=jacobian,
846
+ refresh_jacobian=refresh_jacobian
837
847
  )
838
848
  if hi2 > 1.25:
839
849
  print('hi2 is too high let me try to continue')
@@ -854,7 +864,8 @@ def fit_model(app, inputs, spectrum_files, pool):
854
864
  batch_eval=batch_eval,
855
865
  weights='P',
856
866
  chi2_correction=chi2_correction(app),
857
- jacobian=jacobian
867
+ jacobian=jacobian,
868
+ refresh_jacobian=refresh_jacobian
858
869
  )
859
870
  if np.array_equal(pfit, pO) == True:
860
871
  if len(er) == 1:
@@ -36,7 +36,10 @@ The upgrade applies the SAME transform the presets/data files were converted wit
36
36
  the pre-merge scalar layout AND from the pre-omega polarized layout). It is
37
37
  appended set to ``omega_0(theta_k, phi_h)`` -- the angle that reproduces the
38
38
  old (plane-contains-h) geometry, up to the exact full-period symmetrization
39
- that the new ASM applies (see :func:`_asm_omega0` and ``models.TImod``).
39
+ that the new ASM applies (see :func:`_asm_omega0` and ``models.TImod``);
40
+ * ``ASM``'s anharmonicity ``m`` became ``P(m)`` (2026-11, see
41
+ :func:`asm_p_of_m`): a row that does not carry ``ASM_P_NAME`` in the name
42
+ field of that slot holds ``m``, whose value and bounds are converted exactly.
40
43
 
41
44
  The asymmetry->texture map ``f`` is the cubic through the three points the old
42
45
  scalar defaults map onto in the new parametrisation:
@@ -174,6 +177,38 @@ def _append_trailing(model_name, info, groups):
174
177
  return groups
175
178
 
176
179
 
180
+ ASM_P_SLOT = 8 # ASM's anharmonicity: P(m) since 2026-11, m before
181
+ ASM_P_NAME = 'P(m)' # written in the name field of that slot: a row without it holds m
182
+
183
+
184
+ def asm_p_of_m(m):
185
+ """ASM's P(m) = sign(m) L / (L + ln 16), L = -ln(1 - |m|) -- 0 the harmonic
186
+ cycloid, +/-1 the collinear limits; back: m = sign(P) (1 - 16**(-|P|/(1 - |P|)))
187
+ (models.ASM_modulus)."""
188
+ a = min(abs(m), 1.0)
189
+ if a == 1.0:
190
+ return math.copysign(1.0, m)
191
+ L = -math.log1p(-a)
192
+ return math.copysign(L / (L + math.log(16.0)), m)
193
+
194
+
195
+ def _asm_p_slot(row_data):
196
+ """An ASM row (flat fields) with its slot ASM_P_SLOT holding m -- no
197
+ ASM_P_NAME in its name field -- gets P(m) in the value and both bounds and
198
+ the name. A link or an expression text stays as it is."""
199
+ k = ASM_P_SLOT * 5
200
+ if len(row_data) < k + 5 or row_data[k + 3] == ASM_P_NAME or str(row_data[k]).strip() == '':
201
+ return row_data
202
+ fields = list(row_data)
203
+ for j in (k, k + 1, k + 2):
204
+ try:
205
+ fields[j] = repr(asm_p_of_m(float(fields[j])))
206
+ except (ValueError, TypeError):
207
+ pass
208
+ fields[k + 3] = ASM_P_NAME
209
+ return fields
210
+
211
+
177
212
  def normalize_legacy_model_name(name):
178
213
  """Map a pre-merge model name to its current name.
179
214
 
@@ -212,9 +247,18 @@ def upgrade_mdl_row(model_name, row_data):
212
247
  parameters that reproduce the old model exactly; see
213
248
  :data:`_HAMILTONIAN_UPGRADES`.
214
249
 
250
+ An ``ASM`` row whose anharmonicity slot is not marked ``ASM_P_NAME`` holds
251
+ ``m`` (any layout before 2026-11): it is converted to ``P(m)``.
252
+
215
253
  ``model_name`` must already be normalised (see
216
254
  :func:`normalize_legacy_model_name`).
217
255
  """
256
+ row_data = _upgrade_layout(model_name, row_data)
257
+ return _asm_p_slot(row_data) if model_name == 'ASM' else row_data
258
+
259
+
260
+ def _upgrade_layout(model_name, row_data):
261
+ """upgrade_mdl_row's change of the layout: the slots a component gained."""
218
262
  info = _MERGED.get(model_name)
219
263
  if info is None and model_name != 'Hamiltonian':
220
264
  return row_data
@@ -17,7 +17,7 @@ from syncmoss.syncmoss_main import PhysicsApp, new_pool
17
17
  from syncmoss.supp_menu import apply_saved_settings
18
18
  from syncmoss.compile_functions import compile_functions
19
19
  from syncmoss.compile_window import compile_if_needed, current_stamp
20
- __VERSION__ = "0.8.0"
20
+ __VERSION__ = "0.8.1"
21
21
 
22
22
  # What --test leaves in the cache folder for --test-again: the seconds of its
23
23
  # plain fit before anything was compiled
@@ -30,7 +30,7 @@ SYNCmoss Levenberg-Marquardt least-squares minimiser.
30
30
  Public API:
31
31
  minimi_hi(model_func, x_exp, y_exp, p0, fix=, confu=, bounds=, Expr=, NExpr=,
32
32
  MI=, MI2=, nu0=, tau0=, eps=, fixCH=, n_reg=, batch_eval=, weights=,
33
- chi2_correction=)
33
+ chi2_correction=, jacobian=, refresh_jacobian=)
34
34
  -> (params, errors, chi2_red, covariance, chi2_pearson)
35
35
  Damped Gauss-Newton (Levenberg-Marquardt) fit of ``model_func(x_exp, params)`` to
36
36
  ``y_exp``, with support for fixed parameters (``fix``), linear parameter coupling
@@ -357,7 +357,7 @@ def minimi_hi(model_func, x_exp, y_exp, p0, fix=np.array([], dtype=int),
357
357
  bounds=np.array([[], []], dtype=float), Expr=[],
358
358
  NExpr=np.array([], dtype=int), MI=10, MI2=20, nu0=2.618,
359
359
  tau0=0.001, eps=10 ** -10, fixCH=0, n_reg=0, batch_eval=None, weights='U',
360
- chi2_correction=True, jacobian=None):
360
+ chi2_correction=True, jacobian=None, refresh_jacobian=False):
361
361
  """Levenberg-Marquardt least-squares fit of ``model_func(x_exp, params)`` to ``y_exp``.
362
362
 
363
363
  Optimised twin of the previous ``minimi_lib_old.minimi_hi`` — identical signature
@@ -404,6 +404,21 @@ def minimi_hi(model_func, x_exp, y_exp, p0, fix=np.array([], dtype=int),
404
404
  an expression of it moves (the rows of the expressions' own slots, which
405
405
  are fixed, are not read), as models_dual.fit_jacobian gives them.
406
406
 
407
+ ``refresh_jacobian`` (default False) -- which Jacobian a trial step uses.
408
+ By default one Jacobian serves several points: it is taken at the start
409
+ of every other outer iteration, and the steps after an accepted one start
410
+ from the new point with it. True: a step that fails with a Jacobian taken
411
+ at an earlier point is tried again, with the same damping, with the
412
+ Jacobian of the point it starts from; only a step that fails with that
413
+ one makes the damping grow, and an outer iteration takes no second
414
+ Jacobian at the same point. It pays where the failed steps come from an
415
+ old Jacobian and a new one costs a few trial steps: fits of one spectrum
416
+ with exact derivatives, 1.25-1.7 times faster on synthetic spectra, about
417
+ even on real ones. In a simultaneous fit a Jacobian costs 5-7 trial
418
+ steps: about even over different starts, 1.2-1.5 times slower from a
419
+ previous result (ending at a slightly lower D) -- docs/minimization.md,
420
+ section 12.
421
+
407
422
  ``chi2_correction`` (default True) multiplies the covariance -- so the
408
423
  errors -- by Pearson's reduced chi-square, the last value returned, for
409
424
  every ``weights``, below 1 as well as above; where that is nan (a model
@@ -538,6 +553,8 @@ def minimi_hi(model_func, x_exp, y_exp, p0, fix=np.array([], dtype=int),
538
553
  jac, inactive = compute_jacobian(model_func, params, x_exp, fix, confu, model_cur, Expr, NExpr,
539
554
  batch_eval=batch_eval, jacobian=jacobian)
540
555
  jac_params = _jacobian_parameters(len(params), fix, inactive) # parameter of each row
556
+ # The Jacobian was taken at params, with the present fix (refresh_jacobian)
557
+ jacobian_current = True
541
558
  jac_T = jac.T
542
559
  hessian = np.matmul(jac, jac_T) # Gauss-Newton Hessian J.J^T
543
560
 
@@ -575,8 +592,11 @@ def minimi_hi(model_func, x_exp, y_exp, p0, fix=np.array([], dtype=int),
575
592
  if True:
576
593
  if strategy_count % 2 == 0:
577
594
  # --- Strategy A: refresh Jacobian, damping = scale*diag(Hessian) --
578
- jac, inactive = compute_jacobian(model_func, params, x_exp, fix, confu, model_cur, Expr, NExpr,
579
- batch_eval=batch_eval, jacobian=jacobian)
595
+ # (with refresh_jacobian, one taken at this point already serves)
596
+ if not (refresh_jacobian and jacobian_current):
597
+ jac, inactive = compute_jacobian(model_func, params, x_exp, fix, confu, model_cur, Expr, NExpr,
598
+ batch_eval=batch_eval, jacobian=jacobian)
599
+ jacobian_current = True
580
600
  jac_params = _jacobian_parameters(len(params), fix, inactive)
581
601
  if len(jac) == 0:
582
602
  print('no move is found, J=0')
@@ -708,12 +728,35 @@ def minimi_hi(model_func, x_exp, y_exp, p0, fix=np.array([], dtype=int),
708
728
  else:
709
729
  gain_ratio = -1.0
710
730
 
731
+ if gain_ratio <= 0 and refresh_jacobian and not jacobian_current and stop_code == 0:
732
+ # ------ Step REJECTED, made with the Jacobian of an earlier point:
733
+ # take it at this one and try again with the same damping
734
+ jac, inactive = compute_jacobian(model_func, params, x_exp, fix, confu, model_cur, Expr, NExpr,
735
+ batch_eval=batch_eval, jacobian=jacobian)
736
+ jacobian_current = True
737
+ if len(jac) == 0:
738
+ print('no move is found, J=0')
739
+ stop_code = 1
740
+ break
741
+ jac_params = _jacobian_parameters(len(params), fix, inactive)
742
+ jac_T = jac.T
743
+ hessian = np.matmul(jac, jac_T)
744
+ grad = np.matmul(jac, chi)
745
+ if len(damping) != len(jac):
746
+ # other parameters move the model here: their damping as this strategy sets it
747
+ damping = (damping_scale * np.diagonal(hessian).astype(float) if mu_strategy == 2
748
+ else np.full(len(jac), np.amax(hessian) * damping_scale))
749
+ bound_flags = np.array([int(0)] * len(p0))
750
+ bound_hit = 0.5
751
+ continue
752
+
711
753
  if gain_ratio <= 0:
712
754
  # ------ Step REJECTED: increase damping and retry --------------
713
755
  if ((stall_count == 2 and mu_strategy == 1) or (stall_count == 3 and mu_strategy == 1)) and bound_hit != 0.5 and stop_code == 2:
714
756
  # A bound-hitting parameter is the only thing left to move and
715
757
  # it cannot improve the fit -> fix it for good.
716
758
  fix = np.append(fix, bound_hit)
759
+ jacobian_current = False
717
760
  stall_count = 0
718
761
  damping = damping * damping_growth # grow damping (-> steepest descent)
719
762
  damping_growth = nu0 * damping_growth # accelerate growth next retry
@@ -748,6 +791,7 @@ def minimi_hi(model_func, x_exp, y_exp, p0, fix=np.array([], dtype=int),
748
791
  params[int(confu[0][matches[c_i]])] = params[int(confu[1][matches[c_i]])] * confu[2][matches[c_i]]
749
792
 
750
793
  model_cur = model_trial # accepted model becomes the base
794
+ jacobian_current = False # the Jacobian is of the point before
751
795
 
752
796
  if poisson:
753
797
  # The weights follow the model: 1/m at the point just accepted
@@ -798,6 +842,7 @@ def minimi_hi(model_func, x_exp, y_exp, p0, fix=np.array([], dtype=int),
798
842
  # break out of the inner loop so the Jacobian is rebuilt.
799
843
  fix = np.append(fix, bound_hit)
800
844
  fix = np.sort(fix)
845
+ jacobian_current = False # its rows are not the free parameters' now
801
846
  bound_flags = np.array([int(0)] * len(p0))
802
847
  bound_hit = 0.5
803
848
  inner_iteration = MI2
@@ -890,7 +935,7 @@ def minimi_hi(model_func, x_exp, y_exp, p0, fix=np.array([], dtype=int),
890
935
  params, errors, chi2_red, covariance, chi2_pearson = minimi_hi(
891
936
  _raw_model, x_exp, y_raw, params, fix_orig, confu, bounds,
892
937
  Expr, NExpr, np.maximum(int(MI / 2), 1), MI2, nu0, tau0, eps, 1, n_reg,
893
- _raw_batch, weights, chi2_correction, _raw_jacobian)
938
+ _raw_batch, weights, chi2_correction, _raw_jacobian, refresh_jacobian)
894
939
  if np.all(params == params_bak):
895
940
  errors, covariance = errors_bak, covariance_bak # a pair: same rows
896
941
 
@@ -20,7 +20,7 @@ from syncmoss import exclusion_regions
20
20
  from syncmoss.constants import (numco, number_of_baseline_parameters, mdl_color_names,
21
21
  contrast_text_color, model_colors)
22
22
  from syncmoss.Library_io import LIBRARY_METADATA_FIELDS, LIBRARY_METADATA_DEFAULTS, compute_versioned_title_if_needed
23
- from syncmoss.legacy import upgrade_mdl_row, normalize_legacy_model_name
23
+ from syncmoss.legacy import ASM_P_NAME, ASM_P_SLOT, upgrade_mdl_row, normalize_legacy_model_name
24
24
  from syncmoss.expression_eval import eval_expr
25
25
  from syncmoss.spectrum_model import distr_texts, distr_t_texts, spectrum_texts, parse_spectrum_lines
26
26
  from syncmoss.thickness_distribution import thickness_points
@@ -474,7 +474,7 @@ def model_file_rows(main_window):
474
474
  for row_idx, _, _ in kept_rows]
475
475
 
476
476
  rows = []
477
- for row_idx, row_widget, _ in kept_rows:
477
+ for row_idx, row_widget, model_name in kept_rows:
478
478
  row_data = []
479
479
  for param_idx in range(1, row_widget.layout().count()):
480
480
  param_widget = row_widget.layout().itemAt(param_idx).widget()
@@ -490,8 +490,8 @@ def model_file_rows(main_window):
490
490
  lower = lower_input.text()
491
491
  upper = upper_input.text()
492
492
 
493
- # Name (not used in current implementation, empty)
494
- name = ''
493
+ # Name: empty, but ASM's P(m) -- so that a file before it (m) is told apart
494
+ name = ASM_P_NAME if model_name == 'ASM' and param_idx - 1 == ASM_P_SLOT else ''
495
495
 
496
496
  # Fix
497
497
  top_layout = param_widget.layout().itemAt(0).layout()
@@ -27,11 +27,6 @@ SOFTWARE.
27
27
  """
28
28
 
29
29
  import numpy as np
30
- import builtins as bu
31
- def max(*args):
32
- return bu.max(*args)
33
- def min(*args):
34
- return bu.min(*args)
35
30
  # import dual_v3 as dn
36
31
  import syncmoss.minimi_lib as mi
37
32
  from syncmoss.expression_eval import eval_expr
@@ -1421,44 +1416,57 @@ def Blume_c(Sig1, Sig2, Q1, Q2, H1, H2, L, W, m0, m1, V, R):
1421
1416
  # return(Res)
1422
1417
 
1423
1418
 
1419
+ AGM_STEPS = 8 # of the arithmetic-geometric mean: 7 reach the last digit even for the largest float below 1
1420
+
1421
+
1422
+ @njit(cache=True)
1423
+ def AGM1(b): # arithmetic-geometric mean of 1 and b (A&S 17.6)
1424
+ a = 1.0
1425
+ for _ in range(AGM_STEPS):
1426
+ a, b = (a + b) / 2, np.sqrt(a * b)
1427
+ return a
1428
+
1429
+
1424
1430
  @njit(cache=True)
1425
- def K_cei(M): # Selescu, R. (2021) for <0.98 and direct approximation above
1431
+ def K_cei(M): # complete elliptic integral K(m) = pi / (2 AGM(1, sqrt(1 - m)))
1426
1432
  M = np.abs(M)
1427
- if M <= 0.9999978056985459:
1428
- m = np.sqrt(1-M)
1429
- K = np.pi*np.sqrt(2) / np.sqrt((1+m)*np.sqrt(m)) * (1 - 2**(1/4)/4 * (1+np.sqrt(m))/((1+m)*np.sqrt(m))**(1/4))
1430
- elif M < 1:
1431
- K = 1 / 2 * np.log((1 + M) / (1 - M))
1433
+ if M < 1:
1434
+ K = np.pi / (2 * AGM1(np.sqrt(1 - M)))
1432
1435
  else:
1433
1436
  K = 99999
1434
1437
  return K
1435
1438
 
1436
1439
 
1437
1440
  @njit(cache=True)
1438
- def SN(x, m): # doi.org/10.1063/1.527661
1441
+ def SN(x, m): # Jacobi sn(x|m), descending Landen transformation (A&S 16.4)
1439
1442
  m = np.abs(m)
1440
- if m <= 0.981:
1441
- mu = np.pi/4/(K_cei(m) + 10**-12 * (m==0))
1442
- t = 1/mu * np.tan(mu*x)
1443
- z = t**2
1444
-
1445
- a1 = -1/6 * (1 + m + 2*mu**2)
1446
- a2 = 1/120 * (1+m)**2 + mu**2/6 * (1+m) + m/10 + mu**4/5
1447
-
1448
- ### n = 3
1449
- p1 = (mu ** 4 + a1*mu**2 + a1**2 - a2)/(mu**2 + a1)
1450
- p2 = mu**4
1451
- q1 = (mu ** 4 - a2)/(mu**2+a1) # error in article
1452
- q2 = mu ** 2 * (mu**4-a2)/(mu**2+a1)
1453
- q3 = mu**6
1454
- sn = (1 + p1 * z + p2 * z**2) \
1455
- / (1 + q1 * z + q2 * z ** 2 + q3 * z ** 3) * t
1456
- elif m < 1:
1457
- sn = (np.exp(2 * x) - 1) / (np.exp(2 * x) + 1) # np.tanh(x)
1443
+ if m < 1:
1444
+ a = np.zeros(AGM_STEPS + 1)
1445
+ c = np.zeros(AGM_STEPS + 1)
1446
+ a[0], b = 1.0, np.sqrt(1 - m)
1447
+ for n in range(1, AGM_STEPS + 1):
1448
+ a[n] = (a[n - 1] + b) / 2
1449
+ c[n] = (a[n - 1] - b) / 2
1450
+ b = np.sqrt(a[n - 1] * b)
1451
+ phi = 2.0 ** AGM_STEPS * a[AGM_STEPS] * x
1452
+ for n in range(AGM_STEPS, 0, -1):
1453
+ phi = (phi + np.arcsin(c[n] / a[n] * np.sin(phi))) / 2
1454
+ sn = np.sin(phi)
1458
1455
  else:
1459
1456
  sn = np.array([float(1)] * len(x))
1460
1457
  return sn
1461
1458
 
1459
+
1460
+ @njit(cache=True)
1461
+ def ASM_modulus(P): # ASM's P(m) = L/(L + ln 16), L = -ln(1 - |m|): exactly 1 - |m| = 16**(-|P|/(1 - |P|))
1462
+ a = np.abs(P)
1463
+ kc2 = 16.0 ** (-a / (1 - a)) if a < 1 else 0.0 # k'^2 = 1 - |m|
1464
+ if kc2 > 2.0 ** -52:
1465
+ h = AGM1(np.sqrt(kc2)) # pi/(2K)
1466
+ else: # K = ln(4/k') = ln 4/(1 - |P|) to the last digit
1467
+ h = np.pi / 2 * (1 - a) / np.log(4.0) if a <= 1 else 0.0
1468
+ return kc2, h
1469
+
1462
1470
  @njit(cache=True)
1463
1471
  def ASM(T, sigm, eps_m, eps_lat, His, Han, WL, WG, m, A, Num, I13, E):
1464
1472
  K = K_cei(m)
@@ -1932,7 +1940,7 @@ def _ham_tensor_core(Q, Hhf, etto, phi, tet):
1932
1940
  bg = Hhf * ggr * mun * c / E0_J
1933
1941
  # the excited levels in units of a power of two near max(|Q|, |b|): exact, and it
1934
1942
  # keeps p^3 and Z^3, sixth powers of that scale, inside the float range
1935
- sc = np.abs(Q) if np.abs(Q) > np.abs(b) else np.abs(b)
1943
+ sc = max(np.abs(b), np.abs(Q))
1936
1944
  sc = 2.0 ** np.floor(np.log2(sc)) if sc > 0.0 else 1.0
1937
1945
  Q = Q / sc
1938
1946
  b = b / sc
@@ -1959,11 +1967,7 @@ def _ham_tensor_core(Q, Hhf, etto, phi, tet):
1959
1967
  return It, Gc, S
1960
1968
  # Appendix A; the clips only absorb rounding at a double root
1961
1969
  Z = np.sqrt(p * p + 12 * r)
1962
- Y = (2 * p ** 3 + 27 * q * q - 72 * p * r) / (2 * Z ** 3)
1963
- if Y > 1.0:
1964
- Y = 1.0
1965
- if Y < -1.0:
1966
- Y = -1.0
1970
+ Y = max(min((2 * p ** 3 + 27 * q * q - 72 * p * r) / (2 * Z ** 3), 1.0), -1.0)
1967
1971
  X = -p / 6 + Z / 6 * np.cos(np.arccos(Y) / 3)
1968
1972
  xi1 = np.sqrt(X)
1969
1973
  xi2 = q / (4 * xi1)
@@ -1998,7 +2002,7 @@ def _ham_tensor_core(Q, Hhf, etto, phi, tet):
1998
2002
  for i in range(4):
1999
2003
  for j in range(i):
2000
2004
  H[i, j] = np.conj(H[j, i])
2001
- Om = np.abs(lam[0]) if np.abs(lam[0]) > np.abs(lam[3]) else np.abs(lam[3])
2005
+ Om = max(np.abs(lam[3]), np.abs(lam[0]))
2002
2006
  lb = np.empty(len(pairs))
2003
2007
  rho2 = np.empty(len(pairs))
2004
2008
  for n in range(len(pairs)):
@@ -2064,9 +2068,7 @@ def Ham_mosaic(Q, Hhf, etto, phi, tet, tetr, phir, alfak, Atex, Am, Ah, cms):
2064
2068
  n0 = np.ascontiguousarray(R0[2] if cms else R0[0]) # same axis in EFG coords
2065
2069
 
2066
2070
  # order parameters -> the four moments of the two ODF stages
2067
- c2 = (1.0 + 2.0 * Atex) / 3.0 # <cos^2 chi>
2068
- if c2 < 0.0: # guard an out-of-range A
2069
- c2 = 0.0
2071
+ c2 = max((1.0 + 2.0 * Atex) / 3.0, 0.0) # <cos^2 chi>; 0 guards an out-of-range A
2070
2072
  c1 = Am * np.sqrt(c2) # <cos chi> = S1
2071
2073
  r1 = Ah # <cos alpha>
2072
2074
  r2 = Ah * Ah # <cos 2 alpha>
@@ -2134,22 +2136,29 @@ def relax_MS_thick_c(S, x, I, Sig, eps, Hv, W, R, alfa):
2134
2136
 
2135
2137
 
2136
2138
  @njit(cache=True)
2137
- def ASM_thick_terms(sigm, eps_m, eps_lat, His, Han, m, Num):
2138
- """Per-modulation-point line positions for the anharmonic spin modulation.
2139
-
2140
- Same modulation physics as ``ASM`` but (a) returns ``co`` = cos^2(theta) of
2141
- the local moment (used to reconstruct the local moment direction) and (b)
2142
- samples the six line positions at the SAME Num points (no per-line
2143
- subsampling), so ``TImod`` can build a 2x2 cross-section matrix per point
2144
- from the local moment direction and average them over the modulation.
2139
+ def ASM_thick_terms(sigm, eps_m, eps_lat, His, Han, P, Num):
2140
+ """Per-modulation-point line positions and weights for the anharmonic spin modulation.
2141
+
2142
+ The points: the moment's amplitude phi (sn = sin phi, co = cos^2(theta) =
2143
+ sin^2 phi) at the midpoints of Num - 1 equal steps of [0, pi/2], and the
2144
+ collinear point co = 1 (co -> 1 - co for P < 0). The weights: the share of
2145
+ the period the moment spends there, dx = dphi / sqrt(1 - m sin^2 phi) over
2146
+ the quarter period K = pi/(2h), h / (Num - 1) / sqrt(cos^2 phi + k'^2 sin^2 phi)
2147
+ each; the collinear point takes the rest -- the time near phi = pi/2 the
2148
+ steps do not resolve when the period is long, all of it at |P| = 1. P(m),
2149
+ k'^2 and h: ASM_modulus. The six line positions at every point, so
2150
+ ``TImod`` builds a 2x2 cross-section matrix per point from the local moment.
2145
2151
  """
2146
- K = K_cei(m)
2147
- Num = int(Num / 6) * 6 + 1
2148
- X = np.linspace(0, K, Num)
2149
- if m >= 0:
2150
- co = SN(X, m) ** 2
2151
- else:
2152
- co = 1 - SN(X, m) ** 2
2152
+ kc2, h = ASM_modulus(P)
2153
+ n = int(Num) - 1 if Num >= 2 else 1
2154
+ phi = (np.arange(n) + 0.5) * (np.pi / 2 / n)
2155
+ co = np.ones(n + 1)
2156
+ co[:n] = np.sin(phi) ** 2
2157
+ w = np.empty(n + 1)
2158
+ w[:n] = h / n / np.sqrt(np.cos(phi) ** 2 + kc2 * co[:n])
2159
+ w[n] = 1 - np.sum(w[:n])
2160
+ if P < 0:
2161
+ co = 1 - co
2153
2162
 
2154
2163
  eps = eps_m + eps_lat * (3 * co - 1) / 2
2155
2164
  H = His + Han * (3 * co - 1) / 2
@@ -2165,7 +2174,7 @@ def ASM_thick_terms(sigm, eps_m, eps_lat, His, Han, m, Num):
2165
2174
  v3 = sigm - eps + a2 - mun * (gex + ggr) / 2 * H
2166
2175
  v4 = sigm - eps - a2 + mun * (gex + ggr) / 2 * H
2167
2176
 
2168
- return (co, v1, v2, v3, v4, v5, v6)
2177
+ return (co, w, v1, v2, v3, v4, v5, v6)
2169
2178
 
2170
2179
  @njit(cache=True)
2171
2180
  def SDW_thick_terms_direct(d0, eps0, KeH, H0, hodd, phi_deg, KdH, dev, Num):
@@ -2251,11 +2260,7 @@ def _bin_positions(vk, dg, norm):
2251
2260
  inv = 1.0 / dg
2252
2261
  for j in range(len(vk)):
2253
2262
  x = (vk[j] - lo) * inv + 1.0
2254
- i0 = int(np.floor(x))
2255
- if i0 < 1:
2256
- i0 = 1
2257
- elif i0 > nbins - 3:
2258
- i0 = nbins - 3
2263
+ i0 = min(max(int(np.floor(x)), 1), nbins - 3) # nbins >= 4, so 1 <= nbins - 3
2259
2264
  frac = x - i0
2260
2265
  weights[i0 - 1] += (-frac ** 3 + 2 * frac ** 2 - frac) / 2
2261
2266
  weights[i0] += (3 * frac ** 3 - 5 * frac ** 2 + 2) / 2
@@ -2280,12 +2285,8 @@ def SDW_thick_terms(d0, eps0, KeH, H0, hodd, phi_deg, KdH, dev, Num, WL, WG, Mul
2280
2285
  weight vector sums to 1.
2281
2286
  """
2282
2287
  v = SDW_thick_terms_direct(d0, eps0, KeH, H0, hodd, phi_deg, KdH, dev, Num)
2283
- width = abs(WL)
2284
- if abs(WG) > width:
2285
- width = abs(WG)
2286
2288
  natural = NAT_WIDTH * MulCo # natural Lorentzian width (WL default), MulCo-scaled
2287
- if width < natural:
2288
- width = natural
2289
+ width = max(abs(WL), abs(WG), natural)
2289
2290
  dg = width / steps
2290
2291
  norm = float(len(v[0]))
2291
2292
  g1, w1 = _bin_positions(v[0], dg, norm)
@@ -2886,6 +2887,9 @@ def TImod (x_exp, p, model, EE, x0, MulCo, INS, Distri, Cor, Met = 0, sms_pol=SM
2886
2887
  # matrix is used. Old fits use omega = omega_0(theta_k, phi_h) =
2887
2888
  # degrees(arctan2(-sin(phi_h), cos(theta_k) * cos(phi_h))), the
2888
2889
  # transverse-to-u part of h (=90 in the degenerate u || h case).
2890
+ # The anharmonicity is P(m) (ASM_modulus), in [-1, 1]: 0 the
2891
+ # harmonic cycloid, +/-1 the two collinear limits; each point
2892
+ # weighs the share of the period it stands for (ASM_thick_terms).
2889
2893
  I = abs(p[V])
2890
2894
  sigm = p[V + 1] * MulCo
2891
2895
  eps_m = p[V + 2] * MulCo
@@ -2894,14 +2898,14 @@ def TImod (x_exp, p, model, EE, x0, MulCo, INS, Distri, Cor, Met = 0, sms_pol=SM
2894
2898
  Han = p[V + 5] * MulCo
2895
2899
  WL = abs(p[V + 6]) * MulCo
2896
2900
  WG = abs(p[V + 7]) * MulCo
2897
- m_asm = p[V + 8]
2901
+ P_asm = p[V + 8] # P(m)
2898
2902
  th = p[V + 9]
2899
2903
  ph = p[V + 10]
2900
2904
  Atex = p[V + 11] # uniaxial (fiber) texture order parameter
2901
2905
  Num = int(abs(p[V + 12]))
2902
2906
  I13 = p[V + 13]
2903
2907
  om = p[V + 14] # cycloid-plane angle about the easy axis, deg
2904
- co, v1, v2, v3, v4, v5, v6 = ASM_thick_terms(sigm, eps_m, eps_lat, His, Han, m_asm, Num)
2908
+ co, wco, v1, v2, v3, v4, v5, v6 = ASM_thick_terms(sigm, eps_m, eps_lat, His, Han, P_asm, Num)
2905
2909
  Nn = len(co)
2906
2910
  Aeff = 0.5
2907
2911
  I1 = I * (4 * I13 / (I13 + 1)) * (1 - Aeff) / (8 - 4 * Aeff)
@@ -2936,7 +2940,7 @@ def TImod (x_exp, p, model, EE, x0, MulCo, INS, Distri, Cor, Met = 0, sms_pol=SM
2936
2940
  + _mhat_dm0(mxb, myb)), Atex)
2937
2941
  add += (I1 * (Voigt_c(WL, WG, E - v1[j]) + Voigt_c(WL, WG, E - v6[j]))[:, None, None] * Md1[None, :, :]
2938
2942
  + I2 * (Voigt_c(WL, WG, E - v2[j]) + Voigt_c(WL, WG, E - v5[j]))[:, None, None] * Mpi[None, :, :]
2939
- + I3 * (Voigt_c(WL, WG, E - v3[j]) + Voigt_c(WL, WG, E - v4[j]))[:, None, None] * Md1[None, :, :]) / Nn
2943
+ + I3 * (Voigt_c(WL, WG, E - v3[j]) + Voigt_c(WL, WG, E - v4[j]))[:, None, None] * Md1[None, :, :]) * wco[j]
2940
2944
  add = Kpref * add
2941
2945
  Smat_t = add if Smat is None else Smat + add
2942
2946
  CHt = CH