Final cleanup for the top-level Transfocator object.
API
The Transfocator object now as all lenses attached as Components this accomplishes two things:
1) You can now type something like this to insert a single lens:
tfs.prefocus_top.insert()
2) You don't have to pass in xrt_lenses and tfs_lenses into the constructor. Since there is only one Transfocator, why make our constructor so complex?
Maintainance
find_solution is more robust against edge cases; no xrt lenses provided, combinations we can not calculate the focus for.
Fixes
When lenses try and calculate an image for an object at their focal distance this should report np.inf. The check for this was done incorrectly. We can not compare directly to the Lens.z value instead, we need to compare to the distance from the object to the Lens.z.
Tests
Tests were greatly simplified. All of the intensive focus calculation were moved to find_solution. This leaves the Transfocator tests the job of simply checking that we do the correct thing with the solutions given to us by the Calculator object
Deprecations
A pre-assembled Transfocator object is not longer contained within config
Description
Final cleanup for the top-level Transfocator object.
API
2) You don't have to pass in
xrt_lenses
andtfs_lenses
into the constructor. Since there is only one Transfocator, why make our constructor so complex?Maintainance
find_solution
is more robust against edge cases; no xrt lenses provided, combinations we can not calculate the focus for.Fixes
np.inf
. The check for this was done incorrectly. We can not compare directly to theLens.z
value instead, we need to compare to the distance from the object to theLens.z
.Tests
find_solution
. This leaves the Transfocator tests the job of simply checking that we do the correct thing with the solutions given to us by theCalculator
objectDeprecations
A pre-assembled
Transfocator
object is not longer contained withinconfig