{ "info": { "author": "", "author_email": "", "bugtrack_url": null, "classifiers": [], "description": "pymangle\n========\n\nSimple python code to read and work with Mangle masks.\n\nThe underlying code is in C for speed, and is based on some C++ code written by\nMartin White. Martin has posted his C++ code at\nhttps://github.com/martinjameswhite/litemangle\n\nCurrently supports ascii mangle polygon files, with and without pixelization.\nThe code works in python2 and python3\n\nAuthors: Erin Sheldon. Long double support added by Eli Rykoff.\n\nexamples\n--------\n\n```python\nimport pymangle\n\n# read a mangle polygon file\nm=pymangle.Mangle(\"mask.ply\")\n\n# test an ra,dec point against the mask\ngood = m.contains(200.0, 0.0)\n\n# test arrays of ra,dec points against the mask\nra=numpy.array([200.0, 152.7])\ndec=numpy.array([0.0, -15.0])\ngood = m.contains(ra, dec)\n\n# get the polygon ids\nids = m.polyid(ra,dec)\n\n# get the weights\nweights = m.weight(ra,dec)\n\n# get poth polyids and weights\nids, weights = m.polyid_and_weight(ra, dec)\n\n# generate random points \nra_rand, dec_rand = m.genrand(1000)\n\n# generate randoms from the mask and with the additional constraint that they\n# are within the specified rectangle. This speeds things up if your mask is\n# relatively small compared to the full sphere; choose the box just big enough\n# to contain the mask.\n\nra_min=200.0\nra_max=210.0\ndec_min=0.0\ndec_max=10.0\nra_rand, dec_rand = m.genrand_range(1000,ra_min,ra_max,dec_min,dec_max)\n\n# get the polygon weights\nweights = m.weights\n\n# read in a new set of weights\nm.read_weightfile(weightfile)\n\n# set the weights\n\nm.weights = weight_array\n```\n\nbuild and install python library\n--------------------------------\n\n```bash\n# using pip\npip install pymangle\n\n# from source\npython setup.py install --prefix=/some/path\n```\n\ntests\n-----\n```bash\npython -c 'import pymangle; pymangle.test.test()\n```", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "", "license": "GPL", "maintainer": "", "maintainer_email": "", "name": "pymangle", "package_url": "https://pypi.org/project/pymangle/", "platform": "", "project_url": "https://pypi.org/project/pymangle/", "project_urls": null, "release_url": "https://pypi.org/project/pymangle/0.9.1/", "requires_dist": null, "requires_python": "", "summary": "Simple python code to read and work with Mangle masks.", "version": "0.9.1" }, "last_serial": 5219332, "releases": { "0.9.0": [ { "comment_text": "works on python 2 and python 3", "digests": { "md5": "6b6f9a12b70f6bcac29cf49cbf14b997", "sha256": "6f64afc68ac0d5b5c9a7ce682cae11d8e231d05424c09fb5643ea1207daaef6d" }, "downloads": -1, "filename": "pymangle-0.9.0.tar.gz", "has_sig": false, "md5_digest": "6b6f9a12b70f6bcac29cf49cbf14b997", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26545, "upload_time": "2016-08-19T14:20:44", "url": "https://files.pythonhosted.org/packages/b4/7d/89184c34570e2ca29f593922b087c0e40dbda63c73ced4757c4b36cc7d3e/pymangle-0.9.0.tar.gz" } ], "0.9.1": [ { "comment_text": "", "digests": { "md5": "03a4a8591b0491271846ff1844320708", "sha256": "9ed704490a64e999ee7c75d223f07da29854ad9a5084f4243f490ada900d093d" }, "downloads": -1, "filename": "pymangle-0.9.1.tar.gz", "has_sig": false, "md5_digest": "03a4a8591b0491271846ff1844320708", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29568, "upload_time": "2019-05-02T21:01:06", "url": "https://files.pythonhosted.org/packages/8e/98/6dd8fef9731ae1531a9eb58e88d6c82e3a74129b985f7e9296bdbc5b412b/pymangle-0.9.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "03a4a8591b0491271846ff1844320708", "sha256": "9ed704490a64e999ee7c75d223f07da29854ad9a5084f4243f490ada900d093d" }, "downloads": -1, "filename": "pymangle-0.9.1.tar.gz", "has_sig": false, "md5_digest": "03a4a8591b0491271846ff1844320708", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29568, "upload_time": "2019-05-02T21:01:06", "url": "https://files.pythonhosted.org/packages/8e/98/6dd8fef9731ae1531a9eb58e88d6c82e3a74129b985f7e9296bdbc5b412b/pymangle-0.9.1.tar.gz" } ] }