{ "info": { "author": "Alex Hirsch (Zia Lab)", "author_email": "alexander_hirsch@brown.edu", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3 :: Only" ], "description": "# spe2py\n\nspe2py is a module that imports a Princeton Instruments LightField (SPE 3.x) file into a python environment. \n\n### Basic Usage\n##### Modules\nThe `spe2py` module is designed for quick data loading, viewing, and exploration. It is most effective for quick access\nto .spe files via a graphical file dialog, and incorporates tooling functionality to view images and plots with as\nlittle typing as possible.\n\nThe `spe_loader` module is responsible for the pure .spe file loading functionality, and can (and should) be imported\nseparately when only lightweight, programmatic loading is necessary.\n\n##### Loading and accessing data\nUse the `load()` function to load one or more SPE files at a time into a set of tools:\n```python\n>>> import spe2py as spe\n>>> spe_tools = spe.load()\n```\nA file selection window will open to allow browsing for source files. The result is an individual SpeTool object, or, in the case where multiple files are loaded at once, a list of SpeTool objects.\n\nAlternatively programmatic loading should be done with with the `spe_loader` module:\n```python\n>>> import spe_loader as sl\n>>> spe_files = sl.load_from_files(['path/to/file1', 'path/to/file2'])\n```\nThe result is an individual SpeFile object, or, in the case where multiple files are loaded at once, a list of SpeFile objects.\n\nRaw data from a file is stored in NumPy arrays and can be accessed directly by\n```python\n>>> frame_data = spe_tool.file.data[frame][regionOfInterest]\n>>> frame_data = spe_tools[n].file.data[frame][regionOfInterest] # where multiple files are loaded\n```\nor when using the pure loader module:\n```python\n>>> frame_data = spe_file.data[frame][regionOfInterest]\n>>> frame_data = spe_files[n].data[frame][regionOfInterest] # where multiple files are loaded\n```\n\n##### Automatic imaging and plotting (spe2py tools only)\nTo quickly view an individual frame, region-of-interest, or spectrum, use the `image()` or `specplot()` methods. For example,\n```python\n>>> spe_tool.image() # images the first frame and region of interest\n>>> spe_tool.image(f, r) # images frame 'f' and region of interest 'r'\n>>> spe_tool.specplot() # plots the loaded spectrum\n```\n\n##### Accessing metadata\nUpon loading, the metadata contained in the file's XML footer is automatically parsed and stored as an `untangle` object in the `footer` variable. Elements and attributes can be accessed by calling the different elements and subelements of footer, ending with the attribute as a string:\n```python\n>>> sensor_height = loaded_file.footer.SpeFormat.Calibrations.SensorInformation['height']\n```\nOne can print the full element tree by calling the `xmltree()` method.\n\n### Dependencies\n - NumPy - data storage and file reading\n - [untangle](https://github.com/stchris/untangle) - XML parsing\n - tkinter - file selection dialog (spe2py tools only)\n - matplotlib - imaging and plotting (spe2py tools only)\n\n### Version\n2.0.0 - Separation of Tooling and Loading functionality\n\n\nLicense\n----\n\nMIT\n\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ashirsch/spe2py", "keywords": "spectroscopy optics imaging data analysis", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "spe2py", "package_url": "https://pypi.org/project/spe2py/", "platform": "", "project_url": "https://pypi.org/project/spe2py/", "project_urls": { "Homepage": "https://github.com/ashirsch/spe2py" }, "release_url": "https://pypi.org/project/spe2py/2.0.0/", "requires_dist": [ "numpy", "matplotlib", "untangle" ], "requires_python": "", "summary": "This module imports a Princeton Instruments LightField (SPE 3.0) file into a python environment.", "version": "2.0.0" }, "last_serial": 3808990, "releases": { "2.0.0": [ { "comment_text": "", "digests": { "md5": "399ca827b166ff40312a3efba4cebfa3", "sha256": "7ba810d21b05fea583c3851b78a53e9e70abb36ae02a7d3d5d3991f17dbb0f33" }, "downloads": -1, "filename": "spe2py-2.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "399ca827b166ff40312a3efba4cebfa3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8805, "upload_time": "2018-04-26T03:59:48", "url": "https://files.pythonhosted.org/packages/0b/bc/fb061b11352191604d3b5ce0012afc749399aebab84f33f07f4b83fda45c/spe2py-2.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7a4bcdd98e5612b13f7a92f86c3b9b00", "sha256": "4df0f06f21bec5062a33b04e41d71000705a2b1de8bd77ad3809d5b3f01e291a" }, "downloads": -1, "filename": "spe2py-2.0.0.tar.gz", "has_sig": false, "md5_digest": "7a4bcdd98e5612b13f7a92f86c3b9b00", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20978, "upload_time": "2018-04-26T03:59:49", "url": "https://files.pythonhosted.org/packages/0a/6e/a03e54abae4d9892aa5c291fd2329cc95cf001c50c19cb639723978fcce3/spe2py-2.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "399ca827b166ff40312a3efba4cebfa3", "sha256": "7ba810d21b05fea583c3851b78a53e9e70abb36ae02a7d3d5d3991f17dbb0f33" }, "downloads": -1, "filename": "spe2py-2.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "399ca827b166ff40312a3efba4cebfa3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8805, "upload_time": "2018-04-26T03:59:48", "url": "https://files.pythonhosted.org/packages/0b/bc/fb061b11352191604d3b5ce0012afc749399aebab84f33f07f4b83fda45c/spe2py-2.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7a4bcdd98e5612b13f7a92f86c3b9b00", "sha256": "4df0f06f21bec5062a33b04e41d71000705a2b1de8bd77ad3809d5b3f01e291a" }, "downloads": -1, "filename": "spe2py-2.0.0.tar.gz", "has_sig": false, "md5_digest": "7a4bcdd98e5612b13f7a92f86c3b9b00", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20978, "upload_time": "2018-04-26T03:59:49", "url": "https://files.pythonhosted.org/packages/0a/6e/a03e54abae4d9892aa5c291fd2329cc95cf001c50c19cb639723978fcce3/spe2py-2.0.0.tar.gz" } ] }