Articles on funnelferry's Bloghttps://blogs.python-gsoc.orgUpdates on different articles published on funnelferry's BlogenMon, 26 Aug 2019 18:07:49 +0000Final Blog - A Journey full of learningshttps://blogs.python-gsoc.org/en/funnelferrys-blog/final-blog-a-journey-full-of-learnings/<p><strong>Name</strong> : Anveshan Lal</p> <p><strong>Organisation</strong> : Mission Support System (Python Software Foundation)</p> <p><strong>Mentors</strong> : Joern Ungermann, Jens-Uwe Grooß</p> <p><strong>Project</strong> : <a href="https://summerofcode.withgoogle.com/projects/#5105239412178944">Updating Geographical Plotting Routines</a></p> <p><strong>Project Code</strong> : <a href="https://bitbucket.org/wxmetvis/mss/pull-requests/694/gsoc2019-funnelferry/diff">Pull Request referencing project code</a></p> <p><strong>Commit log</strong> : <a href="https://bitbucket.org/wxmetvis/mss/pull-requests/694/gsoc2019-funnelferry/commits">All the commits comprising the all the progress of project</a></p> <p>A detailed report about my GSoC project regarding migration of basemap dependent code to Cartopy.</p> <h2>Dependencies</h2> <p>Aside from the dependencies required to run MSS:</p> <pre>$ conda install cartopy </pre> <p>I would detail the progress by headlining the project in 3 parts</p> <h2>1. Server Side Migration</h2> <p>This address changes in code in respect to files:</p> <p><code>mss/mslib/mswms/mpl_hsec.py</code></p> <p><code>mss/mslib/mswms/mpl_hsec_styles.py</code></p> <h3>Current State</h3> <p>Server side is complete with all the previous functionality retained</p> <h3>Remaining Progress</h3> <p>None</p> <h3>Unresolved Issues</h3> <p>Map produced is almost aligned with client perfectly but it is not 100 %</p> <h3>Relevant Pull-Requests</h3> <p><a href="https://bitbucket.org/wxmetvis/mss/pull-requests/643">https://bitbucket.org/wxmetvis/mss/pull-requests/643</a></p> <p><a href="https://bitbucket.org/wxmetvis/mss/pull-requests/651">https://bitbucket.org/wxmetvis/mss/pull-requests/651</a></p> <p><a href="https://bitbucket.org/wxmetvis/mss/pull-requests/653">https://bitbucket.org/wxmetvis/mss/pull-requests/653</a></p> <p><a href="https://bitbucket.org/wxmetvis/mss/pull-requests/654">https://bitbucket.org/wxmetvis/mss/pull-requests/654</a></p> <h2>2. Client Side Migration</h2> <p>This address changes in code in respect to files:</p> <p><code>mss/mslib/msui/mpl_map.py</code></p> <p><code>mss/mslib/msui/mpl_qtwidget.py</code></p> <p><code>mss/mslib/msui/mpl_pathinteractor.py</code></p> <p><code>mss/mslib/msui/topview.py</code></p> <h3>Current State</h3> <p>User Interface is perfectly functional and all the functionality is retained including the interaction of waypoints and functions related to it.</p> <h3>Remaining Progress</h3> <p>If the time allowed I would have like to exploit Cartopy's native ability to plot Geodetic Circular Paths, instead of the current manual solution.</p> <h3>Unresolved Issues</h3> <p>None</p> <h3>Relevant Pull Requests</h3> <p><a href="https://bitbucket.org/wxmetvis/mss/pull-requests/656">https://bitbucket.org/wxmetvis/mss/pull-requests/656</a></p> <p><a href="https://bitbucket.org/wxmetvis/mss/pull-requests/671">https://bitbucket.org/wxmetvis/mss/pull-requests/671</a></p> <h2>3. Added Support for EPSG</h2> <p><code>mss/mslib/msui/mpl_map.py</code></p> <p><code>mss/mslib/utils.py</code></p> <h3>Current State</h3> <p>All the epsg's previously present and additional EPSG's added are supported by the program. This includes the epsg which were non-functional from Cartopy's in-house function to plot epsg codes directly and all others Cartopy already supports.</p> <h3>Remaining Progress</h3> <p>There exists a large number of EPSGs (in excess of 4300), I couldn't test all of them but did encountered few which are not yet supported by Cartopy like <code>2985</code>, <code>2986</code>, <code>7415</code>. With more testing there ought to be more which are still not supported by Cartopy but a large number of them are.</p> <h3>Relevant Pull Requests</h3> <p><a href="https://bitbucket.org/wxmetvis/mss/pull-requests/684">https://bitbucket.org/wxmetvis/mss/pull-requests/684</a></p> <p><a href="https://bitbucket.org/wxmetvis/mss/pull-requests/691">https://bitbucket.org/wxmetvis/mss/pull-requests/691</a></p> <h2>Testing</h2> <p>Since the project in large part required me to maintain previous functionality there was not much scope to create new tests, but I did add two tests; One to test for a new function I added and the other test for EPSGs.</p> <h3>Failed Tests:</h3> <p>Pytest shows 2 tests failed although the failed tests seem to relate to a working and manually tested functionality of adding and removing point on waypoint interactor.</p> <h2>Acknowledgement</h2> <p>I would like to thank Joern Ungermann who mentored me throughout summer and actively helped me better the program and code, and also provided valuable feedback frequently. I would also like to express my gratiude towards MSS community including Reimar Bauer, Jens-Uwe Grooß and Shivashish Padhi who have been very welcoming from the start and helped get started and be familiar with MSS despite my serious lack of programming expertise and made my summer experience really great.</p>anveshanrx8@gmail.com (funnelferry)Mon, 26 Aug 2019 18:07:49 +0000https://blogs.python-gsoc.org/en/funnelferrys-blog/final-blog-a-journey-full-of-learnings/Week 10: Cartopy's EPSGhttps://blogs.python-gsoc.org/en/funnelferrys-blog/week-10-cartopy-s-epsg/<p>What did you do this week?</p> <p>This week I started adding support to plot the projections from EPSG code natively using Cartopy's own feature `epsg([epsg code])` from its CRS class.  Apart from that I also successfully corrected the feature to disable or enable gridlines for map which was broken while migrating the UI side code to Cartopy.</p> <p>What is up next? </p> <p>This, EPSG support, still needs a lot more refinement and the way UI handles it is still needs a little improvement so I will work on that in the coming week just before the final evaluation week.</p> <p>Did you faced any blockers?</p> <p>Yes, I did faced a couple of blockers specially with enable/disable of gridlines but eventually looking up the documentation it got solved in not much time.</p>anveshanrx8@gmail.com (funnelferry)Mon, 19 Aug 2019 03:15:22 +0000https://blogs.python-gsoc.org/en/funnelferrys-blog/week-10-cartopy-s-epsg/Week 9: Perfecting the UIhttps://blogs.python-gsoc.org/en/funnelferrys-blog/week-9-perfecting-the-ui/<p><strong>What did you do this week?</strong></p> <p> </p> <p>During this week I revaluated my work and also worked on perfecting various parts of migrated (to cartopy) interface of MSS addressing various important functionalities. Mainly worked on making the coastlines - enable/disable feature to work perfectly, Apart from that rewrote the code to accomodate the plotting of gridlines for stereographic projections.</p> <p> </p> <p><strong>What is coming up next?</strong></p> <p>After this I will work a little more on UI, still some things yet to work correctly, like enable/disable of gridlines.</p> <p> </p> <p><strong>Did you faced any blockers?</strong></p> <p>No I did not faced any blockers here.</p>anveshanrx8@gmail.com (funnelferry)Thu, 15 Aug 2019 16:21:08 +0000https://blogs.python-gsoc.org/en/funnelferrys-blog/week-9-perfecting-the-ui/Week 8: Appearances and WMS serverhttps://blogs.python-gsoc.org/en/funnelferrys-blog/week-8-appearances-and-wms-server/<p><strong><span style="font-size: 14px;">What did you do this week?</span></strong></p> <p>As planned, since the basic working of topview with all the code migrated to cartopy was fine. But now I needed to address all the bugs and make sure the working of each functionality and if any bug then bring it to working state. So building up on that my mentor identified few errors, one of which was the absolutely rubbish image being projected when using through WMS server. I was a little lost and experimented with wrong stuff and diverted a little more of my time than needed; basically I thought the issue is definitely being traced back from wms_control.py but infact it was merely the absence of keyword `extent` from function `imshow`. Other than that I also worked on the appearance feature to change color of water bodies which previously didn't worked unless you restart mss.</p> <p><span style="font-size: 14px;"><strong>What is coming up next?</strong></span></p> <p>I think the current plan is to remove any source of crash in program through the interface and then proceed to rewrite tests which were basemap specific. Yes I did </p> <p><span style="font-size: 14px;"><strong>Did you get stuck anywhere?</strong></span></p> <p>Apart from tracing back the issue to imshow function, No I did not get stuck anywhere.</p>anveshanrx8@gmail.com (funnelferry)Mon, 22 Jul 2019 20:51:31 +0000https://blogs.python-gsoc.org/en/funnelferrys-blog/week-8-appearances-and-wms-server/Week 7: Waypoints and their Interactionhttps://blogs.python-gsoc.org/en/funnelferrys-blog/week-7-waypoints-and-their-interaction/<p>What did I do this week?</p> <p>I restored most of previous functionality I stripped off for simpler progress. Further major time was spent on getting the working of waypoints correct. After changing most of plotting routines into cartopy, the waypoints were working with all their functions but thy lost functionality and couldn't adapt to change in projection. So I also worked on solving that and did solved it at the end.</p> <p>What is up next?</p> <p>Currenty, testing for bugs and making sure the correct functionality of all the option controls like:</p> <p>    1. WMS<br>     2. KML<br>     3. Satellite</p> <p>Apart from that options to manually enable/disable the features and changing the color is also to be done.</p> <p>Did you get stuck anywhere?</p> <p>Yes, I think solving the waypoints issue maybe took a bit more time than needed but I think it was necessary for a confidence boost to me about my abilities to debug and trace the most delicate issues and solve them on my own. </p>anveshanrx8@gmail.com (funnelferry)Fri, 19 Jul 2019 19:58:10 +0000https://blogs.python-gsoc.org/en/funnelferrys-blog/week-7-waypoints-and-their-interaction/Week 6: Client side and OOPhttps://blogs.python-gsoc.org/en/funnelferrys-blog/week-6-client-side-and-oop/<p>What I did?</p> <p>I worked on client side by migrating functions written in basemap and creating the instance of topview to generate plot in cartopy</p> <p>What is next?</p> <p>Actually a lot, Apart from generating a basic plot, there still a lot to go, before doing this I removed a lot of functionality and this process worked for me in server side as suggested by my mentor who has been immensely helpful towards guiding me.</p> <p>Did you get stuck?<br>  </p> <p>Yes, I was able to plot a blank canvas but could not display the map, my mentor diagnosed and proposed a solution further I could not generate different maps from drop down menu but after little bit of playing around I solved that. So yes, I am on way of doing this.</p>anveshanrx8@gmail.com (funnelferry)Tue, 09 Jul 2019 13:03:01 +0000https://blogs.python-gsoc.org/en/funnelferrys-blog/week-6-client-side-and-oop/Week 4: Finishing up first evaluationhttps://blogs.python-gsoc.org/en/funnelferrys-blog/week-4-finishing-up-first-evaluation/<p>What did you do this week?</p> <p>I have been working on completing up the server side functionality, that is, completing removing basemap's use from there and make sure every coded part in cartopy is working properly, further adding the ability to plot 'barbs' using cartopy.</p> <p>What is coming up?</p> <p>Completing everything related to back end and moving on to migrate the front end of code base is my next task</p> <p>Did you get stuck anywhere?</p> <p>Yes, I had several errors in contourf function but later were resolved when I scoured the issue tracker of Cartopy on github.</p>anveshanrx8@gmail.com (funnelferry)Sun, 30 Jun 2019 17:55:10 +0000https://blogs.python-gsoc.org/en/funnelferrys-blog/week-4-finishing-up-first-evaluation/Week 3: Server-side about to finishhttps://blogs.python-gsoc.org/en/funnelferrys-blog/week-3-server-side-about-to-finish/<p>What did I do this Week?</p> <p>This week I tranlated all the required functionality for mpl_hsec.py to generate  plot and rewrote the get_projection_params to interpret projection parameters in accordance with cartopy ways</p> <p>What is coming up?</p> <p>Mpl_hsec_styles.py contains the plot styles responsible for contours, barbs, quivers and overlay of necessary data, Finishing this will be the end of migration of server-side code.</p> <p>Did you get stuck anywhere?</p> <p>I did get stuck, at one point the correct cartopy code was not producing any plots and that was case the everywhere on the system, on a jupyter notebook or in a standalone script, but then I found the solution in another related issue from issue tracker of Cartopy.</p>anveshanrx8@gmail.com (funnelferry)Thu, 20 Jun 2019 21:38:23 +0000https://blogs.python-gsoc.org/en/funnelferrys-blog/week-3-server-side-about-to-finish/Week 2: Basic plot into the serverhttps://blogs.python-gsoc.org/en/funnelferrys-blog/week-2-basic-plot-into-the-server/<p><span style="color: #16a085;"><span style="font-size: 16px;">What did I do this week?</span></span></p> <p><span style="font-size: 14px;">This week I worked on to getting a basic plot as output as a result of changing from basemap to cartopy.</span></p> <p><span style="font-size: 14px;">As suggested by my mentor I basically removed all the features that were there with basemap and just tried to get a plain map working, from here I will try to rebuild those specifics in cartopy.</span></p> <p><span style="font-size: 14px;">Further I wrote one small test for the a function I added which basically emulated a similar function in pyproj.</span></p> <p><span style="color: #16a085;"><span style="font-size: 16px;">What is coming up next?</span></span></p> <p><span style="font-size: 14px;">Building on the previous work I would emulate the features previously available in basemap with also taking advantage of cartopy's other features to make the task easier and code shorter than it would have been with basemap and have a result plot plotted through the WMS successfully.</span></p> <p><span style="color: #16a085;"><span style="font-size: 16px;">Did you get stuck anywhere?</span></span></p> <p><span style="font-size: 14px;">Yes I got stuck a few number of places some of which my mentor helped me got through, one where I had to strip the code of a function to bare minimum for it to be function but I got through with a little bit of time.</span></p>anveshanrx8@gmail.com (funnelferry)Mon, 10 Jun 2019 18:24:48 +0000https://blogs.python-gsoc.org/en/funnelferrys-blog/week-2-basic-plot-into-the-server/Week 1: Starting the migration!https://blogs.python-gsoc.org/en/funnelferrys-blog/week-1-starting-the-migration/<p><span style="font-size: 18px;">Hello all, I am Anveshan and have completed my first week of coding period, learning variety of things about Cartopy package which is used for plotting tasks as matplotlib's basemap is </span></p> <p><span style="font-size: 24px;">What did you do this week?</span></p> <p><span style="font-size: 18px;">I changed functions in ```utils.py```, that made use of basemap's pyproj class for the following two tasks using cartopy package:</span></p> <ul> <li><span style="font-size: 18px;">To get distance between two points</span></li> <li><span style="font-size: 18px;">To compute intermediate points between two coordinates on basis of connection type (circular or linear)</span></li> </ul> <p><span style="font-size: 24px;">What is coming up next?</span></p> <p><span style="font-size: 18px;">I will assess and start making changes ```mpl_hsec.py``` which is a constituent of server side code and makes of basemap heavily for the horizontal plotting operations, and is also used by ```mpl_hsec_styles.py``` as a superclass.  </span></p> <p><span style="font-size: 24px;">Did you get stuck anywhere?</span></p> <p><span style="font-size: 18px;">Yes I had a difficulties in making the function ```ntps``` from basemap in cartopy but I got through it with help of stackoverflow and cartopy's documentation.</span></p>anveshanrx8@gmail.com (funnelferry)Tue, 04 Jun 2019 17:37:37 +0000https://blogs.python-gsoc.org/en/funnelferrys-blog/week-1-starting-the-migration/Week 0: Entering Coding Periodhttps://blogs.python-gsoc.org/en/funnelferrys-blog/week-0-entering-coding-period/<p><span style="font-size: 14px;">Hello all, I am Anveshan Lal and during this GSoC I will be working on ‘Updating Geographical Plotting Routines’ for Mission Support System.</span></p> <p><span style="font-size: 16px;"><span style="color: #1abc9c;">What did you do this Week?</span></span></p> <p><span style="font-size: 14px;">I looked into the codebase of MSS and after discussion with my mentor I divided the parts of code I will be working towards. Also, I read up the documentation of Cartopy and played around with the relevant Geodesic functions required by the codebase through the help of Jupyter Notebooks.</span></p> <p><span style="font-size: 16px;"><span style="color: #1abc9c;">What is coming up next Week?</span></span></p> <p><span style="font-size: 14px;">Starting this week I will be migrating the server side code of MSS to Cartopy package and will complete that task by next week.</span></p> <p><span style="font-size: 16px;"><span style="color: #1abc9c;">Did you get stuck anywhere?</span></span></p> <p><span style="font-size: 14px;">I had some doubts in how to approach and start making changes to codebase which were resolved during a voice-over meeting with my mentor. Other than that I do not have any major blockers regarding my project currently.</span><br>  </p>anveshanrx8@gmail.com (funnelferry)Thu, 30 May 2019 10:32:07 +0000https://blogs.python-gsoc.org/en/funnelferrys-blog/week-0-entering-coding-period/