A PyQt-based interactive application to explore scattering models using the sasmodels
library.
This app enables visualization and fine-tuning of model parameters via a user-friendly GUI, featuring both sliders and dropdown menus for parameter adjustments, and a real-time plot of scattering intensity.
sasmodels
model by typing its name and pressing Enter.git clone https://github.com/SasView/explorer`
cd <repository folder>
python3.12 -m venv .venv
.venv/bin/activate
pip install -r requirements.txt
python -m ModelExplorer -v sphere@hardsphere
deactivate
Type the model name (e.g., "sphere", "cylinder", or sasmodels-syntax combinations such as "sphere@hardsphere+cylinder") in the model field and press Enter to load it. The app will display parameter controls for the model.
Sliders and Text Boxes: Each parameter has an adjustable slider and a text box for exact values. Logarithmic sliders enable wide-range adjustments. Dropdown Menus: Parameters with multiple text options (e.g., _pd_type for polydispersity) appear as dropdowns. Polydispersity Controls: Automatically includes controls for relevant parameters: polydispersity and (default number-weighted) distribution shape. Axis controls: Under the graph, the q limits and q units can be adjusted.
Try these models to get started:
"sphere"
: Spherical scatterer model."cylinder"
: Cylindrical scatterer model."sphere@hardsphere"
: sphere model with a hard-shell structure factor."sphere@hardsphere+porod"
: sphere model with a hard-shell structure factor and additional Porod slope.The entire sasmodels library is available, which you can combine, multiply, subtract with the syntax alluded to above... A help text with the available models is displayed when a nonexistent model is entered.
The application uses logging
for tracking parameter changes:
DEBUG
in the code or use the -vv option at the CLI.Also check the "issues" in the Github repository.
Contributions are welcome! Feel free to open issues or submit pull requests.
This project is licensed under the MIT License.