brandondube / prysm

physical optics: integrated modeling, phase retrieval, segmented systems, polynomials and fitting, sequential raytracing...
https://prysm.readthedocs.io/en/stable/
MIT License
262 stars 45 forks source link

raytracing: type stability #77

Closed brandondube closed 2 years ago

brandondube commented 2 years ago

It is easy for the user to enter an input ray's position (and maybe direction cosines) as integers, e.g. np.array([0,10,0]) to begin a ray at y=0 and otherwise the origin.

This array is of integer type, and when the type is picked up inside the raytrace functions, it will be int64 and break the algorithms.

The entrypoints should typecast P and S to config.precision to stabilize the algorithms.

brandondube commented 2 years ago

the raytrace routine is now fully type stabilized