{ "info": { "author": "Alexey Isavnin", "author_email": "alexey.isavnin@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3" ], "description": "AI.CDAS: python interface to `CDAS `_ data\n=========================================================================\n\nThis library provides access to CDAS database from python in a simple and fluid way through `CDAS REST api `_. It fetches the data either in `CDF (Common Data Format) `_ or ASCII format and returns it in the form of dictionaries of numpy arrays.\n\nThe full documentation is available at `aicdas.rtfd.io `_.\n\nGetting started\n===============\n\nDependencies\n------------\n\n- Python 3\n- `numpy `_\n- `requests `_\n- `wget `_\n\nExtra dependencies (at least one of the following)\n--------------------------------------------------\n\n- `astropy `_\n- `CDF `_ +\n `spacepy `_\n\nInstallation\n------------\n\nStarting from version 1.2.0 AI.CDAS officially supports only Python 3, so make sure that you have a working isntallation of it.\n\nAssuming the above requirement is satisfied install the package with Python package manager::\n\n $ pip install ai.cs\n\nKnown issues\n------------\n\nNASA CDAS REST API endpoint currently does not support IPv6 addressing. However, newer linux distros (for example, Ubuntu 16.04) are set up to prefer IPv6 addressing over IPv4 by default. This may result in unneeded delays in communication with server and data polling. If you experience the issue it might be that is the case with your system. Here is how it can be cured on Ubuntu 16.04::\n\n $ sudoedit /etc/gai.conf\n # Uncomment the line\n # precedence ::ffff:0:0/96 100\n\nNow you machine will try IPv4 prior to IPv6. For other distros refer to respective docs. \n\nExamples\n--------\n\n**Example 1**: Retrieving observatory groups and associated instruments which measure plasma and solar wind:\n\n.. code-block:: python\n\n from ai import cdas\n import json # for pretty output\n\n obsGroupsAndInstruments = cdas.get_observatory_groups_and_instruments(\n 'istp_public',\n instrumentType='Plasma and Solar Wind'\n )\n print(json.dumps(obsGroupsAndInstruments, indent=4))\n\n**Example 2**: Getting STEREO-A datasets using regular expressions for dataset id and label:\n\n.. code-block:: python\n\n from ai import cdas\n import json # for pretty output\n\n datasets = cdas.get_datasets(\n 'istp_public',\n idPattern='STA.*',\n labelPattern='.*STEREO.*'\n )\n print(json.dumps(datasets, indent=4))\n\n**Example 3**: Fetching a list of variables in one of STEREO datasets:\n\n.. code-block:: python\n\n from ai import cdas\n import json # for pretty output\n\n variables = cdas.get_variables('istp_public', 'STA_L1_MAGB_RTN')\n print(json.dumps(variables, indent=4))\n\n**Example 4**: This snippet of code gets magnetic field data from STEREO-A spacecraft for one hour of 01.01.2010 and plots it (requires matplotlib):\n\n.. code-block:: python\n\n from ai import cdas\n from datetime import datetime\n from matplotlib import pyplot as plt\n\n data = cdas.get_data(\n 'sp_phys',\n 'STA_L1_MAG_RTN',\n datetime(2010, 1, 1),\n datetime(2010, 1, 1, 0, 59, 59),\n ['BFIELD']\n )\n plt.plot(data['EPOCH'], data['BTOTAL'])\n plt.show()\n\n**Example 5**: This snippet of code gets magnetic field data from STEREO-A spacecraft for one hour of 01.01.2010 and plots it (requires matplotlib). The data are downloaded in CDF format in this case. CDF format is binary and results in a much smaller filesize and hence faster downloads. In order for this to work you have to have NASA CDF library on your machine and spacepy installed afterwards:\n\n.. code-block:: python\n\n from ai import cdas\n from datetime import datetime\n from matplotlib import pyplot as plt\n\n data = cdas.get_data(\n 'sp_phys',\n 'STA_L1_MAG_RTN',\n datetime(2010, 1, 1),\n datetime(2010, 1, 1, 0, 59, 59),\n ['BFIELD'],\n cdf=True # download data in CDF format\n )\n # Note that variables identifiers are different than in the previous\n # example. It often the case with CDAS data. You should check the\n # variables names by printing out `data` dictionary.\n plt.plot(data['Epoch'], data['BFIELD'][:, 3])\n plt.show()\n\n**Example 6**: This snippet of code gets magnetic field data from STEREO-A spacecraft for 01.01.2010 and saves it to cache directory. The next time the same data is requested it is taken from cache without downloading:\n\n.. code-block:: python\n\n import os\n from ai import cdas\n from datetime import datetime\n\n # For the sake of example we are using your current working\n # directory as a cache directory\n cache_dir = os.getcwd()\n cdas.set_cache(True, cache_dir)\n # this data is downloaded from CDAS\n data = cdas.get_data(\n 'sp_phys',\n 'STA_L1_MAG_RTN',\n datetime(2010, 1, 1),\n datetime(2010, 1, 1, 0, 59, 59),\n ['BFIELD']\n )\n # this data is taken from cache\n data = cdas.get_data(\n 'sp_phys',\n 'STA_L1_MAG_RTN',\n datetime(2010, 1, 1),\n datetime(2010, 1, 1, 0, 59, 59),\n ['BFIELD']\n )\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/isavnin/ai.cdas", "keywords": "coordinated data analysis web cdaweb cdas spdf research space physics data facility nasa science", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "ai.cdas", "package_url": "https://pypi.org/project/ai.cdas/", "platform": "", "project_url": "https://pypi.org/project/ai.cdas/", "project_urls": { "Homepage": "https://bitbucket.org/isavnin/ai.cdas" }, "release_url": "https://pypi.org/project/ai.cdas/1.2.1/", "requires_dist": [ "numpy", "requests", "wget", "astropy", "spacepy; extra == 'CDF'" ], "requires_python": "", "summary": "Python interface to CDAS data via REST API", "version": "1.2.1" }, "last_serial": 3432375, "releases": { "1.0.0": [], "1.0.1": [ { "comment_text": "", "digests": { "md5": "fa0f47fe83dfe1bd153de6e30bc1bc47", "sha256": "4ebefaeb956bb5eab081f47ed9052e86554af98553dd554dcaaa025a34853f88" }, "downloads": -1, "filename": "ai.cdas-1.0.1-py2-none-any.whl", "has_sig": false, "md5_digest": "fa0f47fe83dfe1bd153de6e30bc1bc47", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 9555, "upload_time": "2015-10-20T09:39:57", "url": "https://files.pythonhosted.org/packages/75/62/94fa33a62f2b0a5bdfd4a38ae5a5bc6c1f6f8ce8bec384ca2f929aa3baea/ai.cdas-1.0.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "76ba89fc49736ee081975dc378499217", "sha256": "740e819ddf80a9cf17908bc1bb5b37f082779cc010a96fa2b500065834298444" }, "downloads": -1, "filename": "ai.cdas-1.0.1.tar.gz", "has_sig": false, "md5_digest": "76ba89fc49736ee081975dc378499217", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7184, "upload_time": "2015-10-20T09:40:11", "url": "https://files.pythonhosted.org/packages/c9/8d/fd00a6114a2c38318d899a2d524b64cf8568e1ad2e11689f6bb5c21f79d7/ai.cdas-1.0.1.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "31cef231b79b594039a546584241ede4", "sha256": "8e1eaf3b054d16bcfcc95568ecdd7acc988c82d5fe61038d61ec0bdbba934d39" }, "downloads": -1, "filename": "ai.cdas-1.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "31cef231b79b594039a546584241ede4", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10832, "upload_time": "2016-01-20T09:44:37", "url": "https://files.pythonhosted.org/packages/cc/c3/99b28ff99416a2e3cc07fb2d4a6a411bc23643f114c041a2c6d587907810/ai.cdas-1.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0a9ec0f992d4cbf55483572bd0eeba84", "sha256": "cd62cf792bbb76ea0919403a99ea61bffb7ca2ffea994701ceb79662bbb1311d" }, "downloads": -1, "filename": "ai.cdas-1.1.0.tar.gz", "has_sig": false, "md5_digest": "0a9ec0f992d4cbf55483572bd0eeba84", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9734, "upload_time": "2016-01-20T09:44:46", "url": "https://files.pythonhosted.org/packages/00/0a/daf624f7a1c27f355a738e3e9c5f11ba345d9b765445ccc79f8f9edd2449/ai.cdas-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "89c22b14b68d7c63d0f32c8cc4e884ae", "sha256": "09a4db4d71438881083f6ee2fab31af8cb356f4f999fecc7ca7b352cd1a91d79" }, "downloads": -1, "filename": "ai.cdas-1.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "89c22b14b68d7c63d0f32c8cc4e884ae", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 11201, "upload_time": "2016-02-05T13:37:35", "url": "https://files.pythonhosted.org/packages/f7/b8/ca7251f174fb30ad05eb62e419700591f74102b461d61737456a91292757/ai.cdas-1.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0bf953c92f619706e7d6c1aa3be8939d", "sha256": "4bee8c7e2033dfebfdf1671eea6f3bc4cbc08e3c407ef0df5c9ee4c6adc1ea04" }, "downloads": -1, "filename": "ai.cdas-1.1.1.tar.gz", "has_sig": false, "md5_digest": "0bf953c92f619706e7d6c1aa3be8939d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10181, "upload_time": "2016-02-05T13:37:41", "url": "https://files.pythonhosted.org/packages/32/63/3a91dae3051398f8e673acb2f1d6cafe31146a828e9965878f3bf0d1e04e/ai.cdas-1.1.1.tar.gz" } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "bca295e86942e679ea7dafa51fbf4f53", "sha256": "17e135b999e23cb1342331fdfd99812dc72f8607832d8f8fe4b38dac28d24554" }, "downloads": -1, "filename": "ai.cdas-1.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "bca295e86942e679ea7dafa51fbf4f53", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8890, "upload_time": "2017-12-20T19:17:13", "url": "https://files.pythonhosted.org/packages/4e/36/87e43657090572f693bf9d315a4d4c04d295f9a25e57498557e8cd5ea68c/ai.cdas-1.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "45d71a3f51bda2bb8fab37d10d44ec6b", "sha256": "db048440c65178f798edd851df02cedae81c179bd6e5857045d552491a5b71cf" }, "downloads": -1, "filename": "ai.cdas-1.2.0.tar.gz", "has_sig": false, "md5_digest": "45d71a3f51bda2bb8fab37d10d44ec6b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6170, "upload_time": "2017-12-20T19:17:14", "url": "https://files.pythonhosted.org/packages/f0/25/ffe69451e260d3fe6b2218d44ff78d570c2214068d46e3536da8199f3623/ai.cdas-1.2.0.tar.gz" } ], "1.2.1": [ { "comment_text": "", "digests": { "md5": "ca0c950bedf086addd9c727f5161bb57", "sha256": "e71d3cbca0f2df41ddf0ec728687dea9a2bdf33be95e175243dad0c56e5e2d5e" }, "downloads": -1, "filename": "ai.cdas-1.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "ca0c950bedf086addd9c727f5161bb57", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8825, "upload_time": "2017-12-20T19:54:44", "url": "https://files.pythonhosted.org/packages/b4/b0/c244076e6b601c8fcf7891863fdad571ba8abb462681d09645884580609e/ai.cdas-1.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "09292f48a4d2d35b81459d9c70a93667", "sha256": "eb206b04b4b52fb39e91ba6923d48a1b702ca2822515d83eafa5302a64dc2af4" }, "downloads": -1, "filename": "ai.cdas-1.2.1.tar.gz", "has_sig": false, "md5_digest": "09292f48a4d2d35b81459d9c70a93667", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6111, "upload_time": "2017-12-20T19:54:46", "url": "https://files.pythonhosted.org/packages/5f/69/a6e1226c5db8d3201c97167d6e9ded2c45f58f028ba4102e7a73cb12fb75/ai.cdas-1.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ca0c950bedf086addd9c727f5161bb57", "sha256": "e71d3cbca0f2df41ddf0ec728687dea9a2bdf33be95e175243dad0c56e5e2d5e" }, "downloads": -1, "filename": "ai.cdas-1.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "ca0c950bedf086addd9c727f5161bb57", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8825, "upload_time": "2017-12-20T19:54:44", "url": "https://files.pythonhosted.org/packages/b4/b0/c244076e6b601c8fcf7891863fdad571ba8abb462681d09645884580609e/ai.cdas-1.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "09292f48a4d2d35b81459d9c70a93667", "sha256": "eb206b04b4b52fb39e91ba6923d48a1b702ca2822515d83eafa5302a64dc2af4" }, "downloads": -1, "filename": "ai.cdas-1.2.1.tar.gz", "has_sig": false, "md5_digest": "09292f48a4d2d35b81459d9c70a93667", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6111, "upload_time": "2017-12-20T19:54:46", "url": "https://files.pythonhosted.org/packages/5f/69/a6e1226c5db8d3201c97167d6e9ded2c45f58f028ba4102e7a73cb12fb75/ai.cdas-1.2.1.tar.gz" } ] }