pygrin

A python module to ray trace through gradient index (GRIN) lenses.

https://github.com/scottprahl/pygrin

Science Score: 64.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
    1 of 2 committers (50.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.1%) to scientific vocabulary
Last synced: 6 months ago · JSON representation ·

Repository

A python module to ray trace through gradient index (GRIN) lenses.

Basic Info
  • Host: GitHub
  • Owner: scottprahl
  • License: mit
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 3.44 MB
Statistics
  • Stars: 8
  • Watchers: 3
  • Forks: 2
  • Open Issues: 0
  • Releases: 7
Created about 8 years ago · Last pushed almost 2 years ago
Metadata Files
Readme Changelog License Citation

README.rst

.. |pypi| image:: https://img.shields.io/pypi/v/pygrin?color=68CA66
   :target: https://pypi.org/project/pygrin/
   :alt: pypi

.. |github| image:: https://img.shields.io/github/v/tag/scottprahl/pygrin?label=github&color=68CA66
   :target: https://github.com/scottprahl/pygrin
   :alt: github

.. |conda| image:: https://img.shields.io/conda/vn/conda-forge/pygrin?label=conda&color=68CA66
   :target: https://github.com/conda-forge/pygrin-feedstock
   :alt: conda

.. |doi| image:: https://zenodo.org/badge/116033943.svg
   :target: https://zenodo.org/badge/latestdoi/116033943
   :alt: doi  

.. |license| image:: https://img.shields.io/github/license/scottprahl/pygrin?color=68CA66
   :target: https://github.com/scottprahl/pygrin/blob/main/LICENSE.txt
   :alt: License

.. |test| image:: https://github.com/scottprahl/pygrin/actions/workflows/test.yaml/badge.svg
   :target: https://github.com/scottprahl/pygrin/actions/workflows/test.yaml
   :alt: Testing

.. |docs| image:: https://readthedocs.org/projects/pygrin/badge?color=68CA66
   :target: https://pygrin.readthedocs.io
   :alt: Docs

.. |downloads| image:: https://img.shields.io/pypi/dm/pygrin?color=68CA66
   :target: https://pypi.org/project/pygrin/
   :alt: Downloads

pygrin
======

by Scott Prahl

|pypi| |github| |conda| |doi|

|license| |test| |docs| |downloads|

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

.. image:: https://raw.githubusercontent.com/scottprahl/pygrin/main/docs/pitch.png
   :alt: 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 

Installation
------------

Use ``pip``::

    pip install pygrin

or ``conda``::

    conda install -c conda-forge pygrin

or use immediately by clicking the Google Colaboratory button below

.. image:: https://colab.research.google.com/assets/colab-badge.svg
  :target: https://colab.research.google.com/github/scottprahl/pygrin/blob/main
  :alt: Colab

License
-------
``pygrin`` is licensed under the terms of the MIT license.

Owner

  • Name: Scott Prahl
  • Login: scottprahl
  • Kind: user
  • Location: Portland, Oregon
  • Company: Oregon Institute of Technology

Citation (CITATION.cff)

authors:
- family-names: Prahl
  given-names: Scott
  orcid: https://orcid.org/0000-0003-1468-6851
cff-version: 1.2.0
date-released: '2023-09-22'
doi: 10.5281/zenodo.8370822
message: If you use this software, please cite it as below.
title: 'pygrin: a python module to ray trace through gradient index (GRIN) lenses'
url: https://zenodo.org/badge/latestdoi/116033943
version: 0.5.1

GitHub Events

Total
  • Watch event: 1
Last Year
  • Watch event: 1

Committers

Last synced: almost 3 years ago

All Time
  • Total Commits: 75
  • Total Committers: 2
  • Avg Commits per committer: 37.5
  • Development Distribution Score (DDS): 0.067
Past Year
  • Commits: 4
  • Committers: 1
  • Avg Commits per committer: 4.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Scott Prahl s****t@p****m 70
Work Prahl p****l@b****u 5
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 7 months ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 2
  • Total downloads:
    • pypi 33 last-month
  • Total dependent packages: 0
    (may contain duplicates)
  • Total dependent repositories: 1
    (may contain duplicates)
  • Total versions: 9
  • Total maintainers: 1
pypi.org: pygrin

Gradient Index (GRIN) Lens Calculations

  • Versions: 8
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 33 Last month
Rankings
Dependent packages count: 10.1%
Average: 20.1%
Dependent repos count: 21.6%
Stargazers count: 21.6%
Forks count: 22.7%
Downloads: 24.5%
Maintainers (1)
Last synced: 7 months ago
conda-forge.org: pygrin

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

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Average: 100%
Last synced: 7 months ago