{ "info": { "author": "Michael Hirsch, Ph.D.", "author_email": "scivision@users.noreply.github.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Framework :: AsyncIO", "Intended Audience :: Science/Research", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Topic :: Scientific/Engineering :: Atmospheric Science" ], "description": "[![Zenodo DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.215309.svg)](https://doi.org/10.5281/zenodo.215309)\n\n[![Build Status](https://travis-ci.com/space-physics/themisasi.svg?branch=master)](https://travis-ci.com/space-physics/themisasi)\n[![Coverage Status](https://coveralls.io/repos/github/space-physics/themisasi/badge.svg?branch=master)](https://coveralls.io/github/space-physics/themisasi?branch=master)\n[![Build status](https://ci.appveyor.com/api/projects/status/9wakqphkwx8620r8?svg=true)](https://ci.appveyor.com/project/scivision/themisasi-sld7t)\n[![pypi versions](https://img.shields.io/pypi/pyversions/themisasi.svg)](https://pypi.python.org/pypi/themisasi)\n[![PyPi Download stats](http://pepy.tech/badge/themisasi)](http://pepy.tech/project/themisasi)\n\n\n# THEMIS GBO ASI Reader\n\n\nRead & plot 256x256 \"high resolution\" THEMIS ASI ground-based imager data from Python.\nTHEMIS ASI data are collected with the original 2002 design, using Starlight-Xpress Lodestar MX716 cameras with monochrome\n[Sony ICX249AL imaging chips](http://www.astro.uu.se/grundutb/wt/images/ICX249ALpalstcamex.pdf).\nA subregion from full-size 752 x 582 pixels (512 x 512 pixels) are 2x2 binned to 256 x 256 pixels and retrieved over USB 1.1 for disk storage.\n\nThis package also reads the THEMIS ASI star registered\n[plate scale](http://data.phys.ucalgary.ca/sort_by_project/THEMIS/asi/skymaps/new_style/),\ngiving **azimuth and elevation** for each pixel.\n\n## Install\n\n1. install `cdflib`, which only uses Numpy to read CDF:\n ```sh\n pip install -r requirements.txt\n ```\n2. install this program\n ```sh\n pip install -e .\n ```\n\nYou can test the basic functionality by from the top `cdflib` directory:\n```sh\npytest\n```\n\n## Usage\nOne of the main ways analysts might use THEMIS-ASI data is by loading it into a 3-D array (time, x, y).\n\n### Single time\nThis example is where the ASI video files are in `~/data/themis`, and the Gakona site is selected at the time shown.\n```python\nimport themisasi as ta\n\ndat = ta.load('~/data/themis', site='gako', treq='2011-01-06T17:00:03')\n```\nThis returns the camera image from Gakona camera closest to the requested time, and the 'az', 'el' calibration data, if available.\n\n\nTHEMIS-ASI output [xarray.Dataset](http://xarray.pydata.org/en/stable/generated/xarray.Dataset.html),\nwhich is used throughout geosciences and astronomy.\nXarray may be thought of as a \"smart\" Numpy array, or a multidimensional Pandas array.\nA THEMIS image data stack is obtained by:\n```python\ndat = ta.load(...)\n\nimgs = dat['imgs']\n```\n\n* `dat.time` contains the approximate time of each image (consider the finite exposure time).\n* `dat.x` and `dat.y` are simple pixel indices, perhaps not often needed.\n\n### Image + Azimuth, Elevation\nLoading calibration data gives azimuth, elevation for each pixel and lat, lon of each camera.\n```python\nimport themisasi as ta\n\ndat = ta.load('~/data/themis', site='gako', treq='2011-01-06T17:00:03')\n```\nIf an appropriate calibration file exists, `dat` additionally contains 'az', 'el', 'lat', 'lon' and so on to allow using data for multi-camera analyses.\n\n### Coordinate conversion (optional)\n\nIf desired, convert azimuth/elevation to ra/dec using\n[pymap3d](https://github.com/scivision/pymap3d).\n```sh\npip install pymap3d\n```\nand then from within Python:\n```python\nimport pymap3d as pm\n\nrasc, decl = pm.azel2radec(dat.az, dat.el, dat.lat, dat.lon, dat.time)\n```\n\n\n## Download, Read and Plot THEMIS ASI Data\n\nThe data is downloaded concurrently using `asyncio` and `aiohttp_requests`.\nThere is one concurrent worker launched per site, that downloads one time at a time concurrently across sites.\nThus if downloading for one site, one time downloads at a time.\nIf downloading for 5 sites, five files download at a time across requested times by site.\n\nGet video data from Themis all-sky imager\n[data repository](http://themis.ssl.berkeley.edu/data/themis/thg/l1/asi/).\nThe\n[plate scale](http://themis.ssl.berkeley.edu/themisdata/thg/l2/asi/cal/)\ndata is also downloaded.\nThe calibration files are named `*asc*.cdf` or `*skymap*.sav`.\n\nExample: February 4, 2012, 8 UT Gakona\n\n```sh\nDownloadThemis 2012-02-04T08 gako ~/data\n```\nor via the API:\n```python\nimport themisasi as ta\n\nta.download('2012-02-04T08', 'gako', '~/data')\n```\nwith the API, it is convenient to for-loop over many sites at the same time(s):\n```python\nsites = ['fykn', 'gako']\n\nfor site in sites:\n ta.download('2012-02-04T08', site, '~/data')\n```\n\n\nWith the calibration data, verify that the time range of the calibration data is appropriate for the time range of the image data.\nFor example, calibration data from 1999 may not be valid for 2018 if the camera was ever moved in the enclosure during maintanence.https://github.com/dib-lab/khmer/pull/1430\n\nYou can optionally download from within Python:\n```python\nimport themisasi as ta\n\nta.download('2012-03-12T12', 'fykn', '~/data')\n```\n\n### get times in a file\nthe convenience function `themisasi.io.filetimes(filename)` returns a list of Python `datetime` in a file\n\n### Video Playback / PNG conversion\n\nThis example plays the video content.\n\nUse the `-o` option to dump the frames to individual PNGs for easier back-and-forth viewing.\nThe calibration file (second filename) is optional.\n```sh\nPlotThemis ~/data/themis/thg_l1_asf_fykn_2013041408_v01.cdf\n```\n\n### Plot time series of pixel(s)\nAgain, be sure the calibration file is appropriate for the time range of the video--the camera may have been moved / reoriented during maintenance.\n\nThe pixels can be specified by (azimuth, elevation) or (lat, lon, projection altitude [km])\n\nAzimuth / Elevation:\n```sh\nPlotThemisPixels tests/thg_l1_ast_gako_20110505_v01.cdf -az 65 70 -el 48 68\n```\n\nLatitude, Longitude, Projection Altitude [kilometers]:\nTypically the brightest aurora is in the 100-110 km altitude range, so a common approximate is to assume \"all\" of the brightness comes from a single altitude in this region.\n```sh\nPlotThemisPixels tests/thg_l1_ast_gako_20110505_v01.cdf -lla 65 -145 100.\n```\n\n## Notes\n\nThemis site map (2009)\n\n[![Themis site map](http://themis.ssl.berkeley.edu/data/themis/events/THEMIS_GBO_Station_Map-2009-01.gif)](http://themis.ssl.berkeley.edu/gbo/display.py?)\n\nTHEMIS GBO ASI spectral response:\n\n![Themis spectral response](./data/spectral_response.png)\n\n### Articles\n\nThese articles give vital descriptions of THEMIS GBO ASI.\n\n* [Mende 2008 SSR](http://www.igpp.ucla.edu/public/THEMIS/SCI/Pubs/2008_Refereed/mende_ssr_onlinefirst.pdf)\n* color instrument based on Themis: [Jackel 2014](http://eprints.lancs.ac.uk/68180/4/gi_3_71_2014.pdf)\n\n\n### Resources\n\n- Themis GBO ASI\n [site coordinates](http://themis.ssl.berkeley.edu/images/ASI/THEMIS_ASI_Station_List_Nov_2011.xls)\n- THEMIS GBO ASI\n [plate scale](http://data.phys.ucalgary.ca/sort_by_project/THEMIS/asi/skymaps/new_style/)\n- THEMIS GBO ASI\n [plate scale](http://themis.ssl.berkeley.edu/themisdata/thg/l2/asi/cal/)\n- Themis GBO ASI\n [data repository](http://themis.ssl.berkeley.edu/data/themis/thg/l1/asi/)\n- Themis GBO ASI\n [mosaic (all sites together)](http://themis.ssl.berkeley.edu/gbo/display.py?)\n\n\n\n### Matlab\n\nThe Matlab code is obsolete, the Python version has so much more:\n```matlab\nreadTHEMIS('thg_l1_asf_fykn_2013041408_v01.cdf')\n```\n### data corruption\n\nI discovered that IDL 8.0 had a problem saving structured arrays of bytes.\nWhile current versions of IDL can read these corrupted .sav files, GDL 0.9.4 and SciPy 0.16.1 cannot.\nI submitted a\n[patch to SciPy](https://github.com/scipy/scipy/pull/5801)\nto allow reading these files, which was incorporated into SciPy 0.18.0.\n\nAs a fallback, read and rewrite the corrupted file with the IDL script in the\n[idl](idl/)\ndirectory.", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/space-physics/themisasi", "keywords": "all-sky-camera,aurora", "license": "", "maintainer": "", "maintainer_email": "", "name": "themisasi", "package_url": "https://pypi.org/project/themisasi/", "platform": "", "project_url": "https://pypi.org/project/themisasi/", "project_urls": { "Homepage": "https://github.com/space-physics/themisasi" }, "release_url": "https://pypi.org/project/themisasi/1.0.0/", "requires_dist": null, "requires_python": ">= 3.6", "summary": "reads and plots THEMIS ASI video data of aurora.", "version": "1.0.0" }, "last_serial": 5412634, "releases": { "0.7.0": [ { "comment_text": "", "digests": { "md5": "e69d1e11f41f1507967d8440023e8a3f", "sha256": "ab719eb5479f5b20dd43497a9eb5c0e62ab28d5b99b3389087bb63e8af93c78c" }, "downloads": -1, "filename": "themisasi-0.7.0-py3-none-any.whl", "has_sig": false, "md5_digest": "e69d1e11f41f1507967d8440023e8a3f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 12968, "upload_time": "2018-06-21T01:02:49", "url": "https://files.pythonhosted.org/packages/42/58/f34eac3a294a5b38b248af30ef7ed11a3dbd3abfcf8fe8b41a86d35bcf94/themisasi-0.7.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "48612a1ae08c40646ee191015d4b4887", "sha256": "54fbdec0741baffdb3fa09f153127028013eef45a7aface9007dc6c26da13cb3" }, "downloads": -1, "filename": "themisasi-0.7.0.tar.gz", "has_sig": false, "md5_digest": "48612a1ae08c40646ee191015d4b4887", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 10688, "upload_time": "2018-06-21T01:02:51", "url": "https://files.pythonhosted.org/packages/6e/d7/a533ba516d6e3598f15381cf22dcae400c491a187fbd419ddfdde78081da/themisasi-0.7.0.tar.gz" } ], "0.7.1": [ { "comment_text": "", "digests": { "md5": "a95ba400c0ec82f2e63192badaf30b3a", "sha256": "259289bc95decbd196fb7925f09f0a78dea679108b4dc7865bb3481c14e549a9" }, "downloads": -1, "filename": "themisasi-0.7.1.tar.gz", "has_sig": false, "md5_digest": "a95ba400c0ec82f2e63192badaf30b3a", "packagetype": "sdist", "python_version": "source", "requires_python": ">= 3.6", "size": 10972, "upload_time": "2018-07-09T20:15:50", "url": "https://files.pythonhosted.org/packages/7d/ff/0c09877473b4c0cbde3499d7ac98b1a93a34710612b933c64e15465bc0b7/themisasi-0.7.1.tar.gz" } ], "0.7.2": [ { "comment_text": "", "digests": { "md5": "fa346c88fbd3ca788abd1589dcadcaf4", "sha256": "604005da017215be2383b4f4278e65b91886dd6aa199c1925c213d4e5315cba6" }, "downloads": -1, "filename": "themisasi-0.7.2.tar.gz", "has_sig": false, "md5_digest": "fa346c88fbd3ca788abd1589dcadcaf4", "packagetype": "sdist", "python_version": "source", "requires_python": ">= 3.6", "size": 13407, "upload_time": "2018-07-10T21:30:47", "url": "https://files.pythonhosted.org/packages/24/76/d6de1426894a5646e3e9da01fdc70e3d8e22aa3677e7574975ac9ff87ea4/themisasi-0.7.2.tar.gz" } ], "0.8.0": [ { "comment_text": "", "digests": { "md5": "e07d547f0abe27c6e7bd8fa15ab9b9b6", "sha256": "331c5cfd833f9754fc8410911edf775817df3a63f044c5a975378e868447fec9" }, "downloads": -1, "filename": "themisasi-0.8.0.tar.gz", "has_sig": false, "md5_digest": "e07d547f0abe27c6e7bd8fa15ab9b9b6", "packagetype": "sdist", "python_version": "source", "requires_python": ">= 3.6", "size": 18344, "upload_time": "2018-08-07T19:44:29", "url": "https://files.pythonhosted.org/packages/93/9a/1fec7c8677949eac1081e6b7ba0cc9480cdbc41fbdb61bc29c2e4cf9ec3f/themisasi-0.8.0.tar.gz" } ], "0.8.1": [ { "comment_text": "", "digests": { "md5": "da87db935e3d14593b2958dbe76e1eac", "sha256": "36f5d023c7a82d4006db1ce667208e67484b710eccaa36920eee72ed7cfcf7da" }, "downloads": -1, "filename": "themisasi-0.8.1.tar.gz", "has_sig": false, "md5_digest": "da87db935e3d14593b2958dbe76e1eac", "packagetype": "sdist", "python_version": "source", "requires_python": ">= 3.6", "size": 18413, "upload_time": "2018-08-29T22:36:35", "url": "https://files.pythonhosted.org/packages/31/e9/b45d340f0249762c173ac0ac37f2ffe3bb60e9744860a3f2c094c3819a10/themisasi-0.8.1.tar.gz" } ], "0.8.2": [ { "comment_text": "", "digests": { "md5": "2767b5ff92ea910ee1e62e74b5f6e9fd", "sha256": "f7a3a156d355b62643dfcc5290ec570a732f2c04e4f10955530cfd46e0eca894" }, "downloads": -1, "filename": "themisasi-0.8.2.tar.gz", "has_sig": false, "md5_digest": "2767b5ff92ea910ee1e62e74b5f6e9fd", "packagetype": "sdist", "python_version": "source", "requires_python": ">= 3.5", "size": 21497, "upload_time": "2018-09-05T21:31:28", "url": "https://files.pythonhosted.org/packages/69/18/05b4cd8d724b00e555558b79edd6aa7c44c58e41d54f1fe0a58eef8a3360/themisasi-0.8.2.tar.gz" } ], "0.8.3": [ { "comment_text": "", "digests": { "md5": "4f27af26a8fa5410ed25083ceb16ebd2", "sha256": "2de01af4e7f388a056f3ca44b3b4ab5d1f28667f81b05688fb951613dbd9f042" }, "downloads": -1, "filename": "themisasi-0.8.3.tar.gz", "has_sig": false, "md5_digest": "4f27af26a8fa5410ed25083ceb16ebd2", "packagetype": "sdist", "python_version": "source", "requires_python": ">= 3.6", "size": 20460, "upload_time": "2018-09-14T19:26:27", "url": "https://files.pythonhosted.org/packages/4a/62/a5c0730780226d367180a4853cbd845c70b7ae97b5fa438a34724441e973/themisasi-0.8.3.tar.gz" } ], "0.8.3.1": [ { "comment_text": "", "digests": { "md5": "befcc56d206d03d6610fddebf80b5fce", "sha256": "55a884a32d945e58f849fa7f4d649e3571395dc77e51a9ffebdc8b76655bed36" }, "downloads": -1, "filename": "themisasi-0.8.3.1.tar.gz", "has_sig": false, "md5_digest": "befcc56d206d03d6610fddebf80b5fce", "packagetype": "sdist", "python_version": "source", "requires_python": ">= 3.6", "size": 20497, "upload_time": "2018-09-14T20:47:19", "url": "https://files.pythonhosted.org/packages/d3/be/9059379567b8be272739e66da2ca20c44100db30aa3018eec3223e6eaeeb/themisasi-0.8.3.1.tar.gz" } ], "0.8.4": [ { "comment_text": "", "digests": { "md5": "3d14362d1c9bc72865afe22fd59b9669", "sha256": "6c82eda87e3be82e66f99c07981f39056b9da951e85866f444dee9ebf7d992eb" }, "downloads": -1, "filename": "themisasi-0.8.4.tar.gz", "has_sig": false, "md5_digest": "3d14362d1c9bc72865afe22fd59b9669", "packagetype": "sdist", "python_version": "source", "requires_python": ">= 3.6", "size": 23775, "upload_time": "2018-12-31T18:46:44", "url": "https://files.pythonhosted.org/packages/48/b3/f37af0769377bc1621c8253dccc61a72260c4239d1ffc48535b619cea69c/themisasi-0.8.4.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "18333c743ffbf5b9d7a89dc4fa6a54e7", "sha256": "3a01b3aed6eda7c4fc1c16fb525be8a9ce5c669a5dd870a3417eb405bb9494e8" }, "downloads": -1, "filename": "themisasi-1.0.0.tar.gz", "has_sig": false, "md5_digest": "18333c743ffbf5b9d7a89dc4fa6a54e7", "packagetype": "sdist", "python_version": "source", "requires_python": ">= 3.6", "size": 25151, "upload_time": "2019-06-17T23:59:30", "url": "https://files.pythonhosted.org/packages/e6/2a/99ccfd65918245dd59b3993d2a24ce0163f1d8be2ae93da760c5c18f2a0f/themisasi-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "18333c743ffbf5b9d7a89dc4fa6a54e7", "sha256": "3a01b3aed6eda7c4fc1c16fb525be8a9ce5c669a5dd870a3417eb405bb9494e8" }, "downloads": -1, "filename": "themisasi-1.0.0.tar.gz", "has_sig": false, "md5_digest": "18333c743ffbf5b9d7a89dc4fa6a54e7", "packagetype": "sdist", "python_version": "source", "requires_python": ">= 3.6", "size": 25151, "upload_time": "2019-06-17T23:59:30", "url": "https://files.pythonhosted.org/packages/e6/2a/99ccfd65918245dd59b3993d2a24ce0163f1d8be2ae93da760c5c18f2a0f/themisasi-1.0.0.tar.gz" } ] }