{ "info": { "author": "Greg Novak", "author_email": "greg.novak@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "# -*- coding: utf-8 -*-\n========\n S\u00e9rsic\n========\n\nThis is an implementation of the exact deprojection of S\u00e9rsic surface\nbrightness profiles as described in:\n\n\"Analytical expressions for the deprojected S\u00e9rsic model\"\nBaes and Gentile\nAstronomy and Astrophysics, Volume 525:A136 (2011)\nhttp://arxiv.org/abs/1009.4713\n\nThis code depends on the mpmath python library\n(http://mpmath.googlecode.com) for an implementation of the Meijer G\nfunction required by the Baes and Gentile (hereafter B+G) formulas for\nrational values of the S\u00e9rsic index. B+G also give formulas for\nirrational S\u00e9rsic indices, but I could not find an implementation of\nthe required Fox H function. Therefore this code requires rational\nS\u00e9rsic indices, but any irrational number can be approximated\narbitrarily well by some rational number, so... no problem.\n\nThe code also depends on scipy (http://scipy.org), but the dependence\nis mostly for testing: doing numerical integrals and such. If you\ntrust that the code passes the tests and don't want to run them\nyourself (ha!), the only dependence on scipy is finding the root\n(scipy.optimize.newton) in the function bg_constants(), which would be\npretty easy to replace.\n\nThis was implemented for use use in the paper:\n\"On Galaxies and Homology\" \nNovak et. al. \nMonthly Notices of the Royal Astronomical Society, 424:635 (2012) \nhttp://arxiv.org/abs/1205.2533\n\nThe B+G formulas are not simple but not terribly complex. However, I\nwanted to be quite sure that I had correctly implemented the formulas\n(and that the formulas themselves were correct), so I put significant\neffort into comprehensive tests. That testing is the primary virtue\nof this particular implementation of the B+G formulas, and is my\nreason for releasing this code.\n\nTo test the implementation of the B+G formulas, I also implemented the\napproximate formulas for deprojected S\u00e9rsic profiles described in:\n\n\"Dark matter in elliptical galaxies - I. Is the total mass density\nprofile of the NFW form or even steeper?\"\nMamon and Lokas\nMonthly Notices of the Royal Astronomical Society, Volume 362:95 (2005)\nhttp://arxiv.org/abs/astro-ph/0405466\n\nAdditional tests use the parameterization of the S\u00e9rsic profile given\nin:\n\nGalactic Astronomy\nBinney and Merrifield\nPrinceton University Press, 1998\n\nFor more information: \nhttp://pypi.python.org/pypi/sersic/\n\nFor the source code:\nhttp://launchpad.net/sersic\n\nInstallation\n============\n\nFirst install the mpmath python library (http://mpmath.googlecode.com).\n\nTo run the tests and avoid implementing your own root finding routine,\ninstall numpy (http://www.numpy.org) and scipy (http://www.scipy.org).\nBut you've got those installed already, right?\n\nThe sersic module can be installed by any one of the following\nstandard incantations:\n\n pip sersic\nor\n easy_install sersic\nor\n python setup.py install \n\nIf you want to install in your home directory, you can add the --user\nflag to any of the above.\n\nTo run the tests:\npython test.py\n\nUsage\n=====\n\nVery likely the only function any user will care about is:\n\ndef luminosity(pp, qq, reff=1.0, lum=1.0) where pp and qq are the\nnumerator and denominator of the Sersic index (both integers) so that\nnn=pp/qq, reff is the projected half-light radius, and luminosity is\nthe total luminosity. This returns a function that takes a radius and\nreturns a luminosity density.\n\n>>> lum = luminosity(5,3)\n>>> lum(1.1)\n>>> lum([1.1, 2.2, 3.3])\n\nAll of the other functions in the module are just to help make sure\nthat the Baes + Gentile expressions are implemented correctly.\n\nIf you find that the calculations are taking a long time, you can try\nreducing the precision of the calculation of the Meijer G function.\nThe mpmath library is designed to be able to work to arbitrary\nprecision, and is by default set to ~double precision. For\ninformation on changing the precision, see:\n\nhttp://mpmath.googlecode.com/svn/trunk/doc/build/basics.html#setting-the-precision\n\nKeep in mind that small values of the numerator and denominator are\nfaster than large ones (e.g. luminosity(2,1) is fast,\nluminosity(200,99) is slow.\n\nThe function returns arbitrary precision floats defined by the mpmath\nlibrary. They should behave as normal floats, but you may want to\ncast them to Python floats to avoid invoking mpmath's more careful\narithmetic.\n\nLicense\n=======\n\nThe code is released under the MIT license, so you should be able to\ndo whatever you want with it. \n\nIf you use this software to produce a scientific publication or if you\nincorporate this code into a larger project, I would appreciate it if\nyou send me a note at greg.novak@gmail.com", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://pypi.python.org/pypi/sersic/", "keywords": null, "license": "MIT (X11) License", "maintainer": null, "maintainer_email": null, "name": "sersic", "package_url": "https://pypi.org/project/sersic/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/sersic/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://pypi.python.org/pypi/sersic/" }, "release_url": "https://pypi.org/project/sersic/1.0.2/", "requires_dist": null, "requires_python": null, "summary": "Exact deprojection of S\u00e9rsic surface brightness profiles.", "version": "1.0.2" }, "last_serial": 1190608, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "d8de9b2ce1a74b500e8a4b9f76279029", "sha256": "a95dc22a989c212ae894a47ff2db2dfd8a4aa85465f15ce1a1dcd5b7acd953b9" }, "downloads": -1, "filename": "sersic-1.0.0.tar.gz", "has_sig": false, "md5_digest": "d8de9b2ce1a74b500e8a4b9f76279029", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10436, "upload_time": "2013-04-06T16:39:15", "url": "https://files.pythonhosted.org/packages/8b/a3/4c2339e7f913d3a40cdab2768120cf1a0b095f97b60599693b22ccdaa9bc/sersic-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "69b0c5a20c3ad282757a7173014ac6d2", "sha256": "a8d6c1d1e3e03a98ec96c1c00ee3bf2eb13673aa39978190b436c9f5a5117992" }, "downloads": -1, "filename": "sersic-1.0.1.tar.gz", "has_sig": false, "md5_digest": "69b0c5a20c3ad282757a7173014ac6d2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10570, "upload_time": "2013-05-06T20:51:39", "url": "https://files.pythonhosted.org/packages/97/55/712a5a8ed03709c9dc6b6235ececdc8a02ff89951319e39f2e8dc653de04/sersic-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "89db7b34364d3a4c42137f3aef79783d", "sha256": "97ba8abf9d3421d308214e491ada2d45290322b5d52d47267da90a3dc8ac5c17" }, "downloads": -1, "filename": "sersic-1.0.2.tar.gz", "has_sig": false, "md5_digest": "89db7b34364d3a4c42137f3aef79783d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10644, "upload_time": "2014-08-14T15:55:45", "url": "https://files.pythonhosted.org/packages/a0/5d/b94d8ffbcb54811da9c03fe9f79a1c44135f950f70243f9ec81e18bd6361/sersic-1.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "89db7b34364d3a4c42137f3aef79783d", "sha256": "97ba8abf9d3421d308214e491ada2d45290322b5d52d47267da90a3dc8ac5c17" }, "downloads": -1, "filename": "sersic-1.0.2.tar.gz", "has_sig": false, "md5_digest": "89db7b34364d3a4c42137f3aef79783d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10644, "upload_time": "2014-08-14T15:55:45", "url": "https://files.pythonhosted.org/packages/a0/5d/b94d8ffbcb54811da9c03fe9f79a1c44135f950f70243f9ec81e18bd6361/sersic-1.0.2.tar.gz" } ] }