pygrin


Namepygrin JSON
Version 0.5.1 PyPI version JSON
download
home_pagehttps://github.com/scottprahl/pygrin
SummaryGradient Index (GRIN) Lens Calculations
upload_time2023-09-22 17:09:29
maintainer
docs_urlNone
authorScott Prahl
requires_python>=3.8
licenseMIT
keywords endoscope pitch selfoc graded index
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            pygrin
======

by Scott Prahl

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

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

.. image:: https://img.shields.io/conda/vn/conda-forge/pygrin?color=green
   :target: https://github.com/conda-forge/pygrin-feedstock
   :alt: conda

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

|

.. image:: https://img.shields.io/github/license/scottprahl/pygrin
   :target: https://github.com/scottprahl/pygrin/blob/master/LICENSE.txt
   :alt: License

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

.. image:: https://readthedocs.org/projects/pygrin/badge
   :target: https://pygrin.readthedocs.io
   :alt: Docs

.. image:: https://img.shields.io/pypi/dm/pygrin
   :target: https://pypi.org/project/pygrin/
   :alt: 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/master/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 <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

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

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

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/scottprahl/pygrin",
    "name": "pygrin",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "endoscope,pitch,SELFOC,Graded Index",
    "author": "Scott Prahl",
    "author_email": "scott.prahl@oit.edu",
    "download_url": "https://files.pythonhosted.org/packages/47/89/6fcd0b959ffe5997cb2efc8bddbd7e1e20f82adc3a3cc60e339636a4fd54/pygrin-0.5.1.tar.gz",
    "platform": null,
    "description": "pygrin\n======\n\nby Scott Prahl\n\n.. image:: https://img.shields.io/pypi/v/pygrin?color=green\n   :target: https://pypi.org/project/pygrin/\n   :alt: pypi\n\n.. image:: https://img.shields.io/github/v/tag/scottprahl/pygrin?label=github&color=green\n   :target: https://github.com/scottprahl/pygrin\n   :alt: github\n\n.. image:: https://img.shields.io/conda/vn/conda-forge/pygrin?color=green\n   :target: https://github.com/conda-forge/pygrin-feedstock\n   :alt: conda\n\n.. image:: https://zenodo.org/badge/122556263.svg\n   :target: https://zenodo.org/badge/latestdoi/122556263\n   :alt: doi  \n\n|\n\n.. image:: https://img.shields.io/github/license/scottprahl/pygrin\n   :target: https://github.com/scottprahl/pygrin/blob/master/LICENSE.txt\n   :alt: License\n\n.. image:: https://github.com/scottprahl/pygrin/actions/workflows/test.yaml/badge.svg\n   :target: https://github.com/scottprahl/pygrin/actions/workflows/test.yaml\n   :alt: Testing\n\n.. image:: https://readthedocs.org/projects/pygrin/badge\n   :target: https://pygrin.readthedocs.io\n   :alt: Docs\n\n.. image:: https://img.shields.io/pypi/dm/pygrin\n   :target: https://pypi.org/project/pygrin/\n   :alt: Downloads\n\n__________\n\nA basic collection of routines to ray trace through graded index (GRIN) lenses with a\nparabolic radial profile.\n\n.. image:: https://raw.githubusercontent.com/scottprahl/pygrin/master/docs/pitch.png\n   :alt: full pitch lens\n\nExample\n-------\n\nProperties of a 0.25 pitch GRIN lens from an ancient Melles Griot Catalog::\n\n    import pygrin\n    n = 1.608 \n    gradient = 0.339 \n    length = 5.37\n    diameter = 1.8\n    \n    pitch = pygrin.period(gradient, length)\n    ffl = pygrin.FFL(n,pitch,length)\n    efl = pygrin.EFL(n,pitch,length)\n    na = pygrin.NA(n,pitch,length,diameter)\n\n    angle = pygrin.max_angle(n,pitch,length,diameter)\n    print('expected pitch = 0.29,            calculated %.2f' % pitch)\n    print('expected FFL = 0.46 mm,           calculated %.2f' % ffl)\n    print('expected NA = 0.46,               calculated %.2f' % na)\n    print('expected full accept angle = 55\u00b0, calculated %.0f\u00b0' % (2*angle*180/np.pi))\n    print('working distance = %.2f mm'%(efl-ffl))\n\nProduces::\n\n    expected pitch = 0.29,            calculated 0.29\n    expected FFL = 0.46,              calculated 0.47\n    expected NA = 0.46,               calculated 0.46\n    expected full accept angle = 55\u00b0, calculated 55\u00b0\n    working distance = 1.43 mm\n\nBut the real utility of this module is creating plots that show the path of rays through\na GRIN lens.   For examples, see <https://pygrin.readthedocs.io>\n\nInstallation\n------------\n\nUse ``pip``::\n\n    pip install pygrin\n\nor ``conda``::\n\n    conda install -c conda-forge pygrin\n\nor use immediately by clicking the Google Colaboratory button below\n\n.. image:: https://colab.research.google.com/assets/colab-badge.svg\n  :target: https://colab.research.google.com/github/scottprahl/pygrin/blob/master\n  :alt: Colab\n\nLicense\n-------\n``pygrin`` is licensed under the terms of the MIT license.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Gradient Index (GRIN) Lens Calculations",
    "version": "0.5.1",
    "project_urls": {
        "Homepage": "https://github.com/scottprahl/pygrin"
    },
    "split_keywords": [
        "endoscope",
        "pitch",
        "selfoc",
        "graded index"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "062c9520f6748b33d77b0b8ae1169e315195667050829fca5e54b05e47300421",
                "md5": "637c14dd73fc53652866afd98a2b5a6d",
                "sha256": "bbd1b7a789e4b1887c288c38c1349074cdc559e0449bf11db6a00a615a63557e"
            },
            "downloads": -1,
            "filename": "pygrin-0.5.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "637c14dd73fc53652866afd98a2b5a6d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 6627,
            "upload_time": "2023-09-22T17:09:28",
            "upload_time_iso_8601": "2023-09-22T17:09:28.212160Z",
            "url": "https://files.pythonhosted.org/packages/06/2c/9520f6748b33d77b0b8ae1169e315195667050829fca5e54b05e47300421/pygrin-0.5.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "47896fcd0b959ffe5997cb2efc8bddbd7e1e20f82adc3a3cc60e339636a4fd54",
                "md5": "e13b463446b743cd47ef5be9a6c712e0",
                "sha256": "afa45fadaa2b3b94e36165955066f3d099ea3efbd03c0dbc24cc5b6ab88bc1a0"
            },
            "downloads": -1,
            "filename": "pygrin-0.5.1.tar.gz",
            "has_sig": false,
            "md5_digest": "e13b463446b743cd47ef5be9a6c712e0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 8674,
            "upload_time": "2023-09-22T17:09:29",
            "upload_time_iso_8601": "2023-09-22T17:09:29.447948Z",
            "url": "https://files.pythonhosted.org/packages/47/89/6fcd0b959ffe5997cb2efc8bddbd7e1e20f82adc3a3cc60e339636a4fd54/pygrin-0.5.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-22 17:09:29",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "scottprahl",
    "github_project": "pygrin",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "pygrin"
}
        
Elapsed time: 0.43656s