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.
- {syncmoss-0.8.0/syncmoss.egg-info → syncmoss-0.8.1}/PKG-INFO +1 -1
- syncmoss-0.8.1/syncmoss/Expressions/ASM P(m) from m.mdl +7 -0
- syncmoss-0.8.1/syncmoss/Expressions/ASM m from P(m).mdl +7 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library_io.py +1 -1
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/fitting_io.py +13 -2
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/legacy.py +45 -1
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/main.py +1 -1
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/minimi_lib.py +50 -5
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/model_io.py +4 -4
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/models.py +73 -69
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/models_dual.py +29 -36
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/models_positions.py +2 -9
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/parameters/help_extended.md +24 -3
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/parameters/models_description.md +2 -2
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/parameters_table.py +1 -1
- {syncmoss-0.8.0 → syncmoss-0.8.1/syncmoss.egg-info}/PKG-INFO +1 -1
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss.egg-info/SOURCES.txt +4 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss.egg-info/scm_file_list.json +4 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/golden_models.json +49 -49
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/resource_profile.json +578 -122
- syncmoss-0.8.1/tests/test_asm_p.py +186 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_expressions.py +3 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_fit_core.py +14 -2
- syncmoss-0.8.1/tests/test_jacobi_elliptic.py +52 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_jit_cache.py +1 -1
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_legacy.py +38 -2
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_minimi_batch_eval.py +41 -1
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_models_dual.py +23 -1
- {syncmoss-0.8.0 → syncmoss-0.8.1}/.gitattributes +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/.github/workflows/Tests.yml +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/.github/workflows/_MacOS.yml +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/.github/workflows/_PyPI.yml +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/.github/workflows/_TagRelease.yml +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/.github/workflows/_Tests.yml +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/.github/workflows/_UploadRelease.yml +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/.github/workflows/_Version.yml +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/.github/workflows/_Wheels.yml +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/.github/workflows/_WindowsExe.yml +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/.github/workflows/release.yml +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/.gitignore +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/.vscode/settings.json +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/COPYING.txt +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/LICENSE +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/Lib_test/test.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/NOTICE.txt +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/README.md +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/bundle/MacOS.spec +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/bundle/SYNCmoss.png +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/bundle/Windows.spec +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/bundle/bundle.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/bundle/dmg_background.pdf +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/bundle/licenses/GPL-3.0.txt +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/bundle/licenses/LGPL-3.0.txt +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/bundle/macos_bundle.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/bundle/third_party_licenses.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/docs/thick_models.md +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/docs/thick_vs_thin.md +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/pyproject.toml +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/requirements.txt +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/setup.cfg +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/CMS_source_geometry_calibration.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Calibration.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Expressions/Central shift vs temperature.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Expressions/Hyperfine field in applied field, Langevin.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Expressions/Hyperfine field vs temperature, Bloch.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Expressions/Hyperfine field vs temperature, critical.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Expressions/Hyperfine field vs temperature, empirical.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Expressions/Lamb-Mossbauer factor vs temperature.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Expressions/Lifetime from line width.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Expressions/Neel relaxation time vs temperature.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Expressions/Paramagnetic quadrupole shift from Hamiltonian.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Expressions/Quadrupole splitting, doublet.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Expressions/Quadrupole splitting, sextet.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Expressions/Thickness PDF, Gamma.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Expressions/Thickness PDF, pressed window (clamped plate).mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Expressions/Thickness PDF, pressed window (membrane).mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Hamiltonian_helper.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Aegirine.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Akaganeite.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Almandine.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Antitaenite.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Arsenopyrite.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Bornite.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Bridgmanite (Fe,Al-bearing) @100 GPa.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Bridgmanite (Fe,Al-bearing).mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Celadonite.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Cementite.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Chalcopyrite.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Clinopyroxene (augite).mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Copiapite.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Cubanite.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Epidote.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Fayalite (Fe-olivine).mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Ferrihydrite (2-line).mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Ferropericlase.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Goethite.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Green rust (fougerite, carbonate).mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Haegg carbide.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Hedenbergite.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Hematite.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Heterosite (FePO4).mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Ilmenite.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Iron phosphide.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Isocubanite.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Jarosite.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Kamacite.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Lepidocrocite.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Maghemite.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Magnetite.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Marcasite.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Melanterite.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Orthopyroxene (enstatite-ferrosilite).mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Prussian blue (ferric ferrocyanide).mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Pyrite.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Pyrrhotite.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Rhomboclase.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Roemerite.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Siderite.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Szomolnokite.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Taenite.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Talnakhite.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Tetrataenite.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Triphylite (LiFePO4).mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Troilite.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Vivianite.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/Voltaite.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library/alpha-Fe (metallic iron, bcc).mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/Library_window.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/app_paths.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/bliss_channel.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/compile_functions.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/compile_window.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/components_results.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/components_search.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/components_window.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/console_io.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/constants.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/dual_kernels.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/dual_numbers.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/error_reporter.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/exclusion_bar.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/exclusion_regions.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/experimental_features.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/expression_eval.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/expressions_io.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/expressions_window.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/fit_quality.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/frozen_cache_locator.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/hamiltonian_dual.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/icons/CheckBox.png +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/icons/CheckBox_.png +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/icons/CheckBox_L.png +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/icons/CheckBox_L2.png +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/icons/DU.png +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/icons/Switch.png +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/icons/UD.png +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/icons/icon_r.ico +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/instrumental_dialogs.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/instrumental_io.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/instrumental_window.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/jit_cache.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/license_window.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/models_description_window.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/models_removed.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/one_model.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/one_spectrum.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/parameters/ABSorber3.txt +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/parameters/Be.txt +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/parameters/Calibration.dat +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/parameters/GCMS.txt +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/parameters/INS_APS.txt +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/parameters/INSexp.txt +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/parameters/INSint.txt +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/parameters/INSth.txt +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/parameters/KB.txt +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/parameters/NFS.txt +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/parameters/Standard_CMS.dat +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/parameters/Standard_SMS.dat +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/parameters/calibr.png +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/parameters/help.md +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/result_window.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/results_table.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/sms_theory.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/spectrum_io.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/spectrum_model.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/spectrum_parameters.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/spectrum_plotter.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/spectrum_reference.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/spectrum_reference_window.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/supp_menu.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/support_math.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/syncmoss_main.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/test_graf.txt +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/test_param.txt +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/theme_dark.json +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/theme_light.json +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss/thickness_distribution.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss.egg-info/dependency_links.txt +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss.egg-info/entry_points.txt +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss.egg-info/requires.txt +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/syncmoss.egg-info/top_level.txt +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/README.md +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/compile_stand_ins.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/conftest.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/data/Distr_corr.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/data/Distr_distr.mdl +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/data/alpha_fe_sms_000.mca +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/data/calibration_000_golden.json +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/data/generate_cal_fixtures.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/data/parameters/Calibration.dat +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/data/parameters/GCMS.txt +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/data/parameters/INSexp.txt +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/data/parameters/INSint.txt +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/data/parameters/INSth.txt +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/data/synthetic_alpha_fe_cms_linear.mca +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/data/synthetic_alpha_fe_cms_sinus.mca +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/profile_resources.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/syncmoss_test.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_baseline_polynomial.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_bliss_channel.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_calculation_time.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_calibrate_menu.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_calibration.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_calibration_helpers.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_calibration_path.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_channel_average.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_chi2_spread.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_cms_source_geometry_calibration.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_components_search.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_console_io.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_contact_author.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_cosine_smearing.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_create_spectrum_from_model.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_default_settings.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_distr_composition.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_distr_expansion.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_distr_mdl.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_distr_t.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_distr_targets.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_distr_text_references.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_dual_kernels.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_dual_numbers.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_error_reporter.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_exclusion_fit.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_exclusion_gui.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_exclusion_regions.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_expression_fit_start.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_expression_validation.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_find_bar.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_fit_one_spectrum.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_fit_quality.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_golden_models.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_gui_smoke.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_hamiltonian_dual.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_hamiltonian_texture.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_impurity_presets.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_instrumental_joint.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_instrumental_metadata.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_instrumental_method_choice.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_instrumental_recentre.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_instrumental_window.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_integral_points.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_interrupt.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_library_dir.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_library_io.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_license_window.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_link_chains.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_minimi_bounds.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_minimi_covariance.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_model_append.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_model_io.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_model_only_mode.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_model_pointwise.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_nbaseline_multidistr.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_nbaseline_results.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_node_sum_reuse.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_one_model_expand.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_one_model_gui.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_overwrite_dat_instrumental.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_parameter_links.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_polarization.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_recon_composition.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_recon_mdl.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_recon_results.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_recon_variants.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_reference_shift.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_replaced_component_skip.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_result_window.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_results_table_image.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_results_table_rows.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_save_result_model.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_sdw_grid.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_search_guards.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_sms_theory.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_source_norm.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_spectrum_model.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_spectrum_parameters.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_support_math.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_table_marks.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_take_result.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_texture_s1.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_theory_search.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_thick_gui.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/test_voigt_complex.py +0 -0
- {syncmoss-0.8.0 → syncmoss-0.8.1}/tests/worker_plan.py +0 -0
|
@@ -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.
|
|
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
|
-
|
|
579
|
-
|
|
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,
|
|
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 (
|
|
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): #
|
|
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
|
|
1428
|
-
|
|
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): #
|
|
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
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
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(
|
|
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[
|
|
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
|
|
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,
|
|
2138
|
-
"""Per-modulation-point line positions for the anharmonic spin modulation.
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
the
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
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
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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,
|
|
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, :, :])
|
|
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
|