Software for performing silent substitution in Python.
Project description
Welcome to PySilentSubstitution!
PySilSub is a Python software for performing the method of silent substitution with any multiprimary stimulation system for which accurate calibration data are available. Solutions are found with linear algebra and numerical optimisation via a flexible, intuitive interface:
from pysilsub.problem import SilentSubstitutionProblem as SSP
problem = SSP.from_package_data('STLAB_1_York') # Load example data
problem.ignore = ['R'] # Ignore rod photoreceptors
problem.minimize = ['S', 'M', 'L'] # Minimise cone contrast
problem.modulate = ['I'] # Target melnopsin
problem.target_contrast = .3 # With 30% contrast
solution = problem.optim_solve() # Solve with optimisation
fig = problem.plot_solution(solution) # Plot the solution
Another example:
problem.background = [.5] * problem.nprimaries # Half-max all channels
problem.ignore = ['R'] # Ignore rod photoreceptors
problem.minimize = ['M', 'L', 'I'] # Minimise L-cone, M-cone, and melanopsin
problem.modulate = ['S'] # Target S-cones
solution = problem.linalg_solve() # Solve with linear algebra
fig = problem.plot_solution(solution) # Plot the solution
There are many other features and use cases covered. The package also includes 6 example datasets for various multiprimary systems, so you can run the above code after a simple pip install:
pip install pysilsub
For further information, take a look at the GitHub repository and documentation pages.
Important note
This is a test release and should not be used for production.
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
Built Distribution
File details
Details for the file pysilsub-0.0.13.tar.gz
.
File metadata
- Download URL: pysilsub-0.0.13.tar.gz
- Upload date:
- Size: 6.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.11.4 pkginfo/1.8.3 requests/2.28.1 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 310da49f974b781ce29d1de385c88d7103979aa9b3b7eb9ab9b9fe48210113dd |
|
MD5 | eaf080948fb62906f55d59872120d28f |
|
BLAKE2b-256 | beceb0c04f22a1ad84b504079578a9b0863160afed9c4b404a658e6de4742c1b |
File details
Details for the file pysilsub-0.0.13-py3-none-any.whl
.
File metadata
- Download URL: pysilsub-0.0.13-py3-none-any.whl
- Upload date:
- Size: 6.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.11.4 pkginfo/1.8.3 requests/2.28.1 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f84e8a6068e0545e03e08ee5d57ed20ad73cef8c6837c68e12a180419e5c6395 |
|
MD5 | 28ea7b7df02303c2bc77222bb820a49d |
|
BLAKE2b-256 | 0df34d1b1ff6c59bd4d008d491301b84221ad1d06ee0f75623f8ee10d13063e4 |