{ "info": { "author": "Dan Howe", "author_email": "d.howe@wrl.unsw.edu.au", "bugtrack_url": null, "classifiers": [], "description": "# scaling\n\nConvert quantities between model and prototype scale using Froude and Reynolds similitude.\n\n## Installation\n\n```\npip install scaling\n```\n\n## Usage\n\n```python\n>>> from scaling import FroudeConverter\n>>> froude = FroudeConverter()\n\n>>> # Convert model value of 200 mm to prototype value (m) with scale of 10\n>>> froude.model_to_proto(200,\u00c2\u00a0length_scale=10,\u00c2\u00a0input_unit='mm',\u00c2\u00a0target_unit='m')\n2.0\n\n>>> # Get Froude scaling exponent for quantities of time\n>>>\u00c2\u00a0froude.scaling_exponent('s')\n0.5\n\n>>> # Get length, mass and time dimensions for quantities of energy\n>>>\u00c2\u00a0froude.dimensions('kJ')\n'L^2\u00c2\u00a0M^1\u00c2\u00a0T^-2'\n```\n\nDataframes are also accepted, and specific units can be specified for the values in the index.\n\n```python\n>>> T = 2\n>>> H = 100\n\n>>> # Generate regular waves with height=100mm, and period=2s\n>>> t = np.arange(0, 10.1, 0.1)\n>>> eta = 0.5 * H * np.sin(t * 2 * np.pi / T)\n\n>>> df_model = pd.DataFrame(index=t, data=eta)\n>>> df_model.columns = ['$\\eta$ (mm)']\n>>> df_model.index.name = 'Time (s)'\n\n>>> df_model.plot()\n```\n\n![model](https://user-images.githubusercontent.com/11261876/45915234-575e4300-be95-11e8-9edd-30338bd6db2d.png)\n\n```python\n>>> # Convert to prototype dimensions, with length scale=25\n>>> df_proto = froude.model_to_proto(\n df_model,\n length_scale=25,\n input_unit='mm',\n target_unit='m',\n index_input_unit='s',\n index_target_unit='s')\n\n>>> df_proto.columns = ['$\\eta$ (m)']\n>>> df_proto.plot()\n```\n![proto](https://user-images.githubusercontent.com/11261876/45915245-6c3ad680-be95-11e8-9912-2dc2afc16b9a.png)\n\n`scaling` uses `pint` for unit and dimension conversions. `pint` is able to interpret a wide range of different input units.\n\n```python\n>>> # Convert water head model value (mm) to prototype pressure value (kPa)\n>>> froude.model_to_proto(10,\u00c2\u00a0length_scale=100, 'mm.H20',\u00c2\u00a0'kPa')\n9.80665\n\n>>> # Demonstrate different ways of specifying units of newtons\n>>>\u00c2\u00a0froude.dimensions('N')\n'L^1\u00c2\u00a0M^1\u00c2\u00a0T^-2'\n>>>\u00c2\u00a0froude.dimensions('newton')\n'L^1\u00c2\u00a0M^1\u00c2\u00a0T^-2'\n>>>\u00c2\u00a0froude.dimensions('kg.m/s/s')\n'L^1\u00c2\u00a0M^1\u00c2\u00a0T^-2'\n>>>\u00c2\u00a0froude.dimensions('kilogram.metre/second^2')\n'L^1\u00c2\u00a0M^1\u00c2\u00a0T^-2'\n```\n\n## Froude scaling reference\n\n| Quantity | Dimensions | Scaling exponent |\n|--------------|---------------|------------------|\n| Length | L^1 | \u00ce\u00bb^1 |\n| Mass | M^1 | \u00ce\u00bb^3 |\n| Time | T^1 | \u00ce\u00bb^0.5 |\n| Velocity | L^1 T^-1 | \u00ce\u00bb^0.5 |\n| Acceleration | L^1 T^-2 | \u00ce\u00bb^0 |\n| Force | L^1 M^1 T^-2 | \u00ce\u00bb^3 |\n| Pressure | L^-1 M^1 T^-2 | \u00ce\u00bb^1 |\n| Overtopping | L^2 T^-1 | \u00ce\u00bb^1.5 |\n\n\n## Reynolds scaling reference\n\n| Quantity | Dimensions | Scaling exponent |\n|--------------|---------------|------------------|\n| Length | L^1 | \u00ce\u00bb^1 |\n| Mass | M^1 | \u00ce\u00bb^3 |\n| Time | T^1 | \u00ce\u00bb^2 |\n| Velocity | L^1 T^-1 | \u00ce\u00bb^-1 |\n| Acceleration | L^1 T^-2 | \u00ce\u00bb^-3 |\n| Force | L^1 M^1 T^-2 | \u00ce\u00bb^0 |\n| Pressure | L^-1 M^1 T^-2 | \u00ce\u00bb^-2 |\n| Overtopping | L^2 T^-1 | \u00ce\u00bb^0 |\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/onewhaleid/scaling", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "scaling", "package_url": "https://pypi.org/project/scaling/", "platform": "", "project_url": "https://pypi.org/project/scaling/", "project_urls": { "Homepage": "https://github.com/onewhaleid/scaling" }, "release_url": "https://pypi.org/project/scaling/0.2.3/", "requires_dist": [ "pint" ], "requires_python": "", "summary": "convert units using Froude and Reynolds similitude", "version": "0.2.3" }, "last_serial": 4299157, "releases": { "0.2.0": [ { "comment_text": "", "digests": { "md5": "463e48f7b1045842c89db36ef953e513", "sha256": "a4c8d1d92f86f5c22e6c99f5a4815211da0530a16e71115a992c50e445d63ef7" }, "downloads": -1, "filename": "scaling-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "463e48f7b1045842c89db36ef953e513", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3380, "upload_time": "2018-09-21T12:07:17", "url": "https://files.pythonhosted.org/packages/80/3f/31ebc6ab3b4edcc8c14b824282c7b0ea738d45435dcb73dd03261d56c007/scaling-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "df14445e78703598bdbf492271f6f9ed", "sha256": "0cc955d9f138868b1aa4c1eae807c67b0d12a2baf8e7d73cc28283766efa7b60" }, "downloads": -1, "filename": "scaling-0.2.0.tar.gz", "has_sig": false, "md5_digest": "df14445e78703598bdbf492271f6f9ed", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3059, "upload_time": "2018-09-21T12:07:19", "url": "https://files.pythonhosted.org/packages/85/74/f77c53ac509068b1f421e2948f7c1f7c4e7d07b7df7ae5093524c1befb05/scaling-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "0d09604fcc6ef5c8bbbbc3c263a912fc", "sha256": "fa5c7045981a30c321fbd29fcd1fdca4fb7558536d3be224ccbe60db3ac286d0" }, "downloads": -1, "filename": "scaling-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "0d09604fcc6ef5c8bbbbc3c263a912fc", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 2666, "upload_time": "2018-09-22T08:55:43", "url": "https://files.pythonhosted.org/packages/9d/f4/649d5560cb8d7b86a1a2c502d658b0bcd42ea5bf5e3472d4773559b461c4/scaling-0.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "498a5719efdbc920cc2aa0d0bf34fcac", "sha256": "99fd9e6473b1ce39ed80666dacd4d51e1f2cfb005e4100ceff10e1b90d83170d" }, "downloads": -1, "filename": "scaling-0.2.1.tar.gz", "has_sig": false, "md5_digest": "498a5719efdbc920cc2aa0d0bf34fcac", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3167, "upload_time": "2018-09-22T08:55:45", "url": "https://files.pythonhosted.org/packages/f6/10/787be63e05701bf2792abbaed1ea8d0f518f0936ff478a91ce98864a5b8f/scaling-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "851e9360e4b25ad372f1cf276610c6cf", "sha256": "24b31a77961fb62ab30910f1b4b975bb80905b9348588ba67c2ef54af043d99b" }, "downloads": -1, "filename": "scaling-0.2.2-py3-none-any.whl", "has_sig": false, "md5_digest": "851e9360e4b25ad372f1cf276610c6cf", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3765, "upload_time": "2018-09-22T09:04:08", "url": "https://files.pythonhosted.org/packages/a0/2c/70454fbf3a54d6a4eb90cf204b146ef32f3cc99344732f6638e257964dcc/scaling-0.2.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "111adb727892ada72510558774b1c51f", "sha256": "e41ef73ddfc69c8adf248b93c49b3f87efdceea4b4973faa2fc7e85cea4f4187" }, "downloads": -1, "filename": "scaling-0.2.2.tar.gz", "has_sig": false, "md5_digest": "111adb727892ada72510558774b1c51f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3543, "upload_time": "2018-09-22T09:04:10", "url": "https://files.pythonhosted.org/packages/59/75/7ed8118b74ea1128c3dbbd2859eb22e67afe6b69ee9f0b56e27ecc9ebbe4/scaling-0.2.2.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "49450cdfe0c19660aa153873db679788", "sha256": "4657132a0f12a1fdcb0df3ed19a37cae104e56dce817c4b3f81a252d545db6c6" }, "downloads": -1, "filename": "scaling-0.2.3-py3-none-any.whl", "has_sig": false, "md5_digest": "49450cdfe0c19660aa153873db679788", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3791, "upload_time": "2018-09-22T09:05:41", "url": "https://files.pythonhosted.org/packages/d5/21/d480aae4ef69eb5057a2365106abe5792e740a1b72d21a9219041faa0cc7/scaling-0.2.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4dad3bdaeefa51958f2045fcf2090199", "sha256": "987af0e25637ab0bd708326fa251e19a97e3b4224119fbb02cf7f81d082ef144" }, "downloads": -1, "filename": "scaling-0.2.3.tar.gz", "has_sig": false, "md5_digest": "4dad3bdaeefa51958f2045fcf2090199", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3623, "upload_time": "2018-09-22T09:05:42", "url": "https://files.pythonhosted.org/packages/7d/2b/592a67406a94c56ef39989a3158bb96c72416f54413deecb6f2a17f15f34/scaling-0.2.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "49450cdfe0c19660aa153873db679788", "sha256": "4657132a0f12a1fdcb0df3ed19a37cae104e56dce817c4b3f81a252d545db6c6" }, "downloads": -1, "filename": "scaling-0.2.3-py3-none-any.whl", "has_sig": false, "md5_digest": "49450cdfe0c19660aa153873db679788", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3791, "upload_time": "2018-09-22T09:05:41", "url": "https://files.pythonhosted.org/packages/d5/21/d480aae4ef69eb5057a2365106abe5792e740a1b72d21a9219041faa0cc7/scaling-0.2.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4dad3bdaeefa51958f2045fcf2090199", "sha256": "987af0e25637ab0bd708326fa251e19a97e3b4224119fbb02cf7f81d082ef144" }, "downloads": -1, "filename": "scaling-0.2.3.tar.gz", "has_sig": false, "md5_digest": "4dad3bdaeefa51958f2045fcf2090199", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3623, "upload_time": "2018-09-22T09:05:42", "url": "https://files.pythonhosted.org/packages/7d/2b/592a67406a94c56ef39989a3158bb96c72416f54413deecb6f2a17f15f34/scaling-0.2.3.tar.gz" } ] }