Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Background definition + get_value_for_wavelength causes problems for optical simulations outside of 450 - 1000 nm #361

Open
RecurvedBow opened this issue Jul 24, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@RecurvedBow
Copy link
Collaborator

Describe the bug
Commonly, the background of the tissue volume is defined as:
background_dictionary[Tags.MOLECULE_COMPOSITION] = TISSUE_LIBRARY.constant(1e-4, 1e-4, 0.9)

Because this function uses CONSTANT_ABSORBER_ARBITRARY, the background tissue is defined for only the wavelengths 450 nm and 1000 nm. If we run an optical MCX simulation with a wavelength outside of it, it will fail.

Specify a priority (low, medium, high)
medium

To Reproduce
Define any tissue with the background settings and run a optical MCX simulation with a wavelength outside of 450 nor 1000, for example with 400.

Current Behavior
Upon running simulate(pipeline, settings, device), an error is raised:

> volumes = self.create_simulation_volume()
> structure_properties = structure.properties_for_wavelength(wavelength)
> return self.molecule_composition.get_properties_for_wavelength(wavelength)
> (molecule.volume_fraction * molecule.spectrum.get_value_for_wavelength(wavelength))
ValueError: The given wavelength (300) is not within the range of the spectrum (450 - 1000)

Expected behavior
The simulation successfully runs.

Additional context
To fix this, increase this wavelength range or add an min wavelength and max wavelength argument to TISSUE_LIBRARY.constant().

@RecurvedBow RecurvedBow added the bug Something isn't working label Jul 24, 2024
@kdreher
Copy link
Collaborator

kdreher commented Jul 26, 2024

This is related to #310

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants