Skip to main content

SPECTRA User Interface to Python

Project description

spectra-ui

spectra-ui is a Python library to interface the synchrotron radiation calculation code SPECTRA.

Details

For details, visit the spectra-ui homepage

Installation

Use the package manager to install spectra-ui.

pip install spectra-ui (--user)

Usage

import spectra

# launch SPECTRA: interactive mode, HTML source in CDN
spectra.Start(mode="i")

# open a parameter file "/path/to/parameter_file"
spectra.Open("/path/to/parameter_file")

# select calculation: Far Field & Ideal Condition::Energy Dependence::Angular Flux Density
spectra.SelectCalculation("far", "energy", "fdensa")

# start calculation: output file will be /path/to/data_dir/sample.json
spectra.StartCalculation(folder="/path/to/data_dir", prefix="sample", serial=-1)

# plot Gaussian-Approximated Brilliance in the Post-Processor
spectra.PostProcess.Plot("GA. Brilliance")

# quit SPECTRA
spectra.Exit()

Requirement

You need to install a web browser (Chrome, Edge, or Firefox; Safari is not upported) to show parameter lists, graphical plots, and calculation progress.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spectra-ui-12.0.0.2.zip (5.3 MB view hashes)

Uploaded Source

Built Distributions

spectra_ui-12.0.0.2-py3-none-win_amd64.whl (10.0 MB view hashes)

Uploaded Python 3 Windows x86-64

spectra_ui-12.0.0.2-py3-none-macosx_14_0_x86_64.whl (11.5 MB view hashes)

Uploaded Python 3 macOS 14.0+ x86-64

spectra_ui-12.0.0.2-py3-none-macosx_14_0_arm64.whl (10.4 MB view hashes)

Uploaded Python 3 macOS 14.0+ ARM64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page