Skip to main content

Gradient Index (GRIN) Lens Calculations

Project description

by Scott Prahl

pypi github conda doi

License Testing Docs Downloads

A basic collection of routines to ray trace through graded index (GRIN) lenses with a parabolic radial profile.

full pitch lens

Example

Properties of a 0.25 pitch GRIN lens from an ancient Melles Griot Catalog:

import pygrin
n = 1.608
gradient = 0.339
length = 5.37
diameter = 1.8

pitch = pygrin.period(gradient, length)
ffl = pygrin.FFL(n,pitch,length)
efl = pygrin.EFL(n,pitch,length)
na = pygrin.NA(n,pitch,length,diameter)

angle = pygrin.max_angle(n,pitch,length,diameter)
print('expected pitch = 0.29,            calculated %.2f' % pitch)
print('expected FFL = 0.46 mm,           calculated %.2f' % ffl)
print('expected NA = 0.46,               calculated %.2f' % na)
print('expected full accept angle = 55°, calculated %.0f°' % (2*angle*180/np.pi))
print('working distance = %.2f mm'%(efl-ffl))

Produces:

expected pitch = 0.29,            calculated 0.29
expected FFL = 0.46,              calculated 0.47
expected NA = 0.46,               calculated 0.46
expected full accept angle = 55°, calculated 55°
working distance = 1.43 mm

But the real utility of this module is creating plots that show the path of rays through a GRIN lens. For examples, see <https://pygrin.readthedocs.io>

Installation

Use pip:

pip install pygrin

or conda:

conda install -c conda-forge pygrin

or use immediately by clicking the Google Colaboratory button below

Colab

License

pygrin is licensed under the terms of the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pygrin-0.5.1.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

pygrin-0.5.1-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file pygrin-0.5.1.tar.gz.

File metadata

  • Download URL: pygrin-0.5.1.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for pygrin-0.5.1.tar.gz
Algorithm Hash digest
SHA256 afa45fadaa2b3b94e36165955066f3d099ea3efbd03c0dbc24cc5b6ab88bc1a0
MD5 e13b463446b743cd47ef5be9a6c712e0
BLAKE2b-256 47896fcd0b959ffe5997cb2efc8bddbd7e1e20f82adc3a3cc60e339636a4fd54

See more details on using hashes here.

File details

Details for the file pygrin-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: pygrin-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for pygrin-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bbd1b7a789e4b1887c288c38c1349074cdc559e0449bf11db6a00a615a63557e
MD5 637c14dd73fc53652866afd98a2b5a6d
BLAKE2b-256 062c9520f6748b33d77b0b8ae1169e315195667050829fca5e54b05e47300421

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page