-
Notifications
You must be signed in to change notification settings - Fork 50
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
Using DDA on objects with more than one domain #5
Comments
That is actually corrected in the most recent version of the docs, if you build it yourself, or look at: If you want to do a dumbbell like that specifically, you might also try out the CSG Union I added but have not formally documented yet. from holopy.core import Optics, ImageSchema
from holopy.scattering.scatterer import Union, Sphere
from holopy.scattering.theory import DDA
s1 = Sphere(n=1.59, r = .5, center = (5, 4.6, 5))
s2 = Sphere(n=1.59, r = .5, center = (5, 5.4, 5))
schema = ImageSchema(100, .1, Optics(.66, 1.33, (1, 0)))
dumbbell = Union(s1, s2)
holo = DDA.calc_holo(dumbbell, schema)
# csg scattters do support rotations
holo_rotatated = DDA.calc_holo(dumbbell.rotated(1, 0, 0), schema) I want to get a little bit of feedback on the interface, but if you think this is sensible after using it, I can move to formally documenting the csg interface. |
I see. The way it's done now is incompatible with the 10+ other types of On 29 July 2014 14:24, Tom Dimiduk notifications@github.com wrote:
|
Using the example from the tutorial (http://manoharan.seas.harvard.edu/holopy/users/dda_tutorial.html#dda-tutorial) fails:
import holopy as hp
from holopy.core import Optics, ImageSchema
from holopy.scattering.scatterer import Scatterer, Sphere
from holopy.scattering.theory import DDA
s1 = Sphere(r = .5, center = (0, -.4, 0))
s2 = Sphere(r = .5, center = (0, .4, 0))
schema = ImageSchema(100, .1, Optics(.66, 1.33, (1, 0)))
dumbbell = Scatterer(lambda point: s1.contains(point) or s2.contains(point),
1.59, (5, 5, 5))
holo = DDA.calc_holo(dumbbell, schema)
gives error:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
The text was updated successfully, but these errors were encountered: