{ "info": { "author": "Indranil Sinharoy", "author_email": "indranil_leo@yahoo.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Win32 (MS Windows)", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: Microsoft :: Windows :: Windows 7", "Operating System :: Microsoft :: Windows :: Windows XP", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Topic :: Scientific/Engineering" ], "description": ".. image:: https://raw.githubusercontent.com/indranilsinharoy/PyZDDE/master/Doc/Images/logo_text_small.png\n\n\nPython Zemax Dynamic Data Exchange\n-----------------------------------\n\n|DOI|\n\nCurrent revision\n'''''''''''''''''\n\n2.0.3 (Last significant update on 10/02/2016)\n\n\n\nChange log\n~~~~~~~~~~\nBrief change-log is available in the `News and\nUpdates `__\npage.\n\n\nExamples\n''''''''\n\nExamples included with PyZDDE are in the folder \"Examples\". Please move the examples to your desired location after extracting the PyZDDE package. \n\n\nHello world\n~~~~~~~~~~~\n\nHere is a simple but complete \"Hello world\" code which prints the version of Zemax. (If you are using Python 2.x, don't forget to add\n``from __future__ import print_function`` before these lines.)\n\n.. code:: python\n\n import pyzdde.zdde as pyz\n ln = pyz.createLink() # DDE link object\n print(\"Hello Zemax version: \", ln.zGetVersion())\n ln.close()\n\nMore examples (view online)\n^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nA gallery of notebooks demonstrating the use of PyZDDE within Jupyter (previously IPython) notebooks \nare `here `__.\n\nExamples of using Zemax interactively from a Python shell is `here `_.\n\nExample Python scripts are\n`here `__.\n\nExamples specific to array ray tracing are catalogued\n`here `__.\n\nIn addition, the repository\n`Intro2LensDesignByGeary `__\ncontains notes from few chapters of the book \"Introduction to Lens\nDesign,\" by Joseph M. Geary, in the form of IPython notebooks.\n\n\nInstall PyZDDE from PyPI\n''''''''''''''''''''''''\n\nYou can either use `pip `__ or the ``setup.py`` script \nfrom the extracted folder.\n\nUse the following command from the command line to install PyZDDE from PyPI:\n\n.. code:: python\n\n pip install pyzdde\n\n\nNote 1. By default only the latest stable version is installed by default, using\nthe above command. To install pre-release versions add the \n`--pre `__\nflag:\n\n.. code:: python\n \n pip install pyzdde --pre \n\n\nNote 2. When you install PyZDDE using pip (the above method), the \"Examples\" folder \nwill not be downloaded. However, pip is the most convenient way to install Python packages.\nAlso, ensure that you have the `pip` package in your environment. \n\nIf you would like to download the \"Examples\" folder too, please download and extract PyZDDE \npackage from the `Python Package Index `__. Then, \n``cd`` into the extracted folder where the ``setup.py`` script is visible and execute \nthe following in a command prompt:\n\n.. code:: python\n\n python setup.py install\n\nIf you would like to see what files were added and where you may use:\n\n.. code:: python\n\n python setup.py install --record files.txt\n\nA list of all files that were added and their locations will be available in the \nfile \"files.txt\" in the same directory. \n\nNote 3. To uninstall pyzdde using pip use\n\n.. code:: python\n\n pip uninstall pyzdde\n\n\nGet the latest code\n'''''''''''''''''''\n\nTo get the latest PyZDDE code please download / fork / clone from \n`GitHub repository `__.\n\n\nDocumentation\n'''''''''''''\n\nThe PyZDDE documentation is currently hosted in the `GitHub Wiki `__.\n\n\nInitial setup\n'''''''''''''\n\n1. **PUSH LENS PERMISSION:** All operations through the DDE affect the lens in the DDE server (except for array ray tracing). In order to copy the lens from the DDE server to the Zemax application /LDE, you need to \"push\" the lens from the server to the LDE. To do so, please enable the option \"Allow Extensions to Push Lenses\", under File->Preferences->Editors tab.\n2. **ANSI/UNICODE TEXT ENCODING:** PyZDDE supports both ANSI and UNICODE text from Zemax. Please set the appropriate text encoding in PyZDDE by calling module function `pyz.setTextEncoding(text_encoding)` (assuming that PyZDDE was imported as `import pyzdde.zdde as pyz`). By default, UNICODE text encoding is set in PyZDDE. You can check the current text encoding by calling `pyz.getTextEncoding()` function. Please note that you need to do this only when you change the text setting in Zemax and not for every session.\n3. **PURE NSC MODE:** (This is more of a note) If want to work on an optical design in pure NSC mode, please start ZEMAX in pure NSC mode before initiating the communication with PyZDDE. There is no way to switch the ZEMAX mode using external interfaces.\n\n\n**ZPL macros files supplied with PyZDDE**\n\nPyZDDE comes with few ZPL macro files that are present in the directory \"ZPLMacros\". They are occasionally used by PyZDDE (for example in the function ``ipzCaptureWindowLQ()``). Please copy/move the files from the folder \"ZPLMacros\" to the folder where Zemax/ Optic studio expects to find ZPL macros (By default, this folder is ``C:\\\\Documents\\ZEMAX\\Macros``). A copy of the \"ZPLMacros\" folder is always available in (installed with) the PyZDDE package.\n\n\nModules in PyZDDE\n'''''''''''''''''\n\n- **zdde** (``import pyzdde.zdde as pyz``): The main module in PyZDDE that provides all dataitems related functions for interacting with Zemax/OpticStudio using the DDE interface.\n- **arraytrace** (``import pyzdde.arraytrace as at``): provides functions for tracing large number of rays\n- **zfileutils** (``import pyzdde.zfileutils as zfu``): provides helper functions for various Zemax file handling operations such as reading and writing beam files, .ZRD files, creating .DAT and .GRD files for grid phase /grid sag surfaces, etc.\n- **systems** (``import pyzdde.systems as osys``): provides helper functions for quickly creating basic optical systems.\n- **misc** (``import pyzdde.misc as mys``): contains miscellaneous collection of utility functions that may be used with PyZDDE.\n\nFeatures\n~~~~~~~~\n\n- Functions for using all \"data items\" defined in Zemax manual\n- Supports both Python 2.7 and Python 3.3/3.4\n- Supports both Unicode and extended ascii text\n- Over 80 additional functions for more efficient use (more will be added in future). Examples include ``zSetTimeout()``,\n ``zExecuteZPLMacro()``, ``zGetSeidelAberration()``, ``zSetFieldTuple()``,\n ``zGetFieldTuple()``, ``zSetWaveTuple()``, ``zGetWaveTuple()``, ``zCalculateHiatus()``, ``zGetPupilMagnification()``, ``zGetPOP()``,\n ``zSetPOPSettings()``, ``zModifyPOPSettings()``, ``zGetPSF()``, ``zGetPSFCrossSec()``, ``zGetMTF()``, ``zGetImageSimulation()``.\n A list of the additional functions are available `here `__.\n- Special functions for better interactive use with IPython notebooks.\n Examples include ``ipzCaptureWindow()``, ``ipzGetFirst()``, ``ipzGetPupil()``, ``ipzGetSystemAper()``, ``ipzGetTextWindow()``\n- Quick generation of few simple optical systems (see ``pyzdde.systems`` module)\n- Array ray tracing using a separate and standalone module ``arraytrace`` along with helper functions for performing array ray tracing.\n\nOverview\n~~~~~~~~\n\nPyZDDE is a Python-based extension for communicating with `ZEMAX/OpticStudio `__ using the DDE\nprotocol. It is similar to---and very much inspired by---the Matlab-based `MZDDE toolbox `__ developed by Derek Griffith at CSIR.\n\nPyZDDE can be used with regular Python scripts as well as in an interactive environment such as an IPython shell, \n`QtConsole `__ or `IPython Notebook `__.\n\nThere are 4 types of functions, and a separate module for array ray tracing in the toolbox:\n\n1. Functions for accessing ZEMAX using the data items defined in the \"ZEMAX EXTENSIONS\" chapter of the ZEMAX manual. These functions'\n names start with \"z\" and the rest of the function names matches the data item defined by Zemax. For example ``zGetSolve()`` for the data\n item \"GetSolve\", ``zSetSolve()`` for the data item \"SetSolve\", etc.\n2. Helper functions to enhance the toolbox functionality beyond just the data items, such as ``zCalculateHiatus``, ``zSpiralSpot``. Also,\n there are other utilities which increase the capability of the toolbox such as ``zOptimize2()``, ``zSetWaveTuple()``,\n ``zExecuteZPLMacro()``, etc.\n3. Few functions such as ``ipzCaptureWindow()``, ``ipzGetTextWindow()`` can be used to embed analysis/graphic windows and text files from\n Zemax into an IPython Notebook or IPython QtConsole.\n4. There are several other functions which can be used independent of a running Zemax session. Examples include ``showZOperandList()``,\n ``findZOperand()``, ``findZButtonCode()``, etc.\n5. A separate and standalone module ``arraytrace`` for performing array ray tracing.\n\nAll the functions prefixed with \"z\" or \"ipz\" (types 1, 2 and 3) interact with Zemax directly and hence require a Zemax session to be running\nsimultaneously. As they are instance methods of a pyzdde channel object, a pyzdde object needs to be created.\n\nFor example:\n\n.. code:: python\n\n import pyzdde.zdde as pyz # import pyzdde module\n ln = pyz.createLink() # create DDE link object\n ln.zPushLens(1) # method of type 1\n ln.zExecuteZPLMacro('CEN') # method of type 2\n ln.ipzCaptureWindow2('Lay') # method of type 3\n\nHelper functions of type 4 can be accessed from the ``zdde`` module directly.\n\nFor example\n\n.. code:: python\n\n pyz.zo.findZOperand(\"decenter\") # method of type 4 (same as pyz.findZOperand)\n pyz.numAper(0.25) # method of type 4\n\nA complete list of helper functions is available\n`here `__.\n(Please be mindful that the currently this page is not updated at the same rate at which functions are getting added)\n\n\nGetting started, usage, and other documentation\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nGetting started with PyZDDE is really very simple as shown in the \"Hello world\" program above. Please refer to the `Wiki page `__. It has detailed guide on how to start using PyZDDE.\n\nDependencies\n''''''''''''\n\nThe core PyZDDE library only depends on the standard Python Library. \n\n1. Python 2.7 / Python 3.3 and above; 32/64 bit version\n2. Matplotlib (optional, used in some of the example programs)\n\nLicense\n'''''''\n\nThe code is under the `MIT License `__.\n\n\nContributions and credits\n'''''''''''''''''''''''''\n\nYou are encouraged to use, provide feedbacks and contribute to the PyZDDE project. The generous people who have contributed to PyZDDE are\nin `Contributors `__. Thanks a lot to all of you.\n\nOther projects that are using PyZDDE are listed `here `__.\n\n\nCiting\n''''''\n\nIf you use PyZDDE for research work, please consider citing it. Various\ncitation styles for PyZDDE are available from\n`zenodo `__.\n\nChat room\n''''''''''\n\n|Gitter chat|\n\n.. |DOI| image:: https://zenodo.org/badge/doi/10.5281/zenodo.44295.svg\n :target: http://dx.doi.org/10.5281/zenodo.44295\n.. |Gitter chat| image:: https://badges.gitter.im/indranilsinharoy/PyZDDE.png\n :target: https://gitter.im/indranilsinharoy/PyZDDE", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/indranilsinharoy/PyZDDE", "keywords": "zemax opticstudio extensions dde optics", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "PyZDDE", "package_url": "https://pypi.org/project/PyZDDE/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/PyZDDE/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/indranilsinharoy/PyZDDE" }, "release_url": "https://pypi.org/project/PyZDDE/2.0.3/", "requires_dist": null, "requires_python": null, "summary": "Zemax / OpticStudio standalone extension using Python", "version": "2.0.3" }, "last_serial": 2376786, "releases": { "1.1.1": [ { "comment_text": "", "digests": { "md5": "584ae361552e9c05e2d677e1dcffd2f6", "sha256": "040cd6ad1219b14cab619859a36c9c9848b66efb4cef5ed921cf5f078cef54e3" }, "downloads": -1, "filename": "PyZDDE-1.1.1.zip", "has_sig": false, "md5_digest": "584ae361552e9c05e2d677e1dcffd2f6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4221241, "upload_time": "2015-06-19T05:14:36", "url": "https://files.pythonhosted.org/packages/d8/dc/937871166109080ab40537b98ff1ba4dc593ba5d0c3d1c41bcebd7a46df1/PyZDDE-1.1.1.zip" } ], "2.0.0": [ { "comment_text": "", "digests": { "md5": "eb2b2b394585399a0995c391b523f16e", "sha256": "36a42391d8290c1975a779951a332e9429d0ef09e31879533c4741aefcdfe3db" }, "downloads": -1, "filename": "PyZDDE-2.0.0.zip", "has_sig": false, "md5_digest": "eb2b2b394585399a0995c391b523f16e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4230779, "upload_time": "2015-09-01T06:07:34", "url": "https://files.pythonhosted.org/packages/48/7e/379195e13276b7a37f23942055ba16ceafdeefa35c0eb7f470b695a97dd5/PyZDDE-2.0.0.zip" } ], "2.0.0a1": [ { "comment_text": "", "digests": { "md5": "4227ce025d28ad8d2da36ad3664979a0", "sha256": "d6086f3c5fd6fbd95145d646cf2b3b06c62606fb6203e1f1d58e28d84864a8f5" }, "downloads": -1, "filename": "PyZDDE-2.0.0a1.zip", "has_sig": false, "md5_digest": "4227ce025d28ad8d2da36ad3664979a0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4230629, "upload_time": "2015-07-27T04:59:18", "url": "https://files.pythonhosted.org/packages/84/6f/bfb829086638ec23740788be15d2f00496c4682fe1f666baa5a2cc04764c/PyZDDE-2.0.0a1.zip" } ], "2.0.1": [ { "comment_text": "", "digests": { "md5": "bd80b4f372a8fe07fc8cecba284f930c", "sha256": "14c84b4e2de817fa0489198370f40da556767d2978fd0befefe5daad0522ac36" }, "downloads": -1, "filename": "PyZDDE-2.0.1.zip", "has_sig": false, "md5_digest": "bd80b4f372a8fe07fc8cecba284f930c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4230722, "upload_time": "2015-09-01T06:54:01", "url": "https://files.pythonhosted.org/packages/c4/4e/31a294005a8093f1df6165014b3033a65f2a5736c78cd8a93e4ae80554e3/PyZDDE-2.0.1.zip" } ], "2.0.2": [ { "comment_text": "", "digests": { "md5": "56f38afb8f2b1522a3c70b83cea7182d", "sha256": "69e6d8f83c573c73c487ab36703dafd8ff1e4dc65213d4d90155f18caf86f82d" }, "downloads": -1, "filename": "PyZDDE-2.0.2.zip", "has_sig": false, "md5_digest": "56f38afb8f2b1522a3c70b83cea7182d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7892644, "upload_time": "2016-01-04T05:49:08", "url": "https://files.pythonhosted.org/packages/82/90/b0446351a6cbe9aeff10c8f43719634b0fab28d0fcef451ab0f6e201aaa5/PyZDDE-2.0.2.zip" } ], "2.0.2a0": [ { "comment_text": "", "digests": { "md5": "1c4f97401f08f7a75546eef59cc53d29", "sha256": "c8154c6d2b18af8adcb52be3c22b9b7ef32c46bebdca9c7c4d67896691777fc7" }, "downloads": -1, "filename": "PyZDDE-2.0.2a0.zip", "has_sig": false, "md5_digest": "1c4f97401f08f7a75546eef59cc53d29", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7892794, "upload_time": "2016-01-01T08:44:52", "url": "https://files.pythonhosted.org/packages/fd/a5/ce23e1a84b009385af56912c66bc850ade5bfa65fc95c067194a5697014f/PyZDDE-2.0.2a0.zip" } ], "2.0.3": [ { "comment_text": "", "digests": { "md5": "2fc45ac887057b3ff37eb82bcf038658", "sha256": "cd6f2af0630f9c5b640f88b90d4344d511b055db60b727b02f7e97b87f143d62" }, "downloads": -1, "filename": "PyZDDE-2.0.3.zip", "has_sig": false, "md5_digest": "2fc45ac887057b3ff37eb82bcf038658", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7902979, "upload_time": "2016-10-03T02:35:26", "url": "https://files.pythonhosted.org/packages/b6/0a/c34e018dd660c7432eccd4de07cf59b2cd7ab3ec262f4f4720e23671a481/PyZDDE-2.0.3.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2fc45ac887057b3ff37eb82bcf038658", "sha256": "cd6f2af0630f9c5b640f88b90d4344d511b055db60b727b02f7e97b87f143d62" }, "downloads": -1, "filename": "PyZDDE-2.0.3.zip", "has_sig": false, "md5_digest": "2fc45ac887057b3ff37eb82bcf038658", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7902979, "upload_time": "2016-10-03T02:35:26", "url": "https://files.pythonhosted.org/packages/b6/0a/c34e018dd660c7432eccd4de07cf59b2cd7ab3ec262f4f4720e23671a481/PyZDDE-2.0.3.zip" } ] }