Difference between revisions of "Webapps with python"
From assela Pathirana
Jump to navigationJump to search
Line 1: | Line 1: | ||
==Webapps with python== | ==Webapps with python== | ||
Python has a number of libraries that makes creating graphics based on data. Some of these tools can create interactive graphics and also web applications so that one can allow non-programmers to explore, analyse and visualize data. [https://plot.ly/dash/ Ploty Dash] is such a library with a particularly easy learning curve. | Python has a number of libraries that makes creating graphics based on data. Some of these tools can create interactive graphics and also web applications so that one can allow non-programmers to explore, analyse and visualize data. [https://plot.ly/dash/ Ploty Dash] is such a library with a particularly easy learning curve. | ||
Line 6: | Line 5: | ||
===[http://er.wa.pathirana.net/ Precipitation records of Europe]=== | ===[http://er.wa.pathirana.net/ Precipitation records of Europe]=== | ||
<div style="overflow: hidden">[[File:raingauge_stations_europe.png|thumb|350px|Interactive map, analysis and plotting tool for precipitation]] | |||
[https://www.ecad.eu/ European Climate Assessment & Dataset project] managed by Royal Netherlands Meteorological Institute (KNMI), collects meteorological data (pressure, humidity, wind speed, cloud cover and precipitation - see [https://www.ecad.eu/dailydata/datadictionaryelement.php here] for the complete description) from thousands of observation stations from (at the time of writing) 63 countries. As of september 2019, this database includes observations from 57312 stations. | [https://www.ecad.eu/ European Climate Assessment & Dataset project] managed by Royal Netherlands Meteorological Institute (KNMI), collects meteorological data (pressure, humidity, wind speed, cloud cover and precipitation - see [https://www.ecad.eu/dailydata/datadictionaryelement.php here] for the complete description) from thousands of observation stations from (at the time of writing) 63 countries. As of september 2019, this database includes observations from 57312 stations. | ||
Line 18: | Line 18: | ||
===[http://oro.wa.pathirana.net Orographic lift of wind fields - atmospheric quantities calculator]=== | ===[http://oro.wa.pathirana.net Orographic lift of wind fields - atmospheric quantities calculator]=== | ||
[[File:orographic_lifting_tool_python.png|thumb|350px|Atmospheric quantities with orographic uplift [http://oro.wa.pathirana.net/ LINK]]] | <div style="overflow: hidden">[[File:orographic_lifting_tool_python.png|thumb|350px|Atmospheric quantities with orographic uplift [http://oro.wa.pathirana.net/ LINK]]]</div> | ||
This is an educational tool to demonstrate the interaction of wind fields with mountains. The user can change the mountain height, humidity and temperature of the air and observe how they contribute to the formation of precipitation (liquid or sometimes ice/snow). | This is an educational tool to demonstrate the interaction of wind fields with mountains. The user can change the mountain height, humidity and temperature of the air and observe how they contribute to the formation of precipitation (liquid or sometimes ice/snow). | ||
===[http://citypop.wa.pathirana.net/ Urban population of the world]=== | ===[http://citypop.wa.pathirana.net/ Urban population of the world]=== | ||
[[File:citypop_tool_python.png|thumb|350px|Urban population of the world. Selected 13000 urban centres from around the world. [https://citypop.wa.pathirana.net/ LINK]]] | <div style="overflow: hidden">[[File:citypop_tool_python.png|thumb|350px|Urban population of the world. Selected 13000 urban centres from around the world. [https://citypop.wa.pathirana.net/ LINK]]]</div> | ||
Using the curated dataset provided by [https://simplemaps.com/data/world-cities simplemaps] website, this plot shows the urban population of the world. Note: This dataset does not cover all the populated places. It covers almost all major cities and towns, but the coverage of smaller places could be uneven. | Using the curated dataset provided by [https://simplemaps.com/data/world-cities simplemaps] website, this plot shows the urban population of the world. Note: This dataset does not cover all the populated places. It covers almost all major cities and towns, but the coverage of smaller places could be uneven. | ||
Line 34: | Line 34: | ||
To test this app, first find some images of concrete with and without cracks. For example: | To test this app, first find some images of concrete with and without cracks. For example: | ||
<gallery> | <div style="overflow: hidden"><gallery> | ||
File:Concrete_crack.jpg|1 | File:Concrete_crack.jpg|1 | ||
File:Concrete_crack_2.jpg|2 | File:Concrete_crack_2.jpg|2 | ||
Line 42: | Line 42: | ||
[[File:concrete_crack_results.png|thumb|right|350px|Crack detection in concrete with tensorflow [https://cp.wa.pathirana.net/ LINK]]] | [[File:concrete_crack_results.png|thumb|right|350px|Crack detection in concrete with tensorflow [https://cp.wa.pathirana.net/ LINK]]] | ||
</div> | |||
If you don't have such images, just search the web and download a few. Then [https://cp.wa.pathirana.net/ go to the app] and upload them. (You can drag and drop them onto the app as well. | If you don't have such images, just search the web and download a few. Then [https://cp.wa.pathirana.net/ go to the app] and upload them. (You can drag and drop them onto the app as well. | ||
Line 55: | Line 56: | ||
This application has an administrative interface that can be used to add more examples. Obviously that interface is password protected and not open to the public. | This application has an administrative interface that can be used to add more examples. Obviously that interface is password protected and not open to the public. | ||
[[File:web2py swmm interface.png|thumb|right|350px|SWMM model results under different catchment conditions [https://web2py.pathirana.net/urbangreenblue/default/index LINK]]] | <div style="overflow: hidden">[[File:web2py swmm interface.png|thumb|right|350px|SWMM model results under different catchment conditions [https://web2py.pathirana.net/urbangreenblue/default/index LINK]]]</div> | ||
===[https://rwh1.apps.pathirana.net/ Calculating Rainwater Harvesting Potential for Small Islands]=== | ===[https://rwh1.apps.pathirana.net/ Calculating Rainwater Harvesting Potential for Small Islands]=== | ||
Line 62: | Line 63: | ||
[[File:rwh calculator results.png|thumb|right|350px|Rainwater harvesting calculator results.[https://rwh1.apps.pathirana.net/ LINK]]] | <div style="overflow: hidden">[[File:rwh calculator results.png|thumb|right|350px|Rainwater harvesting calculator results.[https://rwh1.apps.pathirana.net/ LINK]]] </div> | ||
[https://rwh1.apps.pathirana.net/ LINK] | [https://rwh1.apps.pathirana.net/ LINK] | ||
Line 69: | Line 70: | ||
The tool allows the user to choose this by providing the hourly rainfall rate and number of hours over which that intensity will continue. After providing the size of the infiltration pit, whether it is filled with gravel or just empty and the surrounding soil type, the user can calculate the performance of the system. The results are provided as a graphic as well as graph of water level in the structure and any overflow. | The tool allows the user to choose this by providing the hourly rainfall rate and number of hours over which that intensity will continue. After providing the size of the infiltration pit, whether it is filled with gravel or just empty and the surrounding soil type, the user can calculate the performance of the system. The results are provided as a graphic as well as graph of water level in the structure and any overflow. | ||
[[File:infil calculator results.png|thumb|right|350px|Groundwater recharge calculator results[https://infil1.apps.pathirana.net/ LINK]]] | <div style="overflow: hidden">[[File:infil calculator results.png|thumb|right|350px|Groundwater recharge calculator results[https://infil1.apps.pathirana.net/ LINK]]] </div> | ||
[https://infil1.apps.pathirana.net/ LINK] | [https://infil1.apps.pathirana.net/ LINK] |
Revision as of 09:11, 23 October 2020
Webapps with python
Python has a number of libraries that makes creating graphics based on data. Some of these tools can create interactive graphics and also web applications so that one can allow non-programmers to explore, analyse and visualize data. Ploty Dash is such a library with a particularly easy learning curve.
Here are some prototype applications that were created using this library. I use docker containers based on dokku -- a PaaS (Platform as a Service) --to host these apps.