{ "info": { "author": "D. Price", "author_email": "dancpr@berkeley.edu", "bugtrack_url": null, "classifiers": [], "description": "[![Build Status](https://travis-ci.org/telegraphic/pyymw16.svg?branch=master)](https://travis-ci.org/telegraphic/pyymw16)\n[![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0)\n[![Coverage Status](https://codecov.io/gh/telegraphic/pyymw16/branch/master/graph/badge.svg)](https://codecov.io/gh/telegraphic/pyymw16)\n\n# PyYMW16\n_A Python / C++ Version of YMW16 electron-density model_\n\nThis is a Python / C++ port of the Yao, Manchester and Wang (2017, [Astrophys. J., 835, 29](https://iopscience.iop.org/article/10.3847/1538-4357/835/1/29/meta);\n[arXiv:1610.09448](https://arxiv.org/abs/1610.09448)) YMW16 electron density model.\nThe code uses [pybind11](https://pybind11.readthedocs.io/en/stable/intro.html)\nto create Python bindings to the (C++ ported) YMW16 code.\n\n### Usage\n\nSome usage examples can be found in the [examples directory](https://github.com/telegraphic/pyymw16/tree/master/examples). \n\n```python\nimport pyymw16\n\n# calculate DM at a given distance\nDM, tau_sc = pyymw16.dist_to_dm(204.0, -6.5, 200)\n\n# calculate distance for a given sky position and DM\ndist, tau_sc = pyymw16.dm_to_dist(123.4, 4.0, 200)\n\n# calculate N_e density at xyz galactocentric coordinates\nne = pyynmw16.calculate_electron_density_xyz(1.0, 2.0, 3.0)\n\n# calculate N_e density at Galactic lat/long/distance coords\nne = pyynmw16.calculate_electron_density_lbr(204.0, -6.5, 3000.0)\n\n```\n\nThe methods return astropy [Quantities](http://docs.astropy.org/en/stable/units/quantity.html#quantity), which have units attached, and can accept astropy [Angles](http://docs.astropy.org/en/stable/coordinates/angles.html#working-with-angles) and Quantities as arguments:\n\n```python\nimport pyymw16\nimport astropy.units as u\nimport astropy.coordinates as c\nDM = u.Quantity(10.0, unit='pc cm^-3')\nra, dec = c.Angle(23.0, unit='hourangle'), c.Angle('-43:00:02', unit='degree')\nsky_coords = c.SkyCoord(ra, dec, frame='icrs')\ndist, tau_sc = pyymw16.dm_to_dist(sky_coords.galactic.l, sky_coords.galactic.b, DM)\n\nprint(dist.to('lyr'))\n>> 3362.16343117 lyr\nprint(tau_sc.to('ns'))\n>> 7.758686138 ns\n```\n\n\n### Installation\n\nRequires pybind11, astropy, and a newish C compiler with C++11 support (Ubuntu 16.04+ default gcc will work).\n\nYou should be able to install with:\n\n```\npip install git+https://github.com/telegraphic/pyymw16\n```\n\nOr, download this repository and install via\n\n```\npython setup.py install\n```\n\nTo run unit tests, run `python setup.py test`. Note that these tests only check the Python bindings, not the underlying C source code.\n\n## YMW16 C README\n\nYMW16 is a model for the distribution of free electrons in the Galaxy,\nthe Magellanic Clouds and the inter-galactic medium, that can be used\nto estimate distances for real or simulated pulsars and fast radio\nbursts (FRBs) based on their position and dispersion measure.\n\nThe Galactic model is based on 189 pulsars that have independently\ndetermined distances as well as dispersion measures, whereas simpler\nmodels are used for the electron density in the MC and the IGM. It is\nestimated that the 95% of predicted Galactic pulsar distances will\nhave a relative error of less than a factor of 0.9. Pulse broadening\ndue to scattering in the Galactic interstellar medium, the Magellanic\nClouds, the intergalactic medium and FRB host galaxies is estimated.\n\nAs well as the ymw16 dm-distance program, we also provide a program,\nymw16_ne, which gives the electron density at any point in the Galaxy\nor Magellanic Clouds.\n\nA paper (Yao, Manchester and Wang, 2017, [Astrophys. J., 835, 29](https://iopscience.iop.org/article/10.3847/1538-4357/835/1/29/meta);\n[arXiv:1610.09448](https://arxiv.org/abs/1610.09448)) describes the model and compares its predictions\nwith those of earlier Galactic electron density models. YMW16 is the\nfirst electron-density model to estimate extragalactic pulsar\ndistances and FRB distances.\n\nTo make a command-line executable version of the program, download and\nunpack the latest version of the program. Then run \"make_ymw16\" to\ncreate the executable. The environment variable YMW16_DIR may be set\nup to point at a directory containing ymw16par.txt and\nspiral.txt. Access to these files is needed at runtime.\n\nWebsites allowing interactive access to the YMW16 distance model and\ndownload of the latest program version are available at\nhttp://www.xao.ac.cn/ymw16/,\nhttp://www.atnf.csiro.au/research/pulsar/ymw16/ and\nhttps://bitbucket.org/psrsoft/ymw16/.\n\nPlease report any issues or bugs at\nhttps://bitbucket.org/psrsoft/ymw16/issues/new/ or directly to the\nauthors. Please provide an example illustrating the problem.\n\n### YMW16 C LICENSE\n\n```\nCopyright (C) 2016, 2017 J. M. Yao, R. N. Manchester, N. Wang.\n\nYMW16 is free software: you can redistribute it and/or modify\u3000it\nunder the terms of the GNU General Public License as published by the\nFree Software Foundation, either version 3 of the License, or (at your\noption) any later version.\n\nYMW16 is distributed in the hope that it will be useful,\u3000but WITHOUT\nANY WARRANTY; without even the implied warranty of\u3000MERCHANTABILITY or\nFITNESS FOR A PARTICULAR PURPOSE. See the\u3000GNU General Public License,\navailable at http://www.gnu.org/licenses/, for more details.\n\nJumei Yao (yaojumei _@_ xao.ac.cn), Richard N Manchester\n(dick.manchester _@_ csiro.au), Na Wang (na.wang _@_ xao.ac.cn)\n```\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "https://github.com/telegraphic/pyymw16/archive/2.0.7.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/telegraphic/pyymw16", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "pyymw16", "package_url": "https://pypi.org/project/pyymw16/", "platform": "", "project_url": "https://pypi.org/project/pyymw16/", "project_urls": { "Download": "https://github.com/telegraphic/pyymw16/archive/2.0.7.tar.gz", "Homepage": "https://github.com/telegraphic/pyymw16" }, "release_url": "https://pypi.org/project/pyymw16/2.0.7/", "requires_dist": [ "pybind11 (>=2.2)", "astropy (<3.0)" ], "requires_python": ">=2.7", "summary": "Python/C++ version of YMW16 electron density model", "version": "2.0.7" }, "last_serial": 5220477, "releases": { "2.0.0": [ { "comment_text": "", "digests": { "md5": "3b545030d2dc2c591ee272a8e3f9eaf2", "sha256": "b58030d4ba52da2f5a173f2663d552d52bac8e7cb5942c641d0b0ae8c0e73a78" }, "downloads": -1, "filename": "pyymw16-2.0.0.tar.gz", "has_sig": false, "md5_digest": "3b545030d2dc2c591ee272a8e3f9eaf2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18657, "upload_time": "2019-02-19T08:05:57", "url": "https://files.pythonhosted.org/packages/f3/37/8bcf670d0e13754684368a9c62acdaf74ce63759424442e075f94111ec56/pyymw16-2.0.0.tar.gz" } ], "2.0.1": [ { "comment_text": "", "digests": { "md5": "001de4c63832ca065559adc74445297c", "sha256": "465b899bed147a260b6bfc237cbe10e0b6c6c4a139f19da2f03970f888e67a97" }, "downloads": -1, "filename": "pyymw16-2.0.1-py2.7-macosx-10.13-x86_64.egg", "has_sig": false, "md5_digest": "001de4c63832ca065559adc74445297c", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 68015, "upload_time": "2019-02-26T04:00:16", "url": "https://files.pythonhosted.org/packages/60/ad/0e5f2f3fb2a828bb593f1727370961ebc767023affa751811e54346d4671/pyymw16-2.0.1-py2.7-macosx-10.13-x86_64.egg" }, { "comment_text": "", "digests": { "md5": "d22b1791a55208958fe9db5af59c9a1b", "sha256": "56f0c59e1ee756b65a6815d37d410e5c3fd5a0bfd963dde070c77e1ab8afc6f4" }, "downloads": -1, "filename": "pyymw16-2.0.1.tar.gz", "has_sig": false, "md5_digest": "d22b1791a55208958fe9db5af59c9a1b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18672, "upload_time": "2019-02-19T08:13:57", "url": "https://files.pythonhosted.org/packages/3d/c7/3af281794eb611d295994cf572c0e74329d44ccff10ffdb2b1d8b91746e9/pyymw16-2.0.1.tar.gz" } ], "2.0.2": [ { "comment_text": "", "digests": { "md5": "716fb3fd7356a20f69559dbf1d0edd91", "sha256": "f8a7daa2b9b80dc559752183aebb55069a4c7a6dd9521b552ba9bde87e595f6f" }, "downloads": -1, "filename": "pyymw16-2.0.2.tar.gz", "has_sig": false, "md5_digest": "716fb3fd7356a20f69559dbf1d0edd91", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17412, "upload_time": "2019-02-19T08:32:30", "url": "https://files.pythonhosted.org/packages/7d/7f/4dc372ab3909b4d1c65ff4317fe0149b30ccdba0d28b3a0d50ee7d133bfb/pyymw16-2.0.2.tar.gz" } ], "2.0.3": [ { "comment_text": "", "digests": { "md5": "eb763260158bd2b6a759fc12876a67ff", "sha256": "cd1afc9bb0169983d591dc1889e158c4f64db185df4ada6183a3598d0519f6b3" }, "downloads": -1, "filename": "pyymw16-2.0.3.tar.gz", "has_sig": false, "md5_digest": "eb763260158bd2b6a759fc12876a67ff", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18054, "upload_time": "2019-02-19T08:38:55", "url": "https://files.pythonhosted.org/packages/97/8b/b0541540d8c43674945624e7542726cab51374054dbb2bb47b3c4088104c/pyymw16-2.0.3.tar.gz" } ], "2.0.4": [ { "comment_text": "", "digests": { "md5": "2df25922863e358067e6e2f666831499", "sha256": "9ec278462b4fc4f78c4216aa1255d1521cc0b18b49e4f8263880a115dd8adcaa" }, "downloads": -1, "filename": "pyymw16-2.0.4.tar.gz", "has_sig": false, "md5_digest": "2df25922863e358067e6e2f666831499", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18051, "upload_time": "2019-02-19T08:52:18", "url": "https://files.pythonhosted.org/packages/28/f0/ec5d14bcfbb868079e3468c9ed31751d816f5d2963af7e4e121a66bc5127/pyymw16-2.0.4.tar.gz" } ], "2.0.5": [ { "comment_text": "", "digests": { "md5": "938b60e8ec49d9613f281009f657354d", "sha256": "8d4b2a22fc721cee37a4fa97fda33328c160f0ff78113b5d82083abf7191d481" }, "downloads": -1, "filename": "pyymw16-2.0.5-cp27-cp27m-macosx_10_13_x86_64.whl", "has_sig": false, "md5_digest": "938b60e8ec49d9613f281009f657354d", "packagetype": "bdist_wheel", "python_version": "cp27", "requires_python": ">=2.7", "size": 65651, "upload_time": "2019-02-26T04:00:14", "url": "https://files.pythonhosted.org/packages/35/28/b5f9c1d61c0c97b370bb3ce6ffdf58f3b2ffa958451b6e4a9193368202d6/pyymw16-2.0.5-cp27-cp27m-macosx_10_13_x86_64.whl" } ], "2.0.6": [ { "comment_text": "", "digests": { "md5": "9f73a47b4e56e3980bf9cf8ef835f665", "sha256": "55bcbdc75330f1c3e78ddfdf5b470b7c52c2d8f7f833bd40e85df096404f859f" }, "downloads": -1, "filename": "pyymw16-2.0.6-cp27-cp27m-macosx_10_13_x86_64.whl", "has_sig": false, "md5_digest": "9f73a47b4e56e3980bf9cf8ef835f665", "packagetype": "bdist_wheel", "python_version": "cp27", "requires_python": ">=2.7", "size": 65654, "upload_time": "2019-05-03T06:06:12", "url": "https://files.pythonhosted.org/packages/30/80/e4337f32667e482ad0b2b68b805d59aa3d2a154d95bbdf18879d4fc4398a/pyymw16-2.0.6-cp27-cp27m-macosx_10_13_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "95069765d544f709b11a022d6762d6de", "sha256": "2ae20885cb6b502f7d9a1070995dee9701f78347ab27b4b514983c1c66bbf154" }, "downloads": -1, "filename": "pyymw16-2.0.6.tar.gz", "has_sig": false, "md5_digest": "95069765d544f709b11a022d6762d6de", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7", "size": 18138, "upload_time": "2019-05-03T06:06:14", "url": "https://files.pythonhosted.org/packages/ef/40/b7fbb390d113b11cef9ccb40b3f6a047b24f8bde2a71be30e3a582a98bb9/pyymw16-2.0.6.tar.gz" } ], "2.0.7": [ { "comment_text": "", "digests": { "md5": "e23c263a05bcc33618966965ea332143", "sha256": "06245be1e8aa679ccd26a84c954fb4c20c033e3dd217b2ebfb3a419a53aac8fd" }, "downloads": -1, "filename": "pyymw16-2.0.7-cp27-cp27m-macosx_10_13_x86_64.whl", "has_sig": false, "md5_digest": "e23c263a05bcc33618966965ea332143", "packagetype": "bdist_wheel", "python_version": "cp27", "requires_python": ">=2.7", "size": 65653, "upload_time": "2019-05-03T06:10:17", "url": "https://files.pythonhosted.org/packages/99/ea/35d46e5e865686275afa7104f498d87f73604cbce825cf0fb98b2c628228/pyymw16-2.0.7-cp27-cp27m-macosx_10_13_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "63fda9c6ee5252686301217167f5ed19", "sha256": "e5eb39521a5bdab1e0027dbe63c55b0d8f03215c630e0f533a0a33ba235e84e5" }, "downloads": -1, "filename": "pyymw16-2.0.7-cp36-cp36m-macosx_10_7_x86_64.whl", "has_sig": false, "md5_digest": "63fda9c6ee5252686301217167f5ed19", "packagetype": "bdist_wheel", "python_version": "cp36", "requires_python": ">=2.7", "size": 67074, "upload_time": "2019-05-03T06:10:19", "url": "https://files.pythonhosted.org/packages/9f/c0/04d3d2cd20f447a2d63143341b159805ea4d709dba9a30fd1ff7bc843aff/pyymw16-2.0.7-cp36-cp36m-macosx_10_7_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "8d8f7eaaa96f43f01a23fdf7290c29ea", "sha256": "a1ab9a4a3fdb7d9a6ccaa949840e21319f8c44707eb7dd033d14e6e6697696a5" }, "downloads": -1, "filename": "pyymw16-2.0.7.tar.gz", "has_sig": false, "md5_digest": "8d8f7eaaa96f43f01a23fdf7290c29ea", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7", "size": 18136, "upload_time": "2019-05-03T06:10:22", "url": "https://files.pythonhosted.org/packages/e0/aa/65f18199e4d8b772426d97ba28b1765b74a9d0eb5b036667b234ab143887/pyymw16-2.0.7.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e23c263a05bcc33618966965ea332143", "sha256": "06245be1e8aa679ccd26a84c954fb4c20c033e3dd217b2ebfb3a419a53aac8fd" }, "downloads": -1, "filename": "pyymw16-2.0.7-cp27-cp27m-macosx_10_13_x86_64.whl", "has_sig": false, "md5_digest": "e23c263a05bcc33618966965ea332143", "packagetype": "bdist_wheel", "python_version": "cp27", "requires_python": ">=2.7", "size": 65653, "upload_time": "2019-05-03T06:10:17", "url": "https://files.pythonhosted.org/packages/99/ea/35d46e5e865686275afa7104f498d87f73604cbce825cf0fb98b2c628228/pyymw16-2.0.7-cp27-cp27m-macosx_10_13_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "63fda9c6ee5252686301217167f5ed19", "sha256": "e5eb39521a5bdab1e0027dbe63c55b0d8f03215c630e0f533a0a33ba235e84e5" }, "downloads": -1, "filename": "pyymw16-2.0.7-cp36-cp36m-macosx_10_7_x86_64.whl", "has_sig": false, "md5_digest": "63fda9c6ee5252686301217167f5ed19", "packagetype": "bdist_wheel", "python_version": "cp36", "requires_python": ">=2.7", "size": 67074, "upload_time": "2019-05-03T06:10:19", "url": "https://files.pythonhosted.org/packages/9f/c0/04d3d2cd20f447a2d63143341b159805ea4d709dba9a30fd1ff7bc843aff/pyymw16-2.0.7-cp36-cp36m-macosx_10_7_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "8d8f7eaaa96f43f01a23fdf7290c29ea", "sha256": "a1ab9a4a3fdb7d9a6ccaa949840e21319f8c44707eb7dd033d14e6e6697696a5" }, "downloads": -1, "filename": "pyymw16-2.0.7.tar.gz", "has_sig": false, "md5_digest": "8d8f7eaaa96f43f01a23fdf7290c29ea", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7", "size": 18136, "upload_time": "2019-05-03T06:10:22", "url": "https://files.pythonhosted.org/packages/e0/aa/65f18199e4d8b772426d97ba28b1765b74a9d0eb5b036667b234ab143887/pyymw16-2.0.7.tar.gz" } ] }