Closed ccampb19 closed 5 years ago
Dear Chris,
Thank you for finding another bug! In VtsSpectroscopy.m the call to the Vts.dll IntralipidScatterer was erroneously using VolumeFraction instead of vol_frac. VolumeFraction is the property within the class, however in the matlab script we have simplified the names of those scatterer properties to ease use. So vol_frac is the one that should be used in the matlab script and I have updated VtsSpectroscopy.m to use vol_frac so when the next release of our matlab inter code is provided, it will be fixed.
While I was editing VtsSpectroscopy.m I expanded the Mie scatterer properties to include vol_frac. I also added two examples in vts_solver_demo.m that uses an Intralipid scatterer and an example that uses a Mie scatterer specification.
Just a comment about your script. For scatterers, the volume fraction is expected to be a real number between 0 and 1, not complex. Are you by chance wanting to specify a complex refractive index? If so using the Mie scatterer properties might work for you.
Thanks again for helping us improve our code. Best, Carole
Hi again Carole,
Thanks for being so responsive! I frequently use 'i' as an increment, which may not be the best practice here, but Matlab doesn't seem to notice. For complex numbers I think Matlab prefers 1i*(theComplexNumber).
Thanks for the clarification about 'i'. I'll post here when the new Matlab download is available. I'm glad you have a workaround in the meantime.
The latest Matlab Interop download, version 4.6, has this bug fix.
Following the scatterer.type='Intralipid' example in GetOP_help.m doesn't work. VtsSpectroscopy requires an additional field, "scatterer.VolumeFraction" in addition to "scatterer.vol_frac" to work correctly.
Application: VTS Matlab v4.5.0 Beta
To Reproduce: Use the code below. It produces a figure with three distinct scattering curves, as expected. Comment out only the "scatterer.VolumeFraction" line and get an error. Comment out only the "scatterer.vol_frac" line and get three identical scattering curves, indicating the default volume fraction is being used.
Expected Behavior: GetOP_help.m lists only the vol_frac field. VolumeFraction should not be required. or vice-versa