You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here is a minimal working example.
With the lens in the path, the optical path returned by ccd.get_optical_path_data() is wrong.
Removing the lens it works.
80 = 30 + 30 + 20 is approximately the expected value.
With the lens in place, the hit_ray ancestor has its origin on the mirror (wrong).
deffind_ancestor(ray):
""""Return the ray source ray. The first ray in the given ray ancestry. """whileray.parent:
ray=ray.parentreturnrayprint(find_ancestor(hit_ray))
# output:Ray(pos=array([ 3., 0., 30.]),direc=array([ 0.09950372, 0. , -0.99503719]),intensity=1.0,wavelength=0.58929,n=1.0,label='',orig_surf=['C0', 'S1'], order=0)
The weird thing is, the source ray ray has the correct optical_path in it !
defget_descendance(ray):
""""Return cumulative z position and optical path until each interface. Discard the last one (infinite). """deltas= []
z= []
whileTrue:
z.append(ray.pos[2])
deltas.append(ray.optical_path_parent())
ifray.childs:
assert(len(ray.childs) ==1)
last_hit=rayray=ray.childs[0]
else:
breakreturndeltas, z, last_hit_, _, hitting_ray=get_descendance(ray)
print(hitting_ray.optical_path())
But the CCD hit_ray is found nowhere in the ray parts.
pyoptools is remarkable, it feels really physical.
(define, assemble subsystems, then propagate rays through the whole system)
Without reflection the optical path calculation works fine.
Looks related to this commented line,
but then where is hit_list updated ?
Here is a minimal working example.
With the lens in the path, the optical path returned by
ccd.get_optical_path_data()
is wrong.Removing the lens it works.
80 = 30 + 30 + 20
is approximately the expected value.With the lens in place, the hit_ray ancestor has its origin on the mirror (wrong).
The weird thing is, the source ray
ray
has the correct optical_path in it !But the CCD
hit_ray
is found nowhere in the ray parts.pyoptools
is remarkable, it feels really physical.(define, assemble subsystems, then propagate rays through the whole system)
Without reflection the optical path calculation works fine.
Looks related to this commented line,
but then where is
hit_list
updated ?pyoptools/pyoptools/raytrace/surface/surface.pyx
Lines 367 to 368 in c2da70b
Any pointer would be appreciated.
The text was updated successfully, but these errors were encountered: