{ "info": { "author": "Sebastien Brisard", "author_email": "UNKNOWN", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Topic :: Scientific/Engineering", "Topic :: Software Development :: Build Tools" ], "description": "Python/NumPy implementation of IDL's rebin function.\n\nSee http://www.harrisgeospatial.com/docs/rebin.html.\n\nThe ``rebin`` function defined in this module first groups the cells of\nthe input array in tiles of specified size. Then, a reduction function\nis applied to each tile, which is replaced by a single value. The\nresulting array is returned: its dimensions are the number of tiles in\nthe input array.\n\nRebin is released under a BSD 3-clause license.\n\nRationale\n---------\n\nThe input array, ``a`` is assumed to be *strided*. In other words, if ::\n\n a.strides = (s0, s1, ...),\n\nthen ::\n\n a[i0, i1, ...] = a[[s0*i0 + s1*i1 + ...]],\n\nwhere ``[[...]]`` denotes the offset operator. To compute the output\narray, we first create a tiled version of ``a``. The number of\ndimensions of ``tiled`` is twice that of ``a``: for each index in ``a``,\n``tiled`` has one *slow* index and one *fast* index ::\n\n tiled[i0, i1, ..., j0, j1, ...] = a[f0*i0 + j0, f1*i1 + j1, ...],\n\nwhere ``factor=(f0, f1, ...)`` is the binning factor (size of the\ntiles). Upon using the strides of ``a`` ::\n\n tiled[i0, i1, ..., j0, j1, ...] = a[[s0*f0*i0 + s1*f1*i1 + ... +\n s0*j0 + s1*j1 + ...]],\n\nwhich shows that the strides of ``tiled`` are ::\n\n tiled.strides = (s0*f0, s1*f1, ..., s0, s1, ...).\n\nIn other words, ``tiled`` is a *view* of ``a`` with modified\nstrides. Restriding an array can be done with the ``as_strided``\nfunction from ``numpy.lib.stride_tricks``. Then, the output array is\nreadily computed as follows ::\n\n out = func(tiled, axis = tuple(range(-a.ndim, 0)))\n\nwhere reduction is carried out on the fast indices.\n\nBoundary cases\n--------------\n\nWhen the dimensions of the input array are not integer multiples of the\ndimensions of the tiles, the remainding rows/columns are simply\ndiscarded. For example ::\n\n +--------+--------+--------+--------+----+\n | 1 1 | 2 2 | 3 3 | 4 4 | 5 |\n | 1 1 | 2 2 | 3 3 | 4 4 | 5 |\n +--------+--------+--------+--------+----+\n | 6 6 | 7 7 | 8 8 | 9 9 | 10 |\n | 6 6 | 7 7 | 8 8 | 9 9 | 10 |\n +--------+--------+--------+--------+----+\n | 11 11 | 12 12 | 13 13 | 14 14 | 15 |\n +--------+--------+--------+--------+----+\n\nwill produce ::\n\n +----+----+----+----+\n | 4 | 8 | 12 | 16 |\n +----+----+----+----+\n | 24 | 28 | 32 | 36 |\n +----+----+----+----+\n\nfor (2, 2) tiles and a *sum* reduction.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/sbrisard/rebin", "keywords": null, "license": "BSD-3", "maintainer": null, "maintainer_email": null, "name": "rebin", "package_url": "https://pypi.org/project/rebin/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/rebin/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/sbrisard/rebin" }, "release_url": "https://pypi.org/project/rebin/1.0.1/", "requires_dist": null, "requires_python": null, "summary": "Python/NumPy implementation of IDL's rebin function.", "version": "1.0.1" }, "last_serial": 2283611, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "3e9bd2b4871e6bdedc3df627845f5747", "sha256": "90d7f7205c0191302727cad718cc8650dbb36e374bbc80cc607efd8be77147ac" }, "downloads": -1, "filename": "rebin-1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "3e9bd2b4871e6bdedc3df627845f5747", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4081, "upload_time": "2016-08-16T06:30:18", "url": "https://files.pythonhosted.org/packages/83/63/0f2dd85614b748e5a14aeb52198d94a013e9eceeae4d775341af2fe30867/rebin-1.0-py2.py3-none-any.whl" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "7d3ea8375c7e20b1430e71fcc571e171", "sha256": "84bcd5f6c268c22662a263099ccf59fe34ff451acc098e08983b5fb3a19882a4" }, "downloads": -1, "filename": "rebin-1.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "7d3ea8375c7e20b1430e71fcc571e171", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 6130, "upload_time": "2016-08-16T06:47:14", "url": "https://files.pythonhosted.org/packages/6e/a1/7fc776e15f0ad23345cccc847dcf342e107365116b64234ff3629616c4f7/rebin-1.0.1-py2.py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7d3ea8375c7e20b1430e71fcc571e171", "sha256": "84bcd5f6c268c22662a263099ccf59fe34ff451acc098e08983b5fb3a19882a4" }, "downloads": -1, "filename": "rebin-1.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "7d3ea8375c7e20b1430e71fcc571e171", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 6130, "upload_time": "2016-08-16T06:47:14", "url": "https://files.pythonhosted.org/packages/6e/a1/7fc776e15f0ad23345cccc847dcf342e107365116b64234ff3629616c4f7/rebin-1.0.1-py2.py3-none-any.whl" } ] }