lenstest

by Scott Prahl

pypi github conda zenodo

License testing docs Downloads

lenstest is a collection of routines for non-interferometric testing of lenses and mirrors. Developed by Scott Prahl, this package contains code for the Foucault Knife Edge Test and the Ronchi Ruling Test. With lenstest, users can test the quality of their lenses and mirrors without the need for interferometric equipment.

Detailed documentation is available at <https://lenstest.readthedocs.io>.

Installation

  • Install with pip:

    pip install lenstest
    
  • or with conda:

    conda install -c conda-forge lenstest
    

or use immediately by clicking the Google Colaboratory button below

Colab

Foucault Example

import numpy as np
import matplotlib.pyplot as plt
import lenstest

D = 200
RoC = 400
z_offset = 10
x_offset = -0.5
conic = 0
phi = np.radians(0)

foucault.plot_lens_layout(D, RoC, x_offset, z_offset)
plt.show()

foucault.plot_knife_and_screen(D, RoC, x_offset, z_offset, phi=phi)
plt.show()

Produces

foucougram

Ronchi Example

10 meter parabolic mirror comparison.

import numpy as np
import matplotlib.pyplot as plt
import lenstest

D = 10000  # 10 meter mirror
F = 5
conic = -1
lp_per_mm = 0.133  # grating frequency lp/mm

RoC =  F * D * 2

print("    Mirror Diameter = %.0f mm" % D)
print("                 F# = %.1f" % F)
print("Radius of Curvature = %.0f mm" % RoC)
print("       Focal Length = %.0f mm" % (RoC/2))
print("   Ronchi Frequency = %.3f lp/mm" % lp_per_mm)

plt.subplots(2,3,figsize=(13,8))

for i, z_offset in enumerate([-63,35,133,231,329,429]):
    plt.subplot(2,3,i+1)
    x,y = lenstest.ronchi.gram(D, RoC, lp_per_mm, z_offset, conic=conic)
    plt.plot(x,y,'o', markersize=0.1, color='blue')
    lenstest.lenstest.draw_circle(D/2)
    plt.title("%.0fmm from focus"%z_offset)
    plt.gca().set_aspect("equal")
    if i in [1,2,4,5]:
        plt.yticks([])
    if i in [0,1,2]:
        plt.xticks([])
plt.show()

Produces

Ronchigram

License

lenstest is licensed under the terms of the MIT license.