<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Aryan Gupta on Medium]]></title>
        <description><![CDATA[Stories by Aryan Gupta on Medium]]></description>
        <link>https://medium.com/@wwaryan?source=rss-f6a9c79d65f5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*5kQsGxHTE3azlx0yWIhhPg.png</url>
            <title>Stories by Aryan Gupta on Medium</title>
            <link>https://medium.com/@wwaryan?source=rss-f6a9c79d65f5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 18:12:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@wwaryan/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The CERN OpenLab FAQ : Frequently Answered Questions.]]></title>
            <link>https://medium.com/@wwaryan/the-cern-openlab-faq-frequently-answered-questions-68b49532c89d?source=rss-f6a9c79d65f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/68b49532c89d</guid>
            <category><![CDATA[cern-openlab]]></category>
            <category><![CDATA[cern]]></category>
            <category><![CDATA[summer]]></category>
            <category><![CDATA[internships]]></category>
            <category><![CDATA[faq]]></category>
            <dc:creator><![CDATA[Aryan Gupta]]></dc:creator>
            <pubDate>Sat, 08 Apr 2023 06:45:13 GMT</pubDate>
            <atom:updated>2023-04-30T16:52:45.967Z</atom:updated>
            <content:encoded><![CDATA[<h3>The CERN OpenLab FAQ : Frequently Answered Questions.</h3><p>Hi, I am Aryan. I was a CERN OpenLab Student in Summer 2022. In this article, I will be compiling my responses to the many <em>many </em>similar queries that I receive regarding CERN &amp; its summer programmes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wW_5CUsDa_DEKdjL" /><figcaption>One of the stickers on my laptop :))</figcaption></figure><p>Though I’m happy answering these queries in general, I’m usually inundated with several forms of the same questions. Owing to paucity of time (&amp; recollection of memory), I found it better to gather those responses and present them in the form of a questionnaire-blog.</p><p>The idea primarily comes from Swapneel Mehta’s <a href="https://mehtaver.se/cern-openlab-internship/">blog</a> on his experiences at CERN, which I feel are quite complete in themselves. However, it’s been a couple of years since and still, there evidently exists a lot of doubt— about the process, application, expectations and experiences of the program. Personally, I don’t appreciate gatekeeping of opportunities and I hope this is a positive step in that direction.</p><p>Again, this is based on my experience and therefore my first advice would be to take the following with a grain of salt. Follow it up with your own research too!</p><h3>General Questions</h3><h4><strong>1. What’s the difference between the CERN OpenLab &amp; the Summer Student Programme? Which one should I apply for?</strong></h4><p>The OpenLab programme offers students the opportunity to participate in a 9 week summer programme, working in collaboration with CERN and a leading tech company (like Oracle, IBM, Intel etc), where the projects are more about innovation, computing and research. Students usually get to work on advanced technical projects with both CERN and the company. About 32 students were selected for the OpenLab programme in 2022.</p><p>The Summer Student programme differs in some aspects — the projects here might be focused on computing, or physics or both. These are CERN specific projects and the duration of the programme varies from 9 to 13 weeks depending on the project. About 150 + students were selected for the Summer Student programme in 2022.</p><p>It goes without saying that you should apply for both! The number of applicants for the OpenLab programme was about 1700, so the odds are quite dicey. You can find more information about the programs <a href="https://careers.cern/summer">here</a>.</p><h4><strong>2. I have been rejected before. What did you do different?</strong></h4><p>I understand how you feel. I’ve been in the same place many times. Rejection is part and parcel of life — it means that you tried. Rejections do push you down; but they definitely make you appreciate your wins even more. <em>Don’t keep expectations, but do keep hope!</em></p><p>To be frank, I have applied to CERN and other programs numerous times — and I got really lucky this one time. In my 3rd year, I got rejected for all three CERN programs (OpenLab, Summer Student, Technical Student). In my 4th year, I received about 15 rejections from research internship programs including one from the CERN Summer programme (again). But I finally got into the CERN OpenLab programme :))</p><p>CERN is not looking for people with the best profiles — they are just looking for people having relevant skills for the projects they are working on. So, sometimes we might not fit the bill. But we surely can make an effort to present our best in our application. To know what you could have done differently, read on!</p><h4>3. How was your experience at CERN?</h4><p><em>It was amazing.</em></p><p>I really want to pen down every moment I’ve spent at CERN &amp; Europe — I can vividly recollect all of those days. It’s been more than 6 months since, but I still feel that they have been the best 2.5 months of my life, yet. I hope to get more opportunities like this in the future! I might write a blog, but it would probably end up as a shot by shot remake of my days there :D</p><p>As for the experience, the projects can be challenging — but you get enough time to complete a major chunk of it at least. You also have daily scrum meetings to clear your doubts and showcase your progress. The mentors are quite helpful but let you work independently. Team mates are super helpful (Cheers to Adrian, Antonio, Artur, Diego, Hubert, Jakub, Ioannis, Ivan &amp; Nem)! I worked at CERN on an Oracle based project. The work-life balance is superb and contributing to CERN feels awesome. It felt so great walking through the CERN gates each day, with your CERN ID. For me, the time I spent in front of my screen working wasn’t the main highlight of the internship, it was the life experiences I had there.</p><p>The OpenLab group went on tours to the different CERN Experiments (ALICE, ATLAS, CMS, Data Centre, SPS, Globe) and so on. We saw the famous computer where WWW was born! We lived in France and hopped over the border to CERN in Geneva, Switzerland, every day for work. We had crazy outings and parties every day — explored many cantons and cities of Switzerland and France over the 9 weeks. The best part was making friends from all around and travelling to these places with them. At the end of the internship, I did a 10 day solo backpacking trip to Germany, Italy &amp; France :))</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*kyTyby3hAQKtP6qyLXIEqQ.gif" /><figcaption>How I tell it (to anyone within earshot)</figcaption></figure><p>You can find a small slideshow of my summer right <a href="https://indico.cern.ch/event/1191490/contributions/5039049/attachments/2509271/4312882/CERN%20openlab%20summer%20students%202022_photo_slides%20(2).pdf">here</a>!</p><h4>4. <strong>Do you know of other such internship opportunities and also when would you say is the best time to apply for them during one’s undergrad?</strong></h4><p>There are many compiled lists of opportunities that you can find on Github — both for <a href="https://github.com/himahuja/Research-Internships-for-Undergraduates">research internships</a> as well as <a href="https://github.com/deepanshu1422/List-Of-Open-Source-Internships-Programs">open source programs</a>. Thanks to these selfless people who maintain such lists! Do note that these are non-exhaustive and you will definitely find tens of opportunities that very few know of, if you are down to putting in effort and dig deep.</p><p>For research internships, it’s better to start applying from the 3rd year itself. These internships are quite prestigious and hence competitive, so do try to work on your profile before applying. It helps to have good projects and recommendation letters when you apply, so keep those handy. Also, cold-mailing and being active on Twitter works wonders, so do try that too.</p><h3>Questions about the Application, Process, Selection &amp; Recruitment</h3><h4>1. What is the recruitment process like? How long does it take for the results to be declared? Do we get a rejection mail?</h4><p><em>I like how this question was both hopeful yet realistic.</em></p><p>The recruitment process and selection criteria is not that clear. The application process is straightforward, as on the website. Sometimes there might be interviews — if there are many strong candidates for the same project, but its rare.</p><p>The deadline for my application was Jan 31, 2022. I submitted my application on Jan 30 (as expected). I received the selection letter on March 18, 2022, which is quite a special day for many reasons — one namely being that it was Holi!!</p><p>The general timeline of the summer programmes is that the applications close by January end and the selected candidates are informed around mid-March. It takes a while to confirm the affirmation from the candidate’s side — if they reject the offer (which is rare), the offer is passed on to the reserved candidates. After the selections are confirmed, the rejection mails are sent by mid April.</p><p><em>(How do I know this?) — I’ve gotten several of those from CERN too :))</em></p><p>From the patterns observed, we can surmise that the recruitment is done based on the projects proposed by the supervisors. If a candidate’s profile matches the supervisor’s requirements in terms of skills, projects and past experience, then they are selected for that particular project. In some cases, if there are many profiles which fit a project, you might have a call with your potential supervisor.</p><h4><strong>2. Would you mind sharing your resume and cover letter with me, if that would be all right? I would be very grateful.</strong></h4><p>As a norm, I don’t share resume/ cover letters — they are nothing exceptional tbh. I don’t think it can help somebody. I feel this article can, that’s why I’m sharing it openly. You can see my <a href="https://www.linkedin.com/in/wwaryangupta/">LinkedIn</a> to figure out my CV. I used a Latex template to build it, if it helps (it doesn’t). The content of the CV matters more.</p><p>The best part about the application process, which I realize is also the most confusing one for applicants, is the scarce amount of information that you have, to go on about CERN. The projects have not been proposed, CERN is some other worldly place that you usually find out about in conspiracy videos late in the night. So, your best bet becomes to put your most authentic self and work out there and hope for the best.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*v3muk01wpvH5ngHTj8VGVw.gif" /><figcaption>:)</figcaption></figure><p>CERN is looking for talented people interested in contributing to impactful projects and have a good grasp of the technical skills required. They don’t need experts for that. So, having a project in your CV, which uses a technical skill being used at CERN, will get you further than having 5 stars on LeetCode in your CV.</p><p>You only have a few cards in your hands, and you just have to play that right. Your best bet is you.</p><h4>3. <strong>Could I please know what the general structure for the motivation letter you used for the application? Any other samples I should read before drafting my own ? Could please share a couple of advice on making the CV, and Motivation Letter and how you got into it?</strong></h4><p><em>This is a better phrased question, so I would elaborate a bit more here.</em></p><p>I didn’t read any samples specifically for CERN, but the reason is that I have written quite a many Motivation Letters/ SoPs/ Cover Letters after reading through many of them before. It’s a good idea to read drafts available, as Swapneel rightly puts it — using the infinite wisdom of the internet. Some of you might try ChatGPT, but I like the good old ways where you did all the hard work for yourself, not have a robot do it for you. Anyways, my point being, do read as many as you can, <strong>BUT</strong> only after writing a rough draft by yourself. Otherwise, you’re just being influenced by others and don’t have an original draft. (See gif above)</p><p>There is no fixed format for the CV or the Motivation Letter — just make sure you highlight features, traits, skills that the projects at CERN might require. Its better to find a balance between the variety of skills and your expertise (projects, work ex) in those skills too. Motivation Letters are unique to each individual, so try to use your experiences to show why you are a worthy candidate for the programs. There’s no guarantee that a certain kind of profile would be selected as the review system is not known. So, just give it your best shot and apply with a great application!</p><h4><strong>4. I don’t understand this question- Please give details of any interest (and ideally, experience) in specific topics (such as data acquisition, triggers, detector building, simulations, machine learning, quantum technologies…) or CERN experiments. I don’t know much about these topics. Would you mind telling me what you wrote here? I would be very grateful.</strong></h4><p>It is basically telling you about the different kinds of tasks being done at CERN. As an undergrad, you are not expected to know about all this, unless you are pursuing your studies in similar fields. However, it is <em>preferable </em>if you know a bit about it. Just look up CERN experiments — CMS, ATLAS, ALICE, LHCb, read up on them along with the terms mentioned.</p><h4>5. I understood that the recruitment process at CERN consists of a video interview with questions flashing on the sreen. Do you have any tips on tackling that?</h4><p>For the OpenLab process (2022) — we just had to fill up the application form, provide LoRs, Motivation Letters — the normal stuff. There was no video interview.</p><p>I think the asynchronous video interview happens for the Technical Students Program. In any case, its just the basic 5 questions you find in the mock interview — ‘Tell us something about yourself’ . The process is simple, just memorize your answers and when the interview starts, just present yourself well. Its a one-sided interview, you are just recording yourself answering the questions in stipulated time. Its just to see if you are a good fit communication and personality-wise for CERN.</p><h4>6. With respect to the in-person interview, what types of questions should I expect in broad terms. DSA? Theory or design?</h4><p>Again, there was no in-person interview. I think that’s for Technical Students again. CERN usually focuses on your past work than your DSA skills. If you have good projects, then you already stand a good chance. Open source contributions help a lot (imo).</p><h3>Advice &amp; Tips</h3><h4><strong>Could you provide any advice for applying to the program? How can I make my application stand out from other applicants? What do you think CERN is looking for in applicants?</strong></h4><p><em>You can make your application stand out by doing your background research well and in time, redrafting your cover letter and having a decent profile. Added some pointers below.</em></p><h4><strong>Don’t doubt yourself.</strong></h4><p>Inexperience != Incompetence.</p><p>Smart work &gt;&gt; Hard work (wrong). It’s just about being smart in your hard work.</p><p>Don’t compete, don’t compare, be your authentic self.</p><p>Working at CERN and/or on CERN projects is an amazing experience, which makes it such a competitive opportunity. The application is straightforward, the recruitment process is unknown. The people I have worked with are talented; they have done something cool before and totally deserve being there. But its not like they are prodigies, you know? You just need to be a good fit for the program + some luck that the supervisor likes your profile.</p><blockquote>I, for one, feel that I lucked out. Totally. And that’s fine. Because I acknowledge the privilege that comes with such luck and I’ve worked sincerely to merit that privilege :)</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*BcbJQbOfftX-mkXRqBPqGA.gif" /></figure><p>I believe they look for candidates with a strong yet diverse profile — its also luck, as they are only hiring for some particular projects which require a specific set of skills, so even if you’re a strong candidate, sometimes you don’t get selected because they are not looking for those skills.</p><blockquote>As my openlab mate puts it — ‘CERN is also betting on applicants as well. Even if you read a CV &amp; LoR, CERN still doesn’t really know how the person works, especially in collaborative work environments’. They are willing to take a chance on you.</blockquote><p>Since you’ll never feel you’re good enough, just apply. But don’t just <em>apply</em> for the sake of it, give it your all. There’s a high chance on luck — but you can help optimize the rest of the part :))</p><h4>Previous year projects</h4><p>The projects at CERN demand a balance between niche and adaptive generalized skills. To know what these skills are, it goes without saying that you should check out previous year projects. It will help you understand the kind of work done at CERN; and the technical stack needed for them.</p><p>Projects at CERN can be research or development based. My mates and I were working on projects related to Devops &amp; Gitops — Databases &amp; Software Development (Python, C++ , maybe Java) — Machine Learning &amp; Deep Learning (Anomaly detection, forecasting, creating supervised/unsupervised models) — Electronics based software development (like Verilog) — Hardware programming — Quantum based projects like Computing, AI (eg. Quantum reinforcement learning).</p><p>Pro tip: To get an idea of the teams and projects, you can take a look at other programs (like the Origin program) which publishes relevant projects and teams at CERN which are up for grabs. Though these projects are not meant for students, but they can give you a fair idea of what to expect. This can help you figure out which of your skills to highlight in your application.</p><p>If you highlight those well enough in your profile, it increases your chances of getting noticed, at the very least. The background research will also help you write a better motivation letter for your CERN application.</p><p>Follow some of the news releases too to know about past projects, such as <a href="https://openlab.web.cern.ch/news/23-sep-2022/cern-openlab-trains-next-generation-computing-experts">this</a> and <a href="https://home.cern/news/announcement/computing/cern-openlab-summer-students-present-online-lightning-talks">this</a> for OpenLab 2022 projects.</p><h4>Application Documents</h4><p>CERN wants to get a holistic view of you — and that’s why they ask for certain documents. Your transcripts help them know what subjects you’ve taken and if you’ve been consistent in your work. Also helps if you have some subjects in your curriculum which can assist with the work you will doing here. You don’t need to have a 10 CGPA, don’t need to be an over-achiever. Decent is fine.</p><p>For the Letter of Recommendation (LoR), its good to have one from your university and one from an internship/previous employer. It also helps if its in the field you wish to apply for (there are some fields mentioned in the application form which you can choose from). I think LoR is quite important because many people are good at the coding stuff, so LoRs can help the supervisors choose, based on the experiences shared by those who wrote your LOR. Make sure your LOR is super personal and is not generic. (I guess you might already know that).</p><p>Resumes/ CVs are quite important, as they show your background and experiences. Its important to have a specific <strong>tailored</strong> CV — in terms of field of work, interests etc. Helps them to make sure you are the right candidate.</p><p>Website helps you put stuff you can’t stuff in your CV.</p><p>Your Motivation/ Cover Letter should be unique, personal and should show how important CERN is to you. Your research will help you show your keen-ness in your letter. Revise your letter thoroughly till you feel its good enough to submit (it never is, but still).</p><blockquote>P.S. I didn’t do most of the above (atleast consciously). BUT YOU ALL SHOULD.</blockquote><p>I hope this article has been helpful. Thank you for reading. All the best &amp; see you at CERN!</p><p><em>Yours without wax,<br>Aryan</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=68b49532c89d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What shapes up the narrative of a social movement online?]]></title>
            <link>https://medium.com/@wwaryan/what-shapes-up-the-narrative-of-a-social-movement-online-140d3190b54f?source=rss-f6a9c79d65f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/140d3190b54f</guid>
            <category><![CDATA[twitter-analysis]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[mainstream-media]]></category>
            <category><![CDATA[social-movements]]></category>
            <category><![CDATA[influencers]]></category>
            <dc:creator><![CDATA[Aryan Gupta]]></dc:creator>
            <pubDate>Fri, 29 Apr 2022 16:17:31 GMT</pubDate>
            <atom:updated>2022-05-01T09:25:34.472Z</atom:updated>
            <content:encoded><![CDATA[<h4>Analyzing Twitter Data of India’s farmers protests of 2020–2021.</h4><h3>What Shapes up the Narrative of a Social Movement online?</h3><h4>Influence of Social &amp; Mainstream Media in the Farmers’ Protest.</h4><p><em>Note : This post was written around August 2021, as part of the capstone project for Data Science at </em><a href="https://www.equitechfutures.com/esp"><em>EquiTech Futures Scholar’s Program</em></a><em> 2021. As the protests ended in December 2021, the article has since been updated.</em></p><blockquote>Social Movements are loosely organized efforts by a large group of people sharing a common purpose — to bring about social, political, economic, or cultural change.</blockquote><h3>Protesting in a Pandemic</h3><p>Throughout history, social movements have transformed the future. Large-scale protests play a pivotal role in shaping the political trajectory of countries round the world. To bring in reforms, it is essential that these movements attract the general public’s participation and sharing of similar sentiments. Traditionally, mass mobilization involves marches, hunger and work strikes, social campaigning and other forms of peaceful protests.</p><p>However, the <strong>onset of the global pandemic</strong> has significantly changed the way social movements take place. Many of these<a href="https://www.epw.in/engage/article/protests-pandemic-timeline-protests-2020"> movements</a>, internationally — Black Lives Matter, or nationally — CAA-NRC Protest or Farmers Protests commenced during the pandemic. Although the protests still happen on ground, mass mobilization has reduced, as the general public hesitate at putting their lives at risk by joining them. Activists have adapted to protest in novel ways in the pandemic. Climate Activist Disha Ravi said that campaigns have <a href="https://www.bbc.com/news/world-54477523#:~:text=New%20ways%20of%20protesting">digitalized</a>. In fact, in the past decade social media- especially Twitter- has become a potent tool for political organizations around the world.</p><p>Governments increasingly recognize the power of social media in shaping political discourse and respond by imposing a range of policy measures. For instance, governments frequently use <a href="https://edition.cnn.com/2021/02/01/asia/india-internet-cut-farmers-intl-hnk/index.html">internet outages</a> during political crises.</p><p>Amidst a lockdown, <strong>the source of news and influence</strong> depends vastly on the <strong>news being broadcasted</strong>, whereas the <strong>impact of the protest</strong> depends on <strong>how people react</strong> to the news. Otherwise, the movement stagnates and eventually fades into obsolescence. <strong>Alternatively</strong>, the protest can also go viral and reach people worldwide.</p><blockquote>So, what happens when farmers from a state from India revolt and protest against government laws amidst a pandemic?</blockquote><p>In this article, I will be analyzing how Twitter is being used to shape up a narrative for social movements — through the Farmers’ Protest in India.</p><h3>Farmers’ Protests of India (2020–2021)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/0*g5fzXEUJrca9uW-p.jpg" /><figcaption>The viral image that defines a protest — a paramilitary policeman swinging his baton at an elderly Sikh man.</figcaption></figure><p>The Farmers’ Protest in India involved the farmers protesting against three farm acts passed by the Indian Parliament in September 2020. The government of Narendra Modi presented the laws as reforms to open up new earning opportunities for farmers by strengthening the basic farm sector infrastructure through greater private investments. They insisted that the laws are necessary to modernize an archaic and outdated system of farm production.</p><p>Farmers, however, saw the dismantling of regulations, price controls, and public procurement commitments as a threat to their livelihoods. They feared that opening up the sector to corporate agribusinesses and financial interests will lead to greater polarization of landholdings. The farmers protested that the Minimum Support Price (MSP) system — a safety net given to the farmers to ensure guaranteed prices and assured markets, may get dismantled after the new farm laws are implemented and therefore, an emotive issue for the farmers of Punjab and Haryana, who benefit from MSP.</p><p>However, thanks to the rushed process by which the laws were passed and the government’s crackdown on dissent, what might have been a debate over agricultural economics instead became a political challenge to the ruling party. The government’s response to the protests raised questions about speech rights, internet freedoms and the stifling of opposition in a country of more than 1.3 billion people.</p><p>Thousands of farmers from across the country agitated at three Delhi border points — Singhu, Tikri and Ghazipur — against the three farm laws from November 2020 till December 2021, when the laws were finally repealed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3g-3Kf3ECP3e3rkzFJxTng.gif" /><figcaption>Timeline of the ongoing Farmers Protest (June 2020 — July 2021)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/986/1*bgQ7P3QhZCgBpxoxAJNaWQ.png" /><figcaption>What makes the protests so special.</figcaption></figure><blockquote>To examine how the Farmers’ Protest has been reported by news media channels, the Twitter posts from these channels were analyzed, and the engagement on these posts was used to gauge how the general public reacted to these news bytes.</blockquote><h3>Analyzing National News Channels</h3><p>The data for the analysis was collected from the popular national dailies Twitter pages, from July 2020 to July 2021 i.e. tweets related to the farmers protest.</p><p>To have an unbiased &amp; open perspective, 5 different Indian national news media channels have been used. As Farmers’ Protest originally dealt with 2 specific states of India, the diverse national coverage provides proof that the protest had become nationally important.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/621/1*KjFPZlN9lwbxQG6whnKSxQ.png" /><figcaption>Follower count of National News Media Channels on Twitter.</figcaption></figure><h4>How was the News Portrayed by National Media?</h4><p><em>How actively do news channels report social movements over time? Does Twitter show the real story?</em></p><p>News channels are <strong>inherently responsible</strong> for the rise and fall of a news piece. The initial reporting increases coverage and consistent press sustains the morale of the movement. Sometimes these movements are <strong>under-reported</strong> as well, <strong>to support political gains</strong>. Usually, long term movements get inundated by breaking news, reporting gradually decreases and the movement fades away.</p><blockquote>A relatively simple metric to measure the importance of an event is through the number of times a tweet on farmers protest was posted on a particular day.</blockquote><p>We can have a safe assumption that the<strong> higher frequency of tweets</strong> means that significance in events related to the Farmers protest.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*mQSSjjQpZg-MRSSqRaR6ZA.png" /><figcaption>Frequency of reporting by national media channels on Farmers Protest over the year.</figcaption></figure><p>Some common patterns can be recognized — The movement paces up in September when there is an uproar as the Bills are passed in Parliament. This is not a large peak as the news is mostly concentrated about the states of Punjab &amp; Haryana. There is a steep increase in reporting by November 26 — when the protesters march to Delhi, catching national attention. As the protests continue, there is a gradual decline in reporting.</p><p>In January end — February, there is a <strong>massive spike</strong> — the <strong>farmers protest go global</strong> as Rihanna, Greta Thunberg tweet about the injustices and speech rights issues going on in India, and the <a href="https://www.bbc.com/news/uk-55793731">Red Fort attack incident</a>. Then there is a smooth decline in reporting — not only because the movement became monotonous and mainstream, but there was heavy reporting about <a href="https://www.bbc.com/news/world-asia-india-57225922">Covid’s Second Wave</a> which overwhelmed India’s healthcare system, undercutting the news about Farmers.</p><p>Apart from tweet frequency, we can know more about the topics by measuring <strong>word frequencies</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/695/1*DDsyP3ZLxVC1FBNy5k2Xaw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/726/1*QHML_IMuikzStVf4Km38PA.png" /><figcaption>Word Frequency Distribution for Tweets by Times of India.</figcaption></figure><p>Times of India frequently tweets about the <strong>stakeholders</strong> of the protest, namely:</p><ul><li>Prime Minister Narendra Modi</li><li>Home Minister Amit Shah</li><li>Agriculture Minister Narendra Singh Tomar</li><li>Punjab Chief Minister Captain Amarinder Singh</li><li>Farmer Leaders from Bhartiya Kisan Union (BKU) Naresh &amp; Rakesh Tikait</li><li>Farmer Unions like India Kisan Sabha</li></ul><p>which shows a lot of political coverage. <em>Does using names increase the importance of the tweet? Does political associations give the tweet, or the protest, more validity?</em></p><p>Different ways of protests — Hunger strikes, Bharat Bandh (Nationwide strike), Tractor Rally have been mentioned. Although most of the farmers protest were peaceful protests, we see ‘Delhi Police’, violence and tear gas shells among high frequency words. The Red Fort incident also got a lot of coverage, despite the fact that it was a one day incident.</p><p>An interesting phrase is ‘Rs 18,000&#39;. Prime Minister Narendra Modi released over Rs 18,000 crore to more than nine crore farmer families under the <em>‘Pradhan Mantri Kisan Samman Nidhi’</em> (PM-KISAN) <a href="https://www.indiatvnews.com/news/india/pm-modi-rs-18000-crore-nine-crore-families-farmers-protest-farm-laws-673861">scheme</a>. This programme was announced amid the protests, and appears as a way to appease the farmers.</p><p><em>The fact that Times of India tweeted about it 6 times points to political leanings and can have further interesting insights!</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xc9g2UwIv74saMhkU_U4pw.png" /><figcaption>Word Frequency Distribution for Hindustan Times’ Tweets</figcaption></figure><p>Hindustan Times shows a more <strong>favourable approach </strong>— Most phrases focus on Farmers protest and do not mention political leaders as much.</p><p>Some new names have been introduced :</p><ul><li>Rahul Gandhi — the leader of the Opposition Party (Congress)</li><li>Rihanna &amp; Greta Thunberg (Singer &amp; Activist, respectively)</li></ul><h3>Greta Thunberg on Twitter: &quot;We stand in solidarity with the #FarmersProtest in India. https://t.co/tqvR0oHgo0 / Twitter&quot;</h3><p>We stand in solidarity with the #FarmersProtest in India. https://t.co/tqvR0oHgo0</p><p>The Hindu, Indian Express and The Economic Times also showed similar reports to Hindustan Times — focusing on farmers— Times of India seems to focus on talking about the government and its policy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M-SVCKs6sKxkV07bt9OGfw.png" /><figcaption>Summarizing Farmers Protest through words of tweets of national channels.</figcaption></figure><h3>Gauging Public Sentiment through Twitter Engagements</h3><p><em>People ‘like’ the stuff they like, they comment what they don’t like.</em></p><p>How the public reacts — helps shape up the protest. In the context of Online Social Networks (OSN) like Twitter, public reaction is measured through engagement analytics such as ‘Likes, Retweets, Quoted_Tweets &amp; Replies’.</p><p>Although its not possible to comment about the actual sentiment of the public based on these analytics, we can however draw certain conclusions based on psychological tendencies. By definition, likes indicate that other people view the post in a good light. And retweets are generally endorsements too unless written sarcastically to present something that’s obviously a weak take. While comments might support a tweet, they more often debate and criticize a post.</p><p>The reasoning behind this is that it takes far more effort to write out a response to a tweet than to simply smash that like button and keep scrolling. While not all replies to a tweet are necessarily negative, the more people take the time out of their day to respond to a tweet, the better an indication it is that a lot of people find it objectionable. People also like tweets that others might seem favourable as well.</p><p>Taking a glance at <strong>engagement statistics of Times of India tweets</strong>, we see that there are patterns inside those engagements too.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/967/1*QcDgbdFOg__89Kn7rx-uFA.png" /></figure><p><em>Focusing on the ceiling of the plots and manually picking Tweets.</em></p><p>The<strong> Likes &amp; Retweets</strong> were focused on the following topics :</p><ul><li>September 21, 2020 — Kangana Ranaut (controversial Indian Actor) calls farmers terrorists.</li><li>December 6, 2020 — Canadian Prime Minister Trudeau backs Indian Farmers</li><li>January 26, 2021 — One person died in the protest in the Red Fort seige.</li><li>February 2, 2021 — Kangana calls Rihanna a fool for her farmer protests’ tweet.</li></ul><p>The<strong> Quoted Tweets &amp; Replies</strong> showed that:</p><ul><li>People strongly engaged with thousands of farmers coming to Delhi to protest</li><li>Kangana calling farmers terrorists.</li></ul><p>Both strong sentiments, albeit positive &amp; negative.</p><p><em>If only we could come up with a statistical measure to measure the reaction of a tweet.</em></p><h3>Get Ratio’d.</h3><blockquote>The ‘<a href="https://eclincher.com/your-tweet-got-ratioed-what-next/">ratio</a>’ is how many comments a Tweet gets compared to likes and reposts — the mathematical formula being comments/ favourites.</blockquote><p>A ratio within a given cutoff range means there’s a balance among comments, likes, and retweets, indicating a tweet that’s pretty solid. In that scenario, most of the comments tend to be favorable, or at least neutral.</p><p>If comments exceed retweets plus likes, that’s a bad sign of getting a negative reaction. More than double indicates a failed tweet unless trolling (or maybe spurring conversation) was the intention.</p><p>The number of comments exceeding retweets and likes indicates that not many people who saw it wanted to endorse or share it with their followers, but people did have something to say about it. People view this in a <a href="https://www.esquire.com/news-politics/news/a54440/twitter-ratio-reply/">negative light</a>, more than the comments on a sub-1 ratio tweet.</p><p><em>There are other scales (</em><a href="https://www.dataforprogress.org/the-ratio-richter-scale"><em>Ratio-Richter Scale</em></a><em>) as well for policy based tweets but we will stick to our method.</em></p><blockquote>Ratio = (Replies + Quote Tweets)/ (Likes + Retweets)</blockquote><p>Keeping a Ratio of 0.2, the national public shared a strong sentiment for the following phrases.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qL2jGXFF0I0b5OTnBnHltg.png" /></figure><h3>How was the News shown Internationally?</h3><blockquote>Among international dailies, farmers protest wasn’t very important — until the Indian government started restricting speech rights through arrests of journalists and farmer leaders, internet outages and blocking demonstrations and activists being jailed for editing a Google Doc.</blockquote><p>As the international channels covered the protests, the farmers got a global voice for their struggle.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/610/1*5fIqbRawnjNCCZl60fqyJA.png" /><figcaption>A large diverse following made the protests global.</figcaption></figure><p>Although the protests were covered, they were not tweeted about much.</p><p>The actual tweet which pushed the Indian Farmers Protest into the limelight was <strong>Rihanna’s</strong>. Soon, many celebrities tweeted, causing outrage in the global community and inviting backlash from Indians &amp; the Indian government to <a href="https://www.deccanchronicle.com/nation/in-other-news/050221/our-nation-not-your-concern.html">“mind their own business”</a>.</p><h3>Rihanna on Twitter: &quot;why aren&#39;t we talking about this?! #FarmersProtest https://t.co/obmIlXhK9S / Twitter&quot;</h3><p>why aren&#39;t we talking about this?! #FarmersProtest https://t.co/obmIlXhK9S</p><h3>rupi kaur on Twitter: &quot;disha ravi, a 21-year-old climate activist, has been arrested by delhi police for sharing a toolkit @GretaThunberg posted in support of the #farmersprotest. disha&#39;s arrest is alarming and the world needs to pay attention. #freedisharavihttps://t.co/IYGsLpNjwZ / Twitter&quot;</h3><p>disha ravi, a 21-year-old climate activist, has been arrested by delhi police for sharing a toolkit @GretaThunberg posted in support of the #farmersprotest. disha&#39;s arrest is alarming and the world needs to pay attention. #freedisharavihttps://t.co/IYGsLpNjwZ</p><p>Influence of celebrities is clearly visible — more so since they have a higher diverse following than the international dailies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/616/1*XIXfcADERhvzdtUfZY9Zmw.png" /></figure><h3>Meena Harris on Twitter: &quot;Indian officials have arrested another young female activist, 21 yo Disha Ravi, because she posted a social media toolkit on how to support the farmers&#39; protest. Read this thread about the sequence of events and ask why activists are being targeted and silenced by the government. https://t.co/ycUgDEqwdF / Twitter&quot;</h3><p>Indian officials have arrested another young female activist, 21 yo Disha Ravi, because she posted a social media toolkit on how to support the farmers&#39; protest. Read this thread about the sequence of events and ask why activists are being targeted and silenced by the government. https://t.co/ycUgDEqwdF</p><h4>Support &amp; Backlash</h4><p>Keeping a Ratio of 0.12, the international audience shared very strong sentiments about these news phrases.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5DvGAQhbw3es9dXyJLaH3Q.png" /></figure><p>We see support from celebrities and influential activists. But we also see phrases like “India hits back at Rihanna, Greta” which is supposedly the backlash from the Indian public and the government.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ADuns3lLer1_UOpB31d3Ng.png" /><figcaption>Summarizing Farmers Protest through words of international tweets.</figcaption></figure><h3>Conclusion : Who and What is influencing the Conversation?</h3><p>The tweets and therefore the conversation is being influenced by:</p><ul><li>Intensity of Actual Events.</li><li>Biases of the reporting channel like Times of India.</li><li>The words being used in tweets.</li><li>Endorsements and Opposition by Influential people such as Celebrities and Activists.</li><li>Engagement Sentiment measured by the Ratio.</li></ul><p>While the role of Twitter in shaping political movements is now widely accepted, <em>who</em> gets to shape the narrative of political movements and <em>how</em> politically charged content on Twitter spreads remains poorly understood.</p><p>This work suggests that certain individuals in a network can amplify and spread a message much more efficiently than others. It has been shown that messages spread through “celebrities” can have a significantly higher impact than messages that come from state institutions.</p><p>It seems that these individuals (‘celebrities’) have greater influence in shaping the trajectory of political movements over <em>traditional</em> civic institutions like an independent media or civil sector organizations. The identity of the celebrity can either hurt or amplify a political message. Understanding these motives has become increasingly relevant to understanding how political movements and social campaigns in the future might evolve.</p><p>Update : This article and the work behind it was my first foray into Data Science — more so Computational Social Science, where I explored a social issue through the lens of data. Publishing this article 8 months after writing it, it still feels like a first draft — and there are so many things that I can improve now, with the experience gained since then. I have consciously made an effort to not touch-up my work, as I like to see it as my first step towards a new field. (Also, Medium has decreased the size of the plots for <a href="https://vidyasury.medium.com/its-official-medium-says-small-images-are-here-to-stay-33610b81b2fd">some reason</a>; and they are not clearly visible — you have to click on the image to view them better :/ )</p><p>I am so thankful to my mentors at <a href="https://www.equitechfutures.com/">EquiTech Futures</a>, who motivated me to look into something that I felt deeply impacted by. I would never have pursued a topic as open and dynamic as a social movement and its characteristics, if not for the encouragement by the faculty and peers.</p><p>With my lack of knowledge and experience in this field, I never expected this project to be far-reaching in any way. However, an idea — germinating from this work itself, gave me the opportunity to write a paper and talk about my work on the farmers’ protests at the<a href="https://joyojeet.people.si.umich.edu/influencers.htm"> SMIC conference</a> at University of Michigan! And I’m still working on the idea, so you never know where your small initiatives might land up :))</p><p>Cheers! And thanks for reading this article, means a lot!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=140d3190b54f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A year in the city of dreams.]]></title>
            <link>https://medium.com/@wwaryan/a-year-in-the-city-of-dreams-498a6eb81c37?source=rss-f6a9c79d65f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/498a6eb81c37</guid>
            <category><![CDATA[life-experience]]></category>
            <category><![CDATA[change-and-growth]]></category>
            <category><![CDATA[personal-growth]]></category>
            <category><![CDATA[personal-development]]></category>
            <category><![CDATA[essay]]></category>
            <dc:creator><![CDATA[Aryan Gupta]]></dc:creator>
            <pubDate>Tue, 14 Sep 2021 06:17:42 GMT</pubDate>
            <atom:updated>2021-12-30T13:34:28.978Z</atom:updated>
            <content:encoded><![CDATA[<h4>Looking back after 4 years.</h4><p>Going to Kota wasn’t my decision to make.</p><p>I sat in the window seat, looking out, my mother sitting beside me. The Kota Express was noisy. My coach was filled with kids and their parents: mothers discussing marks, fathers debating finances, kids nodding along. These parents would soon be back on this train, but without their children.</p><p>I kept looking out the window. I felt old, even though I was just 17. I traced the rail-tracks with my finger — straight, then zigzag, merging and emerging in the labyrinth of directions. Where was I supposed to end up? I could feel my mother’s stern gaze sear right through the back of my head. I didn’t look back.</p><p>This was back in 2017. My first attempt to crack the engineering entrance exam had been unsuccessful. Every year, over 2 million students all over India compete to secure one of 5000 prestigious seats. That’s a selection rate of 0.025%. Like many other rejects, I was going to Kota: the ‘city of dreams’. Kota is a hub for coaching centres. I had heard stories about the strict disciplinary system there — students tied to their books and studies, as if imprisoned.</p><p>At first, Kota didn’t seem like a prison. Students walked in willingly into the city, in awe of their new life, as if they were going to embark on an adventure. They seemed happy, too happy to be captives. I reluctantly admit, the first whiff of the city had a smell of hope and desire in it. It fuelled my wistful dream of turning my life around, and meeting my mother’s eyes once again. After getting admission into a coaching institute and fixing up my living arrangements, I had dinner with Mom, wished her goodbye, shut the door and stared at the empty room. A thin mattress, a cooler, a washroom, a table and a chair — my world for the next 12 months. I lay down, but couldn’t sleep.</p><p>My first day in Kota started early. When I left for class, it was still dark, but the town was on the move. I could see students piling out of the hostels, walking or cycling to their coaching centres, which were all located on ‘Road №1’. I moved with the crowd and ended up in a line — one among the 600 students in each batch. My ID was 10 digits long. They checked it off the list, and I entered the room — long rows of iron planks served as the chairs and tables. Students pushed me from behind; I was blocking the entrance. The first 10 rows were already crowded. I took a seat at the 11th.</p><p>The student next to me joked “So, what are you in for?”. I shrugged. He patted my shoulder. “Most of us are here because we didn’t study”. I nodded absentmindedly. I had worked hard. I didn’t know why I was here. Maybe for letting down my parents. No. Maybe to improve myself, a chance to redeem myself. Is this a rite of passage that everyone goes through? Maybe.</p><p>The next few months went the same way. The classes started at 8 AM. I had to be there by 7, to get a seat in the first 3 rows. 5 classes daily; 3 for Chemistry, and 1 each for Physics and Mathematics. During lunch break, I ran back to my hostel, and was always last to eat. It was a self-service: orange-ish gravy placed in bottomless containers. All the <em>sabzi</em> was usually gone. I gobbled down the cold gravy with <em>chappati</em>, and rushed back to coaching, lest I lose my seat. Then more classes till 10 pm, more cold dinners and back to sleep in an unfamiliar bed. In a few weeks, I had attuned myself to the timetable, the bustling crowds, scratching pens, a never-ending pile of homework.</p><p>Mom called everyday. I talked to her on the 10 minute walk to the hostel at night. I told her about what I had learnt, and what I had to do after reaching back. I asked her if she was doing okay. She said she missed me, and hoped I would come back soon.</p><p>About 4 months in, the tests started. Our results were posted as huge public lists on the wall. We scanned the long lists by finger, moving down the rows of ID numbers and ranks. After 10 minutes of scanning, I found myself — ranked about 400 in a class of 600. Students who earlier asked me their doubts now sat far from me and the teachers shook their heads dejectedly. I had turned out to be yet another disappointment.</p><p>That night, when Mom called, I didn’t have the courage to tell her.</p><p>I was anxious. I was working hard, still it made no difference; almost everyone was doing better than me. So, I started putting in more time — some nights I just didn’t sleep. Over the months, the courses became tougher, concepts slipped from my hand before I could grasp them. I stopped asking questions in class — I didn’t know what to ask anymore. It wasn’t long before I was skipping dinner and sleep — time was more valuable. I never left my room. I didn’t talk to the other kids in the hostel. I didn’t want to. Sometimes, my friends called. I didn’t pick up.</p><p>November saw a change. For one, we got our first break — a breather. Classes were on hold for 2 weeks to celebrate Diwali , the festival of lights. The town emptied and everyone went home. I didn’t. I stayed back to finish my pending work. Mom visited me and she brought a surprise — my old guitar. It had been more than 6 months since I had touched it. I ran my hand over the polished spine, my fingers over the strings. The strings were rusted, and the guitar was out of tune — but it was still the best thing I had heard in a long time. Over the holidays, I spent my days working on assignments. At night, when all was silent, I used to take my guitar out and croon tunes. I loved how my fingers had a life of their own. I missed that. I missed being in control, and yet still free. I tuned my guitar by ear. When was the last time I had tuned myself?</p><p>Playing the guitar took me way back — to a time before Kota, before my first entrance attempt, back to my music sessions. Simpler times doing simpler things: performing for my friends, trying something new, having fun.When was the last time I had done something for myself?</p><p>It was a simple question. But I had no answer. The past few months had reduced me to a single dimension — a number, a rank. I had been toiling day and night, burning out for the past few months, and I hadn’t even noticed it . And soon, I would be assigned another number, then another, then another and so on till the end. I felt claustrophobic — surrounded by millions of students, one person in a thick crowd, shoving and pushing each other. I couldn’t bear to think of myself like that. I remembered having an identity, once.</p><p>The evening before the holidays ended, I grabbed my guitar, and walked out. I walked straight ahead, past the stationery, past the food stalls, past my coaching centre. The town was empty, students still had not returned from their break. I stopped at the mall and went in. Few people were around. I found a good spot outside the McDonald’s. I sat down next to happy Ronald and held my guitar. I felt strangely powerful.</p><p>I looked down, my left hand on the frets, the right one on the strings — tingling with energy. My heartbeat became quicker — and then, a ripple of a smile seeped through. My shoulders relaxed and a wave of joy hit me — I was grinning from ear to ear. Here I go again, trying to prove myself. I felt like a hero in a movie about to discover himself, and I giggled. I felt silly and lighter, after ages.</p><p>I didn’t end up playing that day. But I felt proud of myself, something I hadn’t felt in a long, long while. It was a brave attempt — silly, no doubt, but brave. I remember walking back with a spring in my step, shaking my head ever so slightly. I remember smiling. A lot. It wasn’t that everything had changed — I still had to work hard, get a good rank and a good college.I had been associated with numbers throughout my life, and perhaps this cycle would continue, even while looking for jobs and so on. There was no escaping it. But it felt like something had shifted . I wouldn’t let those numbers define me. For the first time in a long while, I had taken a decision. I had chosen me.<br>This is my quest — to become more than a number.</p><blockquote>This personal piece was written as part of the Writing Labs during Global Summer Institute (GSI ’21) as an Equitech Futures Scholar. You can find out more <a href="https://www.equitechfutures.com/aryan-gupta">here</a>.</blockquote><p>Past experiences and interactions had made me believe that being always resilient is right — Sharing your story will make you vulnerable, inside and in front of others. But the Writing &amp; Speaking Labs and the wonderful community at Equitech Futures encouraged me to speak up about tough instances of life which I considered to be my insecurity. Sharing my story helped me overcome this insecurity, and now I feel proud to have had this experience in my life. The story of your life is <em>supposed to be</em> different from others and that’s what makes you unique. <strong>Your story is your power.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=498a6eb81c37" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Eyantra — Learnings & ROS.]]></title>
            <link>https://medium.com/@wwaryan/eyantra-learnings-ros-d8fc98cb051?source=rss-f6a9c79d65f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/d8fc98cb051</guid>
            <category><![CDATA[eyantra]]></category>
            <category><![CDATA[roses]]></category>
            <category><![CDATA[eyrc]]></category>
            <category><![CDATA[simulation]]></category>
            <category><![CDATA[robotics]]></category>
            <dc:creator><![CDATA[Aryan Gupta]]></dc:creator>
            <pubDate>Thu, 22 Apr 2021 17:56:54 GMT</pubDate>
            <atom:updated>2024-08-26T17:10:23.841Z</atom:updated>
            <content:encoded><![CDATA[<h4>LEARNINGS THROUGH EYANTRA ROBOTICS COMPETITION 2020!</h4><h3>Eyantra — Learnings &amp; ROS.</h3><h4>Programming an Autonomous Ground Vehicle at home!</h4><p><em>Disclaimer : This article relates to my learnings during the Eyantra Competition. Please do not message with competition specific doubts, or ask for code. I respect Eyantra’s NDA, and will neither share nor disclose any part of the code. Read on for some eYantra tips, and what all I learnt during the 6 month long competition.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*r5nr0xUKZkMFEV0a.png" /></figure><p>Hi there! I am Aryan, currently a 3rd year B.Tech undergrad at CIC, DU.</p><p><a href="https://portal.e-yantra.org/#about">Eyantra Robotics Competition</a> (eYRC) is a competition organized annually by IIT Bombay, the winners (&amp; finalists) being offered internships at IIT-B. Winning a Robotics competition + Internship at IIT-B + working on quadcopters, bots and more kinda makes it a big deal.</p><p>Eyantra is quite famous in our college, as we have an eYantra Lab and my seniors have won its sister competition <a href="https://eyic.e-yantra.org/">eYIC</a>. In short, its quite an amazing opportunity to be explored :))</p><p>This was my 3rd time participating in eYRC. My first year, we were all freshers, and the team was bad (ofcourse, it was the first sem of college). Second year, I was part of a 75% okayish team, and we worked on flying a drone! We had a great team leader. Sadly, I really didn’t have any confidence in my abilities. I worked hard and sincerely, but due to hesitation, could not contribute much to the progress of the team :/</p><p>This year (2020) was so messy. Covid struck, lockdown ensued, lives got dishevelled, destroyed. The few(rather more) of us, who have been fortunate didn’t have much change in our lives. This year, I participated with my friends from college: <a href="https://www.linkedin.com/in/anveshan-lal-88079216b/">Anveshan Lal</a>, <a href="https://www.linkedin.com/in/akshansh2000/">Akshansh Bhanjana</a> &amp; <a href="https://www.linkedin.com/in/1piyushyadav/">Piyush Yadav</a>. We did well, had our ups and downs, satisfactions and frustrations as well. Of course, there were some tough times, but <a href="https://www.goodreads.com/quotes/48122-the-brick-walls-are-there-for-a-reason-the-brick">thats what brick walls are for</a>. We did quite well in the tasks, however we weren’t selected for the finals which was a bummer.</p><p><em>Silver lining</em> — I finally overcame my hesitation, worked hard on the project, contributed to the progress of the team and did my best to lead the team. Plus we completed a 6 month ‘group’ project which is kinda impossible in college :p</p><p>If you are a student wishing to participate in eYantra, here are some tips :</p><ul><li><strong>Motivation — </strong>A senior told me once that to learn any new technology, work with it for 6 months doing a project. Make sure that your motivation is to learn, and winning just an added bonus. Only then you will be able to run this marathon called eYantra.</li><li><strong>Make a good team</strong> — Choose a sincere worker over a smart worker. Robotics is not that tough, it just takes a lot of time and effort. You will need hard workers in your team as its a 6 month long project. Can’t afford to have smart yet lazy workers.</li><li><strong>Be Resourceful — </strong>Your best bet in this competition is to know how to google. There are tons of resources available on the internet. Many people have done before what you are learning to do. People have had similar queries, and its your job to find out how they solved it. Use StackOverflow, Google, ROS Wiki, Github and any other resource that may help you. Its a competition — there won’t be much spoonfeeding.</li><li><strong>Time Intensive</strong> — Take it as a learning opportunity — participate in your 1st or 2nd Year, as these years are quite free timewise, robotics is time-intensive. In 3rd year, you will definitely be able to solve all tasks easily, but in 3rd year you have to focus your energies elsewhere.</li><li><strong>Heavy Simulations</strong> — Make sure you have good laptops, which can run heavy stuff well. Gazebo uses CPU, and we spent hours running simulations which would have taken barely 10 mins on a better laptop. If you don’t have a good laptop, know that you will have to spend more time on completing tasks, than others.</li><li><strong>Resources</strong> — Eyantra resources are great! For practical approaches you can also look into The Construct, and for documentation the ROS Wiki.</li><li><strong>For Winning </strong>— eYantra is a great opportunity to learn Robotics &amp; qualities such as team work, persistence and more. However, if your aim is to win the competition, you will have to put another level of effort. Case in point, we barely lost around 100–150 marks in total (out of 1000 + marks). We were surely in the top 10 teams all over India, but only 7 teams qualified for the finals. Its cut throat competition, mostly from Southern India — people are really crazy about eYantra there!</li><li>Lots of <strong>time</strong> and <strong>consistent effort</strong> is required. Better if its a <strong>team effort.</strong></li><li><strong>Luck</strong> is when <strong>preparation</strong> meets <strong>opportunity</strong>, and a bit of a <strong>Higher Power’s grace</strong> :)</li></ul><p>The rest of the article is not focused on eYantra, though I’m glad that I got the experience to learn about ROS and robotics. Its about what technical stuff I learnt that I’ll focus on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/687/0*kpYOxFGsJzjjW5pq.jpg" /></figure><h3>THEME : Sahayak Bot</h3><p>‘Sahayak’ means assistance. We had to program an Autonomous Ground Vehicle (AGV) to make it capable of autonomously traversing an indoor environment to assist moving objects from one place to another. The purpose of the bot could be effective as a bot in a warehouse, which could pick up specific objects from one place and put it at another specific location, thus reducing the amount of manpower required.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZATc7vs-Kk7XkT5_.png" /><figcaption>Sahayak Bot Theme</figcaption></figure><p>Challenges in this theme included :</p><ul><li>Understanding ROS (used ROS Melodic in Ubuntu 18.04)</li><li>2D Mapping for Autonomous Navigation (ROS Navigation Stack)</li><li>3D Mapping for Arm Manipulation (ROS Manipulation Stack)</li><li>Recognizing specific Objects (ROS Perception Stack)</li><li>Pick and Place of Objects</li><li>Finally, working all of the above together in a reallife simulation!</li></ul><p>Usually, Eyantra has a hardware section. However, this theme was customized to suit the pandemic circumstances, and was totally software based — i.e. simulations only.</p><p><strong>The Bot</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/519/1*AxnWXBrqhNxD2RPg_MjHNw.png" /><figcaption>Fun Fact : A bot like the above costs about 1.5 lacs :))</figcaption></figure><p>It consists of a mobile base named as eBot and a UR5 (Universal robot) robotic arm. eBot is a four-wheeled robot that works on a skid steer drive control mechanism. eBot consists of various sensors such as encoders, 2D LIDAR, a depth camera, and an IMU.</p><p>The theme involved a URDF based bot used in a Gazebo simulated environment.</p><h4>Task 0 : Learning the Basics</h4><p>Here’s what I learnt :</p><ul><li>ROS lingo : Workspaces, Packages, Nodes, Master, Parameter Servers, Launch files, Actions, Services and Topics, and related commands</li><li>ROS Tools such as Gazebo, Rviz, URDF Files</li><li>ROS concepts like tf, pose, position, publishers subscribers of topics like cmd_vel &amp; odom</li><li>Writing simple scripts in python &amp; using rospy library</li></ul><h4>Task 1 :</h4><p>Involved completing an obstacle course autonomously, by following a sine curve based track.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tv4rPtunoj5GbxguR5GLmg.png" /><figcaption>Obstacle course for Task 1</figcaption></figure><p>There were two parts to this Task :</p><ul><li>Following the sine curve</li><li>Avoiding the obstacle in path, <em>autonomously.</em></li></ul><p>Our Solution involved a python script :</p><ul><li>Creating a numpy array to contain points on the sine curve which had to be traversed. Less points led to linear motion from one point to another, too many points caused jerks, so we had to find a fine number of points for smooth travel.</li><li>Subscribing to odom for position, and publishing velocity on cmd_vel to traverse the points.</li><li>P Controller to avoid Obstacle — Subscribing to the Laser Scan topic to detect presence of the obstacle.</li></ul><p>Here is how the final plot of the path taken by our bot looked :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*soXYxnszg8x8GB82YPDgcA.jpeg" /><figcaption>We were super happy when we got this plot!!!</figcaption></figure><h4>Task 2 : Mapping &amp; Navigation Stack</h4><p>Task involved navigating the bot through various rooms by following a given route.</p><p>To navigate a robot we need<br>1. A <strong>Map</strong> which fully reflects the static environment<br>2. <strong>Localization</strong> of the Bot — Know where the bot is, wrt the map.<br>3. <strong>Navigation</strong> — Path planning from one point to another — keeping in mind the map and bot localization.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/1*SDUzv1lvSIH8Ylz9_RR72Q.png" /></figure><p><strong>1. Mapping</strong></p><p>A map is a representation of the environment where the bot has to navigate around. To map the environment, its important that the whole area is captured, and a track is kept of all the measurements being done while the bot is moving.</p><p>This is done by using SLAM — Simultaneous Localization and<br>Mapping. It estimates the map of the environment and the trajectory of a moving device using a sequence of sensor measurements (LIDAR).</p><p>There are mainly 4 types of mapping algorithms : Gmapping, Hector mapping, Cartographer &amp; Rtab mapping.</p><p>We used <strong>Gmapping ROS Package</strong>.<br>Using slam_gmapping node, you can create a 2-D occupancy grid map (like a blueprint) from lidar/laser and pose data collected by a mobile robot. First, it takes the measurement from odometry and laser scan, it tries to localize the bot along with the laser scan matching and then using Extended Kalman Filter (EKF) it estimates the output by fusing odometry and laser scan matching values. Along with this, it uses a particle filter for localization.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9upIGFSi42Uxtjpfy_gfZA.png" /></figure><p><strong>2. Localization</strong></p><p>Localization is the process of determining where a mobile robot is located with respect to its environment.</p><p>One way of knowing the position of the robot is tracking from its initial position. By measuring the wheel odometry reading of the robot we can calculate the distance travelled from the initial position and predict with certainty of the cars pose on the map. However, this method is not very accurate, as it doesn’t account for torque of wheel slippage. We could use GPS, however, we cannot use it in a small closed indoor environment like a warehouse.</p><p>One solution to this issue is Monte Carlo Localization which uses particle filter. Other alternative options include Kalman Filter, Topological Markov Localization.</p><p>We used AMCL — <strong>Adaptive Monte Carlo Localization</strong>.</p><p>AMCL is a probabilistic localization system for a robot moving in 2D. Given a map of the environment, the algorithm estimates the position and orientation of a robot as it moves and senses the environment.</p><p>The particles represent the probabilistic distribution of the likely states for the robot. Each particle represents the state of the robot.<br><br><em>Its important to tune AMCL parameters, so that the localization is fast and accurate, otherwise the bot may crash into objects or walls.</em></p><p><strong>3. Navigation</strong></p><p>The navigation stack consists of 3 components:<br>1. Costmaps<br>2. Path Planning Algorithm<br>3. Move base Node</p><p><strong>Costmap</strong> is a grid in which every cell gets assigned a value (cost) determining distance to obstacle, where higher value means closer distance.<br>Using this map, the robot plans the path in such a way that it avoids obstacles by creating a trajectory with lowest cost.</p><p>There are 2 costmaps, <strong>Local Costmap</strong> for local planner which determines obstacles near the robot and a <strong>Global Costmap</strong> for global planner to plan a global path from the start point to the goal with keeping the obstacles in mind.</p><blockquote>Another article for Navigation Stack tuning parameters soon!</blockquote><p>There are 2 types of planners in the Navigation stack:<br>1. <strong>Global Planner</strong> — plans the path from the start to the end goal.<br>2. <strong>Local Planner</strong> — used to avoid obstacles and get the robot back to the global path i.e. find a suitable local plan at every instance.</p><p>For Global Planner, usually <strong>navfnROS</strong> is used with A* algorithm. We used Dijkstra.</p><p>The default Local Planner is <strong>TrajectoryPlannerROS</strong>. We used <strong>DWA Local Planner.</strong></p><p>The <strong>move_base node</strong> provides a ROS interface for configuring, running, and interacting with the navigation stack on a robot. In simple words, the move_base node links together a global and local planner to accomplish its global navigation task.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KeQiMPtXuC8sZOozrXssXw.png" /><figcaption>move_base node — ROS Wiki</figcaption></figure><p>There are a large number of parameters that have to be tuned to get optimal navigation. You can use this <a href="https://kaiyuzheng.me/documents/navguide.pdf">guide</a> &amp; ROS Wiki to understand the parameters, and use rqt_reconfigure, which is a dynamic navigation tuner i.e. you can tune while you are running the simulation!</p><p>Here’s how our implementation of Task 2 looked!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FCm6zK7Ac3kw&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DCm6zK7Ac3kw&amp;image=http%3A%2F%2Fi.ytimg.com%2Fvi%2FCm6zK7Ac3kw%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/e4cee55cf15bc84c349313320a9f594b/href">https://medium.com/media/e4cee55cf15bc84c349313320a9f594b/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*3ZZhd1bYua6A928nmS-Qzg.png" /><figcaption>(NOT OUR PLOT) Some people lost points because they couldn’t get their bot to reach in the square.</figcaption></figure><p><strong>Task 3 : Arm Manipulation</strong></p><p>The challenge posed in this task is Picking and Placing objects in their designated drop-boxes, using MoveIt! motion planning framework to place the objects in their corresponding drop box.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/532/1*GjTtlLHVLnxmNr2mn4w1sw.png" /></figure><p>A lot of maths — Kinematics, inverse Kinematics , Linear Algebra is used. Fortunately, we only needed to learn how to use a ROS package :))</p><p>MoveIt! is a very popular Motion Planning Framework. MoveIt! contains software for manipulation, motion planning, kinematics, collision checking etc. It also has a RViz plugin which can be used to perform Motion Planning from RViz itself. It has python support to run the C++ code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PjFP0R_aMgcvW3wUJykhaA.png" /><figcaption>Moveit!</figcaption></figure><ul><li>move_group uses the Planning Scene Monitor to maintain a planning scene, which is a representation of the world and the current state of the robot.</li><li>Python MoveIt! APIs to command the move_group node to perform actions such as pick/place (using joint angles, poses etc)</li><li>MoveIt! Setup Assistant is a pretty handy tool which provides a GUI interface to generate configuration MoveIt! ROS package.</li></ul><p>OMPL, CHOMP, STOMP are examples of different Motion Planning Algorithms that you can setup in Moveit!. We used OMPL, but it wasn’t a very good choice, since it takes up different probabilistic paths to reach the same point, over different iterations. In short, its quite unpredictable.</p><p>Unless Moveit! is told specifically, it does not know about obstacles like walls and objects and tables present in the environment. Moveit is informed by changes in the Planning Scene.</p><p>There are 3 ways to deal with this :</p><ul><li>Add .dae Models in rviz — This works for cases where the bot is immobile. Adding model in Rviz, adds virtual models in Planning Scene and tells the Moveit! framework to not consider the object as an obstacle. This is used in Task 3.</li><li>Clear space in planning scene, so that the bot isn’t scared of approaching the object. (Used in later Task).</li><li>Use Octomap to create a 3D Map. (described later).</li></ul><p>Here’s how our implementation of Task 3 looked!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FgFHXQ0D0nc0%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DgFHXQ0D0nc0&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FgFHXQ0D0nc0%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/e48d7768ab71cd779ea3f5eac5c36bd2/href">https://medium.com/media/e48d7768ab71cd779ea3f5eac5c36bd2/href</a></iframe><p><strong>Task 4 : Perception</strong></p><p>The Task is similar to Task 3; only difference is, instead of using .dae models, the bot had to use the camera fitted on the gripper (the hand of the arm), to detect and recognize objects.</p><p>The steps are given as follows :</p><ul><li>Correctly Detecting and Recognising the objects(components)</li><li>Estimate the gripping pose for UR5 to pick it up</li><li>Correctly place it inside dropbox</li><li>Use MoveIt motion planning framework (already done in Task 3)to pick &amp; place the objects in their corresponding dropbox.</li><li>UR5 arm should plan a path in such a way that it never collides with tables.</li></ul><p>To do perception, we have many options to try :</p><ul><li>PCL (Point Cloud Library)</li><li>Tensorflow Object Detector — Deep learning approach</li><li>ML Object detection ROS package — Highly Computational</li><li>find_object_2d — This is a ROS package using descriptors for matching templates from an image.</li></ul><p>Find_object_2d is a very easy to use package, and consists of many Computer Vision Algorithms which can easily detect images. We used this package for our perception pipeline.</p><p>As discussed, detecting objects is not enough. We need to make sure that an object is easily picked, and that the bot’s arm doesn’t collide with any other object, wall or even itself!</p><ul><li>Generating a <strong>self collision matrix using Moveit_Setup_Assistant </strong>prevents the arm from colliding with itself i.e. the bot.</li><li><strong>Octomap (3D mapping) </strong>can help prevent the bot from crashing into the wall or objects while motion planning.</li></ul><p>Octomap in MoveIt is available by default. You just need to add the right topics through it, details you can find in perception pipeline of Moveit.</p><p>When Octomap is activated, it maps the 3D environment — So, all the walls and objects will be considered as obstacles, and Moveit! will plan a path for the arm avoiding them.</p><p>However, we want the arm to avoid the wall and other objects, but <em>not the object that we want to grab</em>. If we don’t make any changes, then the arm will hesitate in approaching the object, and the path planning will fail.</p><p>To avoid this, we clear the area of the planning scene where the object is present, through code. Instead of the large object present, we add a virtual object which is smaller at its place, in the planning scene. The Moveit! framework can then treat it as an object, not an obstacle, and pick it up easily.</p><p>This process is not very well documented in ROS. Our team spent weeks trying to understand and implement the above. But we were successful to quite an extent :))</p><p>Here’s how our implementation of Task 4 looked!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FtIv0zDPYLbI&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DtIv0zDPYLbI&amp;image=http%3A%2F%2Fi.ytimg.com%2Fvi%2FtIv0zDPYLbI%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/bcd4766bc8355c491e715807cfbd7527/href">https://medium.com/media/bcd4766bc8355c491e715807cfbd7527/href</a></iframe><p><strong>Task 5 : All In!</strong></p><p>Objectives of this Task are:</p><ul><li>Navigate to the correct location to pick up objects using the Navigation pipeline.</li><li>Detecting objects using perception pipelines.</li><li>Grasping objects with MoveIt planner.</li><li>Navigate again to your destination using the Navigation pipeline.</li><li>Placing the objects in the correct drop box.</li></ul><p>Here’s how our implementation of Task 5 looked!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FWukVfxSxmJ4%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DWukVfxSxmJ4&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FWukVfxSxmJ4%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/fe8d1da8c2601fa87ee098577fa1e6bb/href">https://medium.com/media/fe8d1da8c2601fa87ee098577fa1e6bb/href</a></iframe><p><strong>Task 6 : Task 5 but with more objects!</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FZsJrie5W2AU%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DZsJrie5W2AU&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FZsJrie5W2AU%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/42063e21251f30a64a97f19b6c75bd09/href">https://medium.com/media/42063e21251f30a64a97f19b6c75bd09/href</a></iframe><p>Really appreciate how eYantra provided us with enough resources to get started on, and gradually decreased support so that we learn to collaborate as a team, and work up innovative solutions to our problems. Its a bit sad, that we didn’t qualify, but I learnt a lot, and I hope to put all this knowledge to good use soon :))</p><p>I wrote this article for mainly two types of readers —</p><ul><li>Experienced roboticists who know exactly what I am talking about (maybe more!)</li><li>Freshers and amateurs who would barely understand any tech lingo, but be able to see that all of this can be learnt in under 6 months :)) — freely, as ROS is open source.</li></ul><blockquote>(Personally, I feel instead of ROS being an acronym for ‘Robot Operating Systems’, it should stand for ‘Robotics Open Source’. Maybe I’ll pitch it to them; maybe they’ll consider, who knows :p )</blockquote><p>Thank you for reading!</p><p><em>For any queries or discussions, you can reach out to me on </em><a href="https://www.linkedin.com/in/wwaryangupta/"><em>LinkedIn</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d8fc98cb051" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Definite (& ONLY) Guide to Fastkml.]]></title>
            <link>https://medium.com/@wwaryan/the-definite-only-guide-to-fastkml-58b8e19b8454?source=rss-f6a9c79d65f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/58b8e19b8454</guid>
            <category><![CDATA[python-libraries]]></category>
            <category><![CDATA[mlk]]></category>
            <category><![CDATA[geography]]></category>
            <category><![CDATA[guides-and-tutorials]]></category>
            <category><![CDATA[gis]]></category>
            <dc:creator><![CDATA[Aryan Gupta]]></dc:creator>
            <pubDate>Mon, 07 Sep 2020 14:29:33 GMT</pubDate>
            <atom:updated>2020-09-07T14:47:00.766Z</atom:updated>
            <content:encoded><![CDATA[<h3>The Definite (&amp; ONLY) Guide to FastKML.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JawtHXccC8q8GO_e-7rthw.png" /></figure><p>I recently completed a 3 Month Software Development Internship with Mission Support System, an Open Source Flight Planning Software under the aegis of the umbrella organisation Python Software Foundation under Google Summer of Code 2020.</p><p>My project involved Enhancing KML Support as a feature, and I used FastKML library to do that. Over the course of these 3 months, I found that there isn’t a lot of documentation for FastKML, and lots of its features are in the grey area.</p><p>I faced a lot of difficulties starting out with FastKML. But, through experimentation, and reading the code, it became easier to understand. I did a lot of work and I am writing it all down, so that you don’t have to. Hopefully, your FastKML implementation will be truly, fast :))</p><p>I’ll start with the basic foundation, and then build up to using FastKML.</p><h3>Starting out with KML</h3><p>XML, HTML , XHTML … sound familiar? They all have ‘ML’ in common which stands for Markup Language.</p><blockquote>A <strong>Markup Language</strong> is a computer language that uses <strong>tags</strong> to define elements within a document. It is human-readable, meaning <strong>markup</strong> files contain standard words, rather than typical programming syntax. Its NOT a Coding Language!</blockquote><p>Basically, if you have some data within certain categories, you can write that data within defined tags, and that data can be easily understood by humans and machines alike.</p><p>Sometimes the data can be generic (Grocery Inventory) or quite specific. The tags are usually defined and specifically cater to the particular extension. (eg. .kml, .xml)</p><p>Its time we talk about KML.</p><blockquote><strong>KML</strong> is a file format used to display <strong>geographic data</strong> in an Earth browser such as Google Earth.</blockquote><p>KML stands for <strong>Keyhole Markup Language </strong>and is a notation for expressing geographic annotation and visualisation within 2D maps and 3D Earth browsers.</p><p>Extra Reading : Check out this <a href="https://www.ogc.org/standards/kml/">link</a> to know why KML came into existence and being accepted as an International Standard in the Open Geospatial Consortium (OGC).</p><h3>Major Tags of KML</h3><p>Here’s a simple example of a KML File. The tags and data inside those tags are very specific to geographic annotations.</p><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br>&lt;kml xmlns=&quot;http://www.opengis.net/kml/2.2&quot;&gt;<br>  &lt;Placemark&gt;<br>    &lt;name&gt;Simple placemark&lt;/name&gt;<br>    &lt;description&gt;Attached to the ground. Intelligently places itself <br>       at the height of the underlying terrain.&lt;/description&gt;<br>    &lt;Point&gt;           &lt;coordinates&gt;-122.0822035425683,37.42228990140251,0&lt;/coordinates&gt;<br>    &lt;/Point&gt;<br>  &lt;/Placemark&gt;<br>&lt;/kml&gt;</pre><p><em>I’ll be explaining KML in short, since Google already has a vast documentation on it.</em></p><p>The major tags of KML can be divided into 3 categories :</p><ul><li>Features</li><li>Geometry</li><li>Styles</li></ul><p><strong><em>(</em></strong><em>Its hard to define feature in terms other than hierarchy. It might not be clear at first, but as you read on, things will make sense.)</em></p><h3><strong>Feature</strong></h3><p>We’ll start by defining <strong>Placemarks</strong>. Placemarks are the specific plots for which the data is available, in the form of coordinates, geometries etc.</p><p>For example : Placemarks in a KML File can be the 7 Wonders of the World. So, these 7 wonders will be plotted in the form of various geometries having different styles.</p><p>These Placemarks can be contained inside Folders and Documents. The natural order is :</p><pre>&lt;Document&gt;<br>     &lt;Folder&gt;<br>        &lt;Placemark&gt;<br>         .....<br>        &lt;/Placemark&gt;<br>      &lt;/Folder&gt;<br>&lt;/Document&gt;</pre><p>However, it can be in other orders as well.</p><ul><li>Features or Placemarks can be a point, an area, or a big region.. anything than can be plotted.</li><li>Placemarks can have attributes such as &lt;<strong>name</strong>&gt;, &lt;<strong>description</strong>&gt; and more.</li><li>With the advancement of 3D browsers , it is now possible to plot the terrain of a Placemark region as well, and that data is stored using &lt;Overlay&gt; tags. There are 3 <strong>Overlay</strong> tags : <strong>Photo, Screen and Ground Overlay</strong>.</li><li>There are other tags such as &lt;<strong>Network Link</strong>&gt; which allow you to connect to a site, and get realtime updated KML Data every few seconds. This is useful when you want realtime earthquake data and so on.</li></ul><p>You can find a table below, explaining the major KML Tags with examples!</p><p><a href="https://developers.google.com/kml/documentation/kmlreference">KML Reference | Keyhole Markup Language | Google Developers</a></p><h3><strong>Geometry</strong></h3><p>Geometry refers to the actual geometry of the plot that the KML file contains. These are all the Geometrical categories supported:</p><ul><li><strong>Point</strong></li><li><strong>LineString</strong></li><li><strong>Polygon</strong> (Inner &amp; Outer Boundaries)</li><li><strong>Linear Ring</strong></li><li><strong>MultiGeometry</strong> (Geometry consisting of combos of the above)</li></ul><p>They have various attributes which help define these geometries more clearly.</p><h3><strong>Styles</strong></h3><p>We have different drawing Styles for different geometries :</p><ul><li><strong>LineStyle</strong> for drawing Lines through attributes such as color and linewidth</li><li><strong>PolyStyle</strong> for drawing Polygons through attributes such as fill and outline</li><li><strong>IconStyle</strong> for drawing icons for Point Placemarks</li><li><strong>LabelStyle</strong> drawing the name of Placemark in 3D viewer</li><li><strong>BalloonStyle</strong> for drawing description balloons for Placemarks</li><li><strong>ListStyle</strong> for listing Features in Google Earth</li></ul><p>You can find out about KML in detail below.</p><p><a href="https://developers.google.com/kml/documentation/kml_tut">KML Tutorial | Keyhole Markup Language | Google for Developers</a></p><p>As per OGC, KML Files cannot be created by anyone, i.e. KML follows a specification standard which has to be met to release such files in the public domain. You can find the conformance levels <a href="https://cite.opengeospatial.org/teamengine/about/kml22/2.2/site/">here</a>.</p><h3>Python Libraries dealing with KML</h3><p>Here is a list of commonly used KML related Python Libraries.</p><ul><li><a href="https://lxml.de/">lxml</a> : Main Library to deal with all kinds of XML</li><li><a href="https://pypi.org/project/simplekml/">SimpleKML</a> : For generating KML Files easily</li><li><a href="https://pypi.org/project/fastkml/">FastKML</a> : For creating, parsing KML Files</li><li><a href="https://pypi.org/project/pykml/">PyKML</a> : For creating, parsing KML Files</li><li><a href="https://pypi.org/project/signxml/">Signxml</a> : Provide payload security for verifying signatures</li><li><a href="https://pypi.org/project/defusedxml/">Defusedxml</a> : Provides security from xml vulnerability attacks</li></ul><h3>Getting Started with FastKML</h3><p>We know now what KML is, and what are the constituents of a KML File. But how can we extract useful data from the file?</p><p>Either we can use the general library dealing with xml-ish file extensions — the lxml library. Its very useful, and you can find its usage to no end. The only problem is.. its so generic that you have to develop your code on this library for making the KML data useful.</p><p>Usually, parsing KML is a smaller part of a bigger project. For such reasons, its better to use a library <strong>specifically catering</strong> to KML.</p><p>FastKML is such a library. Like it advertises, it fast in its usage. i.e. its built on the lxml library focused on KML related functions. This forms a safe level of abstraction, and you only need to call relevant KML functions, and keep working on the bigger end of your project.</p><p>You can check out the FastKML project right below.</p><p><a href="https://github.com/cleder/fastkml">cleder/fastkml</a></p><p>Here’s a link to its <a href="https://fastkml.readthedocs.io/en/latest/">documentation</a>.</p><p>The only issue I had while using FastKML was the <em>lack of documentation.</em> There’s literally none.</p><p>In terms of documentation, there are 3 Python scripts; to create a KML File, read a KML File and one to run a KML File.</p><p><em>But, our use case isn’t running a KML File , is it? If that was the case, we would simply have ran the KML Files on Google Earth and save us all this trouble.</em></p><p>We need to parse the file, use that data for maybe visualizing on our maps or something.</p><blockquote>Fastkml consists of a number of python scripts/modules. I’ll be focusing specifically on kml.py, geometry.py and styles.py as I worked with these modules extensively.</blockquote><p>The only help you can find is through reading the test cases present in “<strong>test_main.py</strong>”.</p><p>Since it is missing documentation, I feel I can bridge some of the gap here by building on my own code.</p><p>I’ll take a moment here to explain my project : Creating a GUI based docking widget to access, parse and display multiple KML Files simultaneously on a given map.</p><p>Here’s my demo for the MSS Application :</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FG4aPIRLBz9U%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DG4aPIRLBz9U&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FG4aPIRLBz9U%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/f7b4bbd7ad83a0a3a655f70e1ba6c35a/href">https://medium.com/media/f7b4bbd7ad83a0a3a655f70e1ba6c35a/href</a></iframe><blockquote>In this article, I’ll focus more on using FastKML. For those interested to view the codebase of my work, I’ll add a link at the bottom of the article, so that its not lost in the long work that I’m gonna be writing.</blockquote><p>I think its time to really get started.</p><h3>Getting the examples to work.</h3><p>Open fastkml/examples. In there, you will find 5 files : a Google KML Sample File, a README and 3 Python files namely CreateKml.py, ReadKml.py and UsageExamples.py.</p><h4>Starting with CreateKml.py — It creates a KML File.</h4><p><em>(Please note that the files haven’t been updated for Python 3. Therefore small syntax changes will throw errors. I will be pointing them out in this article, so you don’t have any problem).</em></p><p>To run CreateKml.py , change the line beneath Print out the KML Object as a string.</p><p>From</p><pre>print k.to_string(prettyprint=True)</pre><p>to</p><pre>print(k.to_string(prettyprint=True))</pre><p><em>Python3 changes.</em></p><p>Now you will be able to run the file without any problem.</p><p>The code and output of CreateKml is self explanatory. Its basically creating objects of different classes and calling them.</p><h4><strong>ReadKml.py</strong> : A KML String is provided, and then fastKML attempts to read it.</h4><p>Make sure to make changes to the Python syntax for the print statement.</p><p>Try to run the code again. You will get the following error :</p><pre>Traceback (most recent call last):<br>  File &quot;ReadKml.py&quot;, line 35, in &lt;module&gt;<br>    k.from_string(doc)<br>  File &quot;/home/aryan/anaconda3/lib/python3.7/site-packages/fastkml/kml.py&quot;, line 91, in from_string<br>    parser=etree.XMLParser(huge_tree=True)<br>  File &quot;src/lxml/etree.pyx&quot;, line 3222, in lxml.etree.fromstring<br>  File &quot;src/lxml/parser.pxi&quot;, line 1872, in lxml.etree._parseMemoryDocument<br>ValueError: Unicode strings with encoding declaration are not supported. Please use bytes input or XML fragments without declaration.</pre><p>Something to do with Unicode Declaration. No issues. I’m really thankful to the developers contributing selflessly their knowledge on StackOverflow, StackGISExchange, StackAbuse and so on.. From there only did I learn how to solve this error.</p><p>The problem is with this line :</p><pre>k.from_string(doc)</pre><p>Its not utf- 8 encoded. Therefore, lets try to do that.</p><pre>k.from_string(doc.encode(&#39;utf-8&#39;))</pre><p>The code works now! The KML String is read and printed out.</p><h4>Lets try to get UsageExamples.py to work.</h4><p>After removing the print syntax issues.. running the code gives the same error as before with the encoding problem being in :</p><pre>k.from_string(kmlFile.read())</pre><p>Simply change it to :</p><pre>k.from_string(kmlFile.read().encode(&#39;utf-8&#39;))</pre><p>Running the KML File now prints out all the feature(which we discussed earlier) names present in the KML File! Also go through the KML Samples file to understand the KML Tags and what has been printed in the Terminal.</p><p>So, now we know how to create as well as read KML Files!</p><p><em>I got the code working, right? So you can trust me to know what I’m talking about here :))</em></p><h3>Parsing Features</h3><p>Now I’ll try to explain the code.</p><p>This is the relevant code.</p><pre>from fastkml import kml<br># Create the KML object to store the parsed result<br>k = kml.KML()<br># Read in the KML string<br>k.from_string(doc.encode(&#39;utf-8&#39;))<br># k.from_string(kmlFile.read().encode(&#39;utf-8&#39;)) # when its a file</pre><p>Till here the string/ file is read.</p><p>Now we have a method named ‘features’. Its a <strong>generator object</strong>, and generates all the features present inside a KML File. i.e. Document, Folder and Placemark. (<strong>Nothing else</strong>).</p><p>Mostly the files that you use have a root tag.</p><pre>&lt;kml&gt;</pre><pre>&lt;/kml&gt;</pre><p>Inside we have usually a sub — root in which everything else is contained. This might be a &lt;Document&gt;, &lt;Folder&gt; or &lt;Placemark&gt;. But everything must be contained inside it.</p><pre>&lt;kml&gt;<br>   &lt;Document&gt;<br>         .......<br>    &lt;/Document&gt;<br>&lt;/kml&gt;</pre><p>should be of this form.</p><p>To get the features inside , we use the method ‘features’.</p><pre>features = list(k.features()) # gives all the features inside</pre><p>However, you must note these are only the features present on the <strong><em>outside</em></strong>. The tree structure, it doesn’t go <em>inside</em> the branches.</p><pre># ReadKml.py<br>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br>&lt;kml xmlns=&quot;<a href="http://www.opengis.net/kml/2.2">http://www.opengis.net/kml/2.2</a>&quot;&gt;<br>&lt;Document&gt;<br>  &lt;name&gt;Document.kml&lt;/name&gt;<br>  &lt;open&gt;1&lt;/open&gt;<br>  &lt;Style id=&quot;exampleStyleDocument&quot;&gt;<br>    &lt;LabelStyle&gt;<br>      &lt;color&gt;ff0000cc&lt;/color&gt;<br>    &lt;/LabelStyle&gt;<br>  &lt;/Style&gt;<br>  &lt;Placemark&gt;<br>    &lt;name&gt;Document Feature 1&lt;/name&gt;<br>    &lt;styleUrl&gt;#exampleStyleDocument&lt;/styleUrl&gt;<br>    &lt;Point&gt;<br>      &lt;coordinates&gt;-122.371,37.816,0&lt;/coordinates&gt;<br>    &lt;/Point&gt;<br>  &lt;/Placemark&gt;<br>  &lt;Placemark&gt;<br>    &lt;name&gt;Document Feature 2&lt;/name&gt;<br>    &lt;styleUrl&gt;#exampleStyleDocument&lt;/styleUrl&gt;<br>    &lt;Point&gt;<br>      &lt;coordinates&gt;-122.370,37.817,0&lt;/coordinates&gt;<br>    &lt;/Point&gt;<br>  &lt;/Placemark&gt;<br>&lt;/Document&gt;<br>&lt;/kml&gt;</pre><p>Here, we see that the outer tag is &lt;Document&gt;. Therefore, when we run ReadKml.py, it gives len(features) = 1.</p><p>Inside Document, we have 2 Placemarks. Therefore when we run len(list(features[0].features())) it gives 2.</p><p>So, we need a <strong>recursive function</strong> to parse throughout the file, and you can find it in UsageExamples.py.</p><pre>def print_child_features(element):<br>    &quot;&quot;&quot; Prints the name of every child node of the given element,   recursively &quot;&quot;&quot;<br>    if not getattr(element, &#39;features&#39;, None):<br>        return<br>    for feature in element.features():<br>        print(feature.name)<br>        print_child_features(feature)</pre><p>This will print out all the features (Documents, Folders and Placemarks). Of course, our main resource is Placemarks.</p><p>Here’s a function that I had written to find all Placemarks inside a KML File.</p><pre>k = kml.KML()<br>document = list(k.features())<br></pre><pre>def parse_placemarks(self, document):<br>    for feature in document:<br>        if isinstance(feature, kml.Placemark):  <br>           placemark = feature<br>           self.parse_geometries(placemark)<br>    for feature in document:<br>        if isinstance(feature, kml.Folder):<br>            self.parse_placemarks(list(feature.features()))<br>        if isinstance(feature, kml.Document):<br>           self.parse_placemarks(list(feature.features()))</pre><p>The above function parses , finds Placemarks throughout the file, and then parses the individual geometry of the Placemark as well (through ‘parse_geometries’ method).</p><blockquote>Note: After getting the placemark, you can use<strong> placemark.name</strong>, <strong>placemark.description</strong> to get more attribute information :))</blockquote><h3>Parsing Geometries</h3><p>The codebase for parsing geometries is present in the geometry.py file in fastKML. This file has been derived heavily from <a href="https://pypi.org/project/Shapely/">shapely</a>, and currently <a href="https://pypi.org/project/pygeoif/">pygeoif</a>. So, you might want to have a look into it to solve your issues. Luckily for you, i already went code diving, and here is all the gold I found.</p><p>Just like placemark.name, placemark.description, you can call <strong>placemark.geometry</strong>.</p><p>All different geometries are classes inside the file. So i can test if the <strong>placemark geometry object</strong> is an instance of any of the geometry classes present in geometry.py.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4dad4caa710b2a3dbb3e6a3637380ff5/href">https://medium.com/media/4dad4caa710b2a3dbb3e6a3637380ff5/href</a></iframe><p>Now that we can identify the geometry of a Placemark, mostly the focus is on acquiring its coordinates. These coordinates can later be used to plot on map using Matplotlib or other plotting means.</p><p>I was fairly shocked seeing this question on StackExchange :</p><p><a href="https://gis.stackexchange.com/questions/343265/extracting-coordinates-of-placemark-from-kml-using-fastkml/343270#343270">Extracting coordinates of placemark from KML using FastKML?</a></p><p>This shows that there is a major lack of documentation for developers to use FastKML.</p><p>Based on my work, I identified all geometries and how to extract their coordinates through effortful experimentation. Hope the following gist is helpful for you all!</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cf1e3cb234d5da87bbec2e38f2f60872/href">https://medium.com/media/cf1e3cb234d5da87bbec2e38f2f60872/href</a></iframe><p>Now you can identify the geometry and extract relevant coordinates! These coordinates can then be used to plot the coordinates. You can check out my plotting of the coordinates at the link at the bottom :))</p><h3>Parsing Styles</h3><p>The relevant file for parsing styles in fastKML is : styles.py. You can find all the methods for different types of Styles in it.</p><p>Unlike Geometries, Styles can be <em>global </em>i.e. defined outside of a Placemark. So, in coding terms we can say that we have a global Style and local Style.</p><p>Most of the functions in FastKML are related to the KML Tags. So, we can easily call classes (such as styles.LineStyle and styles.PolyStyle) for our work.</p><p>Styles is a bit difficult to explain; its better to try it or see its implementation.</p><p>I would encourage you to try out using Styles on your own, based on geometry related gists above.</p><p>If you face any issues, check out usage of styles in <a href="https://github.com/cleder/fastkml/blob/master/fastkml/test_main.py">here</a>.</p><blockquote>For a real world usage, you can check out the functions “<strong>draw(), parse_styles(), parse_local_styles() and get_style_params()</strong>” in my project link at the end of the article.</blockquote><h3>Bonus : Treasure trove of KML Examples!</h3><p><a href="https://github.com/googlearchive/kml-samples">googlearchive/kml-samples</a></p><p>Find examples of all types of KML here. Amazing collection!</p><h3>My Project</h3><p>Here’s a link to my project where I worked with Features, Styles and Geometries. This might be the single best use case of FastKML and KML in Open Source. So, for anyone dealing with KML, do check out the link below.</p><p><a href="https://bitbucket.org/wxmetvis/mss/src/develop/mslib/msui/kmloverlay_dockwidget.py">Bitbucket</a></p><p>I will be spending time over the following weeks answering stackoverflow, gis.stackexchange questions to help impart my KML knowledge. Giving back to the community is one of my main aims in life, and this will be a small attempt towards fulfilling it :))</p><p>I am really grateful to be a part of the Open Source Community!</p><blockquote>Thanks for Reading! If this helped you out, do let me know! If you would like to discuss my work, or have doubts, you can <a href="http://www.linkedin.com/in/wwaryangupta">connect</a> with me on LinkedIn. I might be slow, but I do reply back :P</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=58b8e19b8454" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mapping my Journey through GSoC’20 — Landing.]]></title>
            <link>https://medium.com/@wwaryan/mapping-my-journey-through-gsoc20-landing-abdc151f2327?source=rss-f6a9c79d65f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/abdc151f2327</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[google-summer-of-code]]></category>
            <category><![CDATA[gsoc]]></category>
            <category><![CDATA[mission-support-system]]></category>
            <dc:creator><![CDATA[Aryan Gupta]]></dc:creator>
            <pubDate>Mon, 31 Aug 2020 14:31:12 GMT</pubDate>
            <atom:updated>2020-08-31T14:31:12.658Z</atom:updated>
            <content:encoded><![CDATA[<h4>MONTHLY LEARNINGS IN GOOGLE SUMMER OF CODE 2020</h4><h3>Mapping my Journey through GSoC’20 — Landing.</h3><h4>My Final Month as a GSoC 2020 Student Developer!</h4><p><em>(I am Aryan Gupta, developing the MSS Software under Python Software Foundation through Google Summer of Code, 2020.</em></p><p>The Third Month of GSoC is fast paced. There’s writing tests, fixing bugs, catching up on backlogs, new features, documentation. Only when you are finished with the project do you get a breather.</p><p>Finally, the Last day of GSoC has arrived ;))</p><p>There’s not much of story writing here. Its basically wrapping up the project. Read on to see what I worked on in the last month and my learnings :))</p><h3>Front-End Development</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/951/1*72bEuWqvrcX_4GzeVRFZrA.png" /></figure><p>The UI is as minimal as it is. However, I still had to change button functionalities for better user experience.</p><blockquote>My two cents : Perspective plays an important role.</blockquote><blockquote>In Marketing, users are considered gods. Their word is our command. They can never be wrong.</blockquote><blockquote>In Development, users are considered dumb. Who need to be guided at every stage. Software should be intuitive, not make them guess what to do.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/354/1*8d5bocmxZBnQ19FoFcni3w.gif" /></figure><h3>Back-End Development</h3><h4>Fastkml Support</h4><p>Fastkml implementation can parse all files. However, it won’t <em>read </em>the feature for which we have not added functionality. it will simply skip it. This helps prevent crashes when it encounters a foreign KML tag.</p><p>Here’s a table for important KML Features.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/454/1*L-kwTGk_sfuh4-VHGRcDLw.png" /></figure><p>Some KML Features, at this point are not relevant for MSS. This includes those which connect to the Internet. Its considered unsafe for flight planning. Other things that are not necessary include adding an extra terrestrial layer or show pictures of places like in Google Earth. Its not needed in MSS.</p><p>The green parts are what I have added, in summary :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/456/1*UT8rQSk3skSv7HaRsRqJBA.png" /></figure><p>So, I am pretty confident all legal KML Files can be run, parsed, displayed on the map with the correct geometry and style :))</p><h4>Attention to Detail— When you can’t see whats right in front of you.</h4><p>A new feature that the mentors suggested was the flexibility to restore files in their last used state the next time KML Overlay is opened.</p><p>Sounded easy. I could save the last states of the files in a dictionary through the destructor, save settings to disk and then call those files the next time KML Overlay is opened. I wrote the required code and ran it.</p><pre>File &quot;/home/aryan/anaconda3/envs/mssdev/lib/python3.7/site-packages/matplotlib/figure.py&quot;, line 1909, in __getstate__<br>    if getattr(self.canvas, &#39;manager&#39;, None) \<br>RuntimeError: wrapped C/C++ object of type MplTopViewCanvas has been deleted</pre><p>Funny thing : I have been working strictly with Python. Why did I get a C/C++ error? And some object was apparently deleted… And I have been working with storing stuff in disk memory..really gave me anxiety.</p><p>Obscure errors like these make programming take more time than scheduled.</p><p>I tried, but couldn’t figure out the cause of the error. Joern pointed out my mistake —</p><p>I had a dictionary containing info of the file — its name, linewidth, colour and the <em>patch </em><strong><em>object</em></strong> which was drawn on the map. I was attempting to save that dictionary, hitherto store an object in disk, that object got deleted when the program stopped running, hence the memory corruption.</p><blockquote>Me : I feel silly. The answer was right in front of me.</blockquote><blockquote>Joern : You always do afterwards. Hindsight is so easy :)</blockquote><h4>Bug Fixing &amp; Fixing Crashes</h4><p>When you make changes quite fast, you forget to test out everything, and this gives rise to bugs. I faced a lot of them in the last 2 weeks. It was kinda embarrassing, when all the mentors were messaging “ Aryan, another bug”.</p><p>I am happy that the mentors found those errors early on , so I could fix them.</p><p>Then there were the crashes.</p><p>I am very confident about my Fastkml implementation. It was a shock when Reimar sent a KML File which<em> crashed the software</em>. The file threw up parsing errors, it got stuck and was difficult to remove from the ListWidget.</p><p>I went through the file. There was simply no fault anywhere in the KML Syntax. Even my Except statement to catch Syntax errors had not caught this. I did the trial and error method; removed some parts, tested which part was working and which was not.</p><p>The problem turned out to be a comma.</p><p>3D coordinates of LineStrings are separated by commas, and different points are separated by a whitespace. For example</p><pre>1,2,0.0 3,4,0.0 </pre><p>represents coordinates (1,2,0.0) and (3,4,0.0). The KML File didn’t have the space between the points, but a comma. Thus it was being parsed as a 6 Dimensional coordinate than a 3 dimensional one!</p><blockquote>You can have no idea what kind of things can cause error. You can just minimize it.</blockquote><p>This put in a new doubt; Any badly written KML File can crash the software. Even a file having “Hello World” with a KML extension, and the software crashes. So, I set up better measures to catch and resolve such issues.</p><h4>Writing Tests, Logging and Exceptions</h4><p>Test Writing is tough. I learnt that Mocking is an important concept of tests, and damn useful!</p><p>I wrote tests for Automating Mouse Clicks for PyQt Elements, and for parsing KML Files and testing what patches were being plotted on the map.</p><p>Tests show vulnerabilities in the system. To fix these vulnerabilities, the easiest way is to catch the error in an Exception. However, I got into a bad habit of writing open Exceptions i.e.</p><pre>except Exception as e:</pre><p>This is not at all useful. It catches all the errors, so if somewhere the software fails, you will not be able to debug where the error occurred, since you are giving the error a free pass into the system.</p><p>Writing specific Exceptions, (and then logging the error) is the way to go!</p><p>Here are some awesome links to check out :</p><ul><li><a href="https://www.toptal.com/python/an-introduction-to-mocking-in-python">An Introduction to Mocking in Python | Toptal®</a></li><li><a href="https://changhsinlee.com/pytest-mock/">pytest: How to mock in Python</a></li><li><a href="https://www.loggly.com/blog/exceptional-logging-of-exceptions-in-python/">Exceptional Logging of Exceptions in Python</a></li></ul><h4>Final Product — Documentation &amp; Demonstration</h4><p>You can find an overview of my GSoC Project right <a href="https://bitbucket.org/wxmetvis/mss/wiki/KML:%20Enhance%20KML%20Support%20-%20GSoC%202020">here</a>.</p><p>Its better to see those features in action. Here’s my Demo Video!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FG4aPIRLBz9U%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DG4aPIRLBz9U&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FG4aPIRLBz9U%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/f7b4bbd7ad83a0a3a655f70e1ba6c35a/href">https://medium.com/media/f7b4bbd7ad83a0a3a655f70e1ba6c35a/href</a></iframe><p><em>(Enhancing KML Support Demo Video — Mission Support System — GSoC 2020 by Aryan Gupta is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License).</em></p><h3>Stats &amp; Learnings</h3><p>These might not be for all, but a good source of help for me, when I face anxiety while coding.</p><ul><li>Its just a problem. Its not everything. It will take time. But it will be solved.</li><li>Take a break after a burnout. Fresh mind generates new ideas. ( I found it helpful to sleep on a problem and wake up with the solution next morning).</li><li>Don’t sit in front of the screen all day. Do monotonous chores, physical exertion helps and the mind solves the problem on its own.</li><li>Coding really just involves Objects and for loop and try except statements, the works. If you know the basics, you can accomplish a lot. Don’t put yourself down based on your present skill level. Just get started and <em>Hustle</em>!</li><li>Programming is like 2 gears moving, and in between you keep adding more gears. You have to keep them all moving together.</li><li>Its not about the number of lines, number of PRs. Its not about comparison with anyone. Its about learning for your own good.</li><li>Writing down stuff helps. I finished up 1.5 notebooks working on my project.</li><li>You can ask for help without feeling guilty if you have tried it on your own. Googling helps.</li></ul><h3>Acknowledgements</h3><p>I’m thankful to my mentors Jörn Ungermann, Reimar Bauer and Christian Rolf who provided immense support and motivation to persevere through all my difficulties. They sympathised with my problems and gave me ideas on how to face the challenges head on. Without their guidance, I would have been lost. I would also like to thank my GSoC mate Tanish who helped me out with my small doubts from time to time :))</p><p>I’m also grateful to MSS, PSF &amp; the GSoC Community. This program has made me more confident about my abilities, and has strengthened my belief in the fact that passion, perseverance and patience can help you achieve wonders!</p><p>Finally, to the Open Source Community : Thank you for being so welcoming. I started from scratch and three months later, its still hard for me to believe that I developed a feature of a software :)) Thank you for giving me this opportunity, and I’ll personally continue forward the Open Source spirit with my future contributions.</p><p><em>Signing out,</em></p><p><em>Aryan</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Don-AB2jGrCB8AHFYf2x7g.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=abdc151f2327" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mapping my Journey through GSoC’20 — Flight.]]></title>
            <link>https://medium.com/@wwaryan/mapping-my-journey-through-gsoc20-flight-2f4184cd4513?source=rss-f6a9c79d65f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f4184cd4513</guid>
            <category><![CDATA[gsoc]]></category>
            <category><![CDATA[gis]]></category>
            <category><![CDATA[google-summer-of-code]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Aryan Gupta]]></dc:creator>
            <pubDate>Thu, 30 Jul 2020 16:09:31 GMT</pubDate>
            <atom:updated>2021-06-02T11:39:16.015Z</atom:updated>
            <content:encoded><![CDATA[<h4>Monthly Learnings in Google Summer of Code 2020</h4><h3>Mapping my Journey through GSoC’20 — Flight.</h3><h4>My Second Month as a Student Software Developer!</h4><p>Hello Readers!</p><p><em>(I am Aryan Gupta, developing the MSS Software under Python Software Foundation through Google Summer of Code, 2020. To know more about my organisation and project, </em><a href="https://medium.com/@wwaryan/mapping-my-way-through-gsoc20-a2bed6cdd151"><em>read here</em></a><em>. And you can find the First month learnings </em><a href="https://medium.com/@wwaryan/mapping-my-journey-through-gsoc20-pilot-9c7040bc4ff8"><em>here</em></a><em>.)</em></p><p>My last post (and month) ended with me finally able to display multiple KML Files on a single map.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/772/1*qoM1pYLLcyIk5bWgUuoswA.png" /><figcaption>Multiple KML Layers on a single map.</figcaption></figure><p>This was a huge confidence booster for me, since at the very start, I had no idea how I would ever be able to do this.</p><p>But, working on the software, understanding it, getting to know the ins and outs really paves the way through to the logical solution.</p><blockquote><strong>Situation</strong> : The Original Implementation derived colour and linewidth from KML ‘Styles’ and then plotted them through the matplotlib library.</blockquote><blockquote><strong>Feature</strong> : Displaying Multiple KML Files on the Single Map</blockquote><blockquote><strong>Solution</strong> : Add a .. loop to plot KML Files one by one.</blockquote><p>Though quite simple in logic, it wasn’t so easy in implementation. The whole module had been hardcoded for a single KML file, and I had to make a lot of changes to achieve it.</p><p><em>(By this time, I received my First Evaluation, and the first pay :P)</em></p><h3>Week 5 — High</h3><p>I was very happy, motivated. I had completed my first month of coding, accomplished a major point. I used this momentum to work better!</p><p>Here are the following features I added!</p><p><strong>Wednesday, July 1st :</strong></p><ul><li>Fixed the Bugs while loading multiple files</li><li>Added feature of selecting multiple files simultaneously in file selection dialog box</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*S6MJc1xX8Tq5uz7Oe4Hrag.gif" /><figcaption>Selecting Multiple Files simultaneously</figcaption></figure><p><strong>Thursday, July 2nd</strong></p><ul><li>Multiple Files can now be added <em>simultaneously</em></li><li>Multiple Files can be displayed <em>simultaneously</em></li><li>Functionality for Remove and Remove All Buttons for clearing the list</li><li>Double clicking on any KML file in the listWidget opens up a custom dialog box UI.</li><li>Finished Bug fixing</li></ul><p><strong>Friday, July 3rd</strong></p><ul><li>Single button “Add KML File” for adding &amp; loading multiple KML Files simultaneously</li><li>Enhancement → duplicate files are not loaded again.</li><li>Reduced Size of ListWidget</li><li>Check- Uncheck feature to load KML layer</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*cyArI78rux8yBegxW-tCEw.gif" /><figcaption>Check/ Uncheck KML File to display/ hide respective plot</figcaption></figure><h3>Week 6 — Low</h3><p>I started the week on a high, enthused with the smooth accomplishment of features everyday. My main task now was to add a customize functionality to each KML File. Each KML File could have their own color, linewidth, and could be easily added, removed, displayed and saved. One simple task.</p><p>I could not do it.</p><p>I tried on Monday, wasn’t able to do it. ‘Lets try tomorrow again”.<br>Tuesday, Wednesday passed. By Thursday, I was on edge; I wasn’t making any Journalheadway in the feature, I hadn’t updated my mentors.</p><p>Thursday night, I realized what I had to do. And it literally <em>frightened</em> me.</p><p>The problem was to store data (linewidth, colour) for each KML File, and keep updating it, with every change.</p><p>I had been using <em>two different lists</em> to store data. One list to run the files, another to run the patches for plotting. I realized, I had to change the data structure on which I had built the entire project.</p><blockquote>Nested Dictionaries!</blockquote><p>My plan is to create a structure like :<br>Dict = { ‘ file 1’ : {‘color’ : […. ], ‘linewidth’ : ‘ 3’},<br> ‘file 2’ : {…………………………………………}}</p><p>I slept on it. Started working from Friday, day to night, replaced each and every part, transformed it all into a dictionary storing information about every file , patch , linewidth and colour. I worked all weekend on it. Sunday night, I was finally able to display individual colour and linewidth for each and every KML File. <br><em>I was so happy!! And the peaceful sleep that I had :))))</em></p><p>All the data is stored in nested dictionaries, which can easily find problems, if any. Here’s the result :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*vKxxPemHNw7HJEf7DDwoJA.gif" /><figcaption>Feature to modify individual colour and linewidth</figcaption></figure><h3>Week 7 — Drag</h3><p>The ‘Merge KML’ feature involves merging several KML Files together, into a single file.</p><p>The Scenario where this is useful is : You used several files, u displayed them, u changed their colours and linewidths. Now you wish to save them. You do not want to do the whole process again. This is where merge KML comes in.</p><p>It creates a single file comprising of all the files. You simply need to load this file, and you will get all your plots back.</p><p>There is very less info on doing that on the internet. Most of the stuff I found was combining KML files i.e. joining Placemarks together etc. But that wouldn’t have been feasible for the large files that we use.</p><p>So I tried some experiments, and decided to copy the root elements of each file, add a Folder as a new root, and then put them all in a folder. It works!!</p><p>I tried it on all the sample files, and its working. There might be issues with other files, cos merging is a tricky business, but I think it should work for the majority :))</p><p>The only condition is that the KML File should not have any irrelevant stuff ( like comments ) between &lt;kml&gt; and the first tag : &lt;Document&gt; or &lt;Folder&gt; or whatever.</p><p>Do check it out :))</p><p><em>(This feature works, but its in its primary stage : it merges the KML Files, but shows them all with the same linewidth and colour. I propose to save the states as envisioned by the User.)</em></p><h3>Week 8 — Turbulence</h3><p>Writing Tests is tough. You have to have a different mindset; instead of defending your code, you attack it, trying to find its weaknesses. In the larger picture , this makes your code more stronger and durable.</p><blockquote>Testing code often reveals that it cannot be tested.</blockquote><p>I thought writing tests would be easy. From what I had seen, I had to simulate button clicks and then use assert statements.</p><p>But not all clicks, events are easy to simulate. I wasn’t able to simulate selecting a file from a QFileDialog, and it took me the whole week to <em>find a workaround</em> to select files.</p><p>And the mock library.. uff.</p><blockquote>That is one of the advantages of test-driven development. If you think about the test first, you do not run into problems such as this later.You maybe see now, why it is a good idea to separate UI from logic, if you didn’t know that before.</blockquote><p>Makes much more sense now.</p><p>This is how my Second Month ended :))</p><p><em>(Currently, I am progressing with my project in the third month of GSoC. I will write about the next part of my journey soon!Three-fourths in, lets do this!)</em></p><p>Thanks for reading!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/0*RQR7aaxSASAKSaSs.jpg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f4184cd4513" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mapping my Journey through GSoC’20 : Pilot.]]></title>
            <link>https://medium.com/@wwaryan/mapping-my-journey-through-gsoc20-pilot-9c7040bc4ff8?source=rss-f6a9c79d65f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c7040bc4ff8</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[google-summer-of-code]]></category>
            <category><![CDATA[gis]]></category>
            <category><![CDATA[gsoc]]></category>
            <dc:creator><![CDATA[Aryan Gupta]]></dc:creator>
            <pubDate>Mon, 20 Jul 2020 14:35:58 GMT</pubDate>
            <atom:updated>2020-07-20T14:36:34.462Z</atom:updated>
            <content:encoded><![CDATA[<h4>Monthly Learnings in Google Summer of Code 2020</h4><h3>Mapping my Journey through GSoC’20 — Pilot.</h3><h4>My First Month as a Student Software Developer!</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/0*oRev7Xv8qARcjXJZ.png" /><figcaption>Mission Support System — Python Software Foundation</figcaption></figure><p>The point of this blog — I am already writing weekly blogs <a href="https://blogs.python-gsoc.org/en/aryan_guptas-blog/">here</a>. But they are supposed to be professional, concise and related to work. There is so much going on — GSoC, pandemic, personal… a lot! And I wish to jot it all down.</p><p>For context, I am Aryan Gupta, developing the MSS Software under Python Software Foundation through Google Summer of Code, 2020. To know more about my organisation and project, <a href="https://medium.com/@wwaryan/mapping-my-way-through-gsoc20-a2bed6cdd151">read here</a>.</p><p>Originally this was going to be a weekly blog, but time passes so fast nowadays. Listlessly. Mindlessly.</p><p>Its a good time to recount my last 2 months.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E8ShuzQdQk7Ga8cvkUAk1Q.png" /></figure><h3>Community Bonding Period : (May 4 to June 1)</h3><p>In this period I got to know my 3 mentors : Joern Ungermann , Reimar Bauer and Christian Rolf. They are really cool scientists!</p><p>MSS came into existence mainly because of their work. These scientists use MSS on experimental campaigns to determine where and how to fly on the German HALO Aircraft.</p><p>The KML feature of the map was ‘hacked’ up when they had to mark locations on flight that they needed to avoid. But it is still an Experimental Feature. Lots of things for me to do!</p><p>I was in complete awe when they were sharing their work with me. Amazing people, amazing lives.</p><blockquote>‘Aryan, can you tell us briefly something about you?’<br>Umm… I’d rather not, haha</blockquote><blockquote>‘Whats your coding experience?’</blockquote><blockquote>I have been working with Python for about 6 months now.I also have done some normal programs .. in C, C++, Java.. but I have kinda forgot about it..</blockquote><blockquote>Joern : No one, except Stroustrup, knows all of C++.</blockquote><p>Which made me wonder if he really knew Stroustrup. Looking at his stature, he probably did.</p><p>I was very confused about my project, really nervous.</p><p>See, I had written my proposal in the same way we criticise each other; <br>I tried out Google Earth, the KML features it had, and compared it with the MSS Software. Then I filled up my proposal with “ This is missing, that is missing”, completely <em>missing</em> that I would have to be the one to incorporate those features with my bare par coding and logical skills!</p><p>I compared KML features in freaking Google Earth (which I use to look at my home from ‘<em>above’) </em>with MSS Software, designed specifically for environmental scientists doing experiments on a plane! How, very smart of me.</p><p>…</p><p>My project focuses on designing a new UI with better features to support KML Overlaying in MSS Software. I have no experience in designing; heck, I don’t even have much of a hearsay in programming either!</p><p>Doubt, confusion, hesitation, procrastination.. all symptoms of imposter syndrome. Uff. ‘Its a fluke, you just got lucky, there were better deserving candidates…’ on and on in my mind.</p><p>The best thing to do is accept. Accept the situation. And then get even; get even with the odds.</p><p>For sure, its luck. I am lucky to be one of the 1200 odd students selected all over the world. Maybe they made a mistake in selecting me. Maybe I might let them down. But I have got this opportunity, and I am not giving up without a fight.</p><p>With newfound vigour and motivation, I started reading documentation and going through the codebase (not really getting it, but .. trying).</p><p><strong>Test Coverage</strong> is an essential component of software development.</p><blockquote>“All code is guilty, until proven innocent” — Anonymous</blockquote><p>Basically, we cannot take at face value that the code is working. Maybe newer code might not be compatible with the previous one and you will have no way of checking it out. You cannot physically remember, each line, reason for writing it, and what is it supposed to do.</p><p>Sometimes, it takes one feature, but for me it usually takes one line of code to send my screen blinking red with errors!</p><p>That’s why we have test. Tests are automating the cases for which the code was written, and are run through frameworks like unit test or pytest.</p><p>So, the process is : You read and understand the code already written, you write your code, check if its functioning correctly (manually), you add comments, some documentation, and write tests to automatically verify if the code is working.</p><p>Some say its a good practice to write tests <em>first</em>, and then code later, so you know exactly what the code has to do.</p><h4>The Side Project</h4><p>Joern discussed an interesting side project with me: ‘Setup some tests for the proper display of KML, which we currently do not have (e.g. based on fuzzy image comparisons)’.</p><p>For context, tests are usually based on the deterministic internal state of software. You are testing the features and functions that you have written.</p><p>The output you are receiving, you believe it to be the right answer.<br>But, <em>is it?</em></p><p>In my case, code has already been written to plot out KML Files. You get beautiful images on the maps on inputting a KML File!</p><blockquote>But how sure are you that these are the actual images that need to be plotted? Is something else being plotted as well? Are there misconfigurations??<br>How sure are you, that the right colours are being displayed? (since different monitors have different Operating Systems, and they use different backends for drawing?</blockquote><p>Truth is, you aren’t sure.<br>You are hoping that you are right, and praying that even if you are wrong, you haven’t messed up by a long mark.</p><p>Joern’s idea is to come up with a test which can save the current image as a .png file or so, and compare it fuzzily to a reference, and check for sufficient similarity. The check can either be manual or otherwise.</p><p>I love this idea! And it sounds like an exciting project for me to get back into OpenCV!</p><p>I spent the rest of the community period reading, researching, making notes on the following:</p><ul><li>KML and OGC KML Specifications</li><li>KML implementing python libraries ( lxml, pykml &amp; fastkml)</li><li>MSS Documentation, my Proposal</li><li>For my own sake, I went through some Python refreshers, pytest and more!</li></ul><p>P.S. At the end of the community bonding period, I was given a branch to work on, a branch with my name!</p><p>(I’m not a nerd, I just love when I find my name attached to something good!)</p><h3>Week 1 : ( June 1 to June 7 ) — Despair</h3><blockquote>Getting Started is always the toughest part.<br>For me, it proved quite easy. Or so I thought.</blockquote><p>For the first week, I had two tasks:</p><ol><li>Adding Fastkml Support</li><li>Solve Fastkml security issues caught by <a href="https://pypi.org/project/bandit/">Bandit</a></li></ol><p>I started with the 2nd task. It looked quite easy. <strong>Bandit</strong> is a security linter for Python i.e. it finds common security issues with code. I did a Bandit run on Fastkml, which threw up 6 Security Issues, and I was able to solve 4 of it. The other 2 require switching the whole fastkml library from lxml dependency to defusedxml, and required functions were not available in that library. Still, took me two days, since I get very wary of newer code, or .. code in general.</p><p>(Fastkml is hosted on Github, and MSS is hosted on Bitbucket, so I confirmed with the mentors that my work with Bandit will still be approved as GSoC work.)</p><p>I took Wednesday off. I had completed half of my work of the first week. And I had already seen and estimated that the rest of the work would be quite easy.</p><p>From my research, I could see that I just had to set the KML parser through fastkml library; maybe 2 lines of code to be written. And voila! I would have ‘added’ fastkml support.</p><p>I was so wrong.</p><p><strong>Backdrop</strong> : The original KML parsing was done through pykml library, and the plotting on the map through Matplotlib. However, pykml hadn’t been updated for python 3 +, and so they had stripped it down to the bare essentials : lxml.</p><p>lxml is the most basic implementation of KML, XML , HTML or any other Markup language. It parses through the data and creates tree structures with nodes, containing data.</p><p>My plan was to switch it up with Fastkml. One library, One solution.</p><p>Why Fastkml? Fastkml, as advertised is supposed to be ‘fast’.</p><blockquote>‘Fast refers to the time you spend to write and read KML files as well as the time you spend to get acquainted to the library or to create KML objects.’ — <a href="https://pypi.org/project/fastkml/">Fastkml</a>.</blockquote><p>That was one of the main reasons for selecting it. SimpleKML couldn’t parse data, pykml hadnt been maintained and well..fastkml says its fast.</p><p>Fastkml is built upon lxml. It uses lxml to create methods specifically related to KML, such as Placemarks, Geometry and Styles.I’ll be writing in detail about using Fastkml in a later post.</p><p><strong>Roadblocks</strong> :</p><ul><li>I had to deal with 3 libraries ( lxml, defusedxml, fastkml), all inter dependent on each other, which was a sure hassle.</li><li>Switching from lxml to fastkml was difficult. I had to understand fastkml’s codebase. There weren’t many examples to take inspiration from. I had to experiment through hours of trial and error to make one codeline of progress.</li><li>I faced some difficulty working with Fastkml because of an encoding (Unicode and raw bytes) issue, which took me a lot of time to figure out, but I did.</li><li>My previous notion that I only had to switch 2 codelines was unfounded by the fact that the lxml API returns an object which calls different methods. Fastkml does a lot of stuff in abstraction, and does not return any object. I had to make lots of tweaks, which made me feel like a fraud.</li></ul><p>But, I was able to get through it, by giving the code enough time and thought. Weekends are supposed to be off, but I worked.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/815/1*WCPg9Y6MOQjecNaOgsFYPA.png" /><figcaption>KML File plot in MSS Software, before I touched the software.</figcaption></figure><p>Before I started coding, everything was working. And then it was not. And the reason was me.</p><h3>Week 2 : ( June 8 to June 15 ) — Hope</h3><blockquote>I didn’t talk to the mentors for 5 days straight.</blockquote><p>What would I have said? That I have completely wrecked the code? I have no idea what I’m doing? Nope. First priority — damage control.</p><p><em>(Just so you know : </em><strong><em>no one</em></strong><em> can wreck the code at any time. The code in production is different, its protected. I had only messed up a small feature in a big software in the development branch made specifically for me. No big deal. But in times of crisis, it doesn’t feel like that, does it?)</em></p><p>Mentors were very empathetic.</p><blockquote>‘It would be good, if you could upload your work regularly into a pull request, which we can review.’</blockquote><blockquote>‘…I would love to send a PR. But the fastkml support is causing me to change the whole kmloverlay file, and it’s not working completely.’</blockquote><blockquote>‘It is not necessary for the PR to be finished. We expect Work-in-progress, a WIP PR. See that more as a progress-report and an opportunity for us to give early feedback and tips and tricks to you.’</blockquote><p>I sent the PR, and explained my difficulties.</p><p>I was feeling very low, simply because I had a perfectly working system in lxml , which I had changed on a whim to fastkml, and I could not get it to work. The second week had started and I wasn’t close to finishing my first week’s tasks.</p><p>Joern talked me through. He said he would have been surprised if I had completed the Migration in a single week. Told me that the work isn’t time rigid, just keep on doing. That was quite helpful, at the time.</p><blockquote>‘I hope you are solving instead of introducing new issues with the migration. Prioritize implementing the improved UI with support for multiple KML Files rather than get stuck with the new library.’</blockquote><p>I took the advice. Instead of getting lost in the labyrinth of features in Fastkml, I focused on getting the parsed KML to be displayed.</p><p>This is what I came up with, at the end of two weeks — And I was so proud of myself!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/645/1*mMWfBrkQR_OKPy3kSEHjCQ.png" /><figcaption>ididthis.png</figcaption></figure><p>I was able to plot a single point on the Map, using Fastkml implementation.</p><p><em>(The plotting is </em><strong><em>not</em></strong><em> wrong. The KML File coordinates really point to that Airport in water. Don’t ask why, I do not know.)</em></p><p>In Week #1, I had added Fastkml support to kml overlay. However, not all dependencies were working. I spent the week solving all the issues making sure that all KML data was being parsed and the right info was being displayed.</p><p>KML focuses on mainly 3 things :</p><ul><li>Object (Document, Folder, Placemark)</li><li>Style</li><li>Geometry</li></ul><p>and it was very tough to get them all working in sync. I ran through numerous KML Test samples to check the code, and made changes accordingly.</p><p>By June 15, I had brought the implementation using Fastkml to par with the current one.</p><p><em>P.S. I was surprised to get a mail from Christian Ledermann, creator of Fastkml Library, congratulating me on GSoC. He even added me as a collaborator! Beats me how he knew, though. Google Alerts, I guess :))</em></p><h4><strong>Discussions :</strong></h4><p>In our weekly chats, I discussed a lot of technical stuff, and along with it the following:</p><ul><li><strong>Knowing the Target Audience</strong><br>There are numerous features in KML for displaying elements. eg. In Styles, you can display Labels , Balloons, and additional features like bgcolor, text , description etc.<br>From a Fastkml perspective, I can add all of them through predefined functions. But as a software , used by scientists, design matters less than ease of functionality. So, what should be my focus while working on my project?</li><li><strong>Timeline &amp; Flexibility</strong><br>With respect to my proposal, I am running a bit behind on my weekly progress. It is only because I am being quite careful in my implementation. I am regularly testing each feature. My coding speed is slow, but I am confident that I will catch up soon.</li></ul><p>After a long discussion, it was decided that my timeline should be altered and converted to 5 goals. And the new timeline made sense. The mentors were very blunt in the discussion and gave me a lot to think about!</p><blockquote>‘Most plans do not survive the contact with reality. Which isn’t an excuse for not planning at all, but one shouldn’t believe too much about projections into the future.’ — Joern</blockquote><h3>Week 3 : ( June 16 — June 22) — The Bug.</h3><p>Discussions with my mentors are very fruitful! After a long talk, we decided that the most suitable step next is to add the feature of “Displaying Multiple KML files” together.</p><p>I was glad to start early on this part , since its the major feature of my project.I was supposed to start working on the UI for adding Multiple KML Files.</p><p>And then Christian messaged.</p><p>‘Hi Aryan, I just tested your implementation with a KML file from the flightpath of our research aircraft and I got an error:</p><pre>self.patches.append(self.map.plot(x, y, “-”, zorder=10, **kwargs))<br>TypeError: plot() argument after ** must be a mapping, not list</pre><p>The KML Files that I had tested my implementation on averaged from 10 to 20 lines of KML, consisting of a few placemarks, present as points, a line, or a polygon.</p><p>Christian had tested my code with a KML File spanning over <em>7000 lines of coordinates.</em></p><p>When I saw the file, my first thought was “ Gee, no wonder my code broke” :(</p><p>I sat down, saw where the code was breaking. Turned out to be a data structure issue. Now I could clearly see that my code was of use on a larger scale. Not 5–10 coordinates, but 1000s!</p><p>I rechecked my code, made more changes. Read the earlier code, made more changes. I went through it till I was sure the code would work correctly. Then I went for the test drive.</p><p>I ran Christian’s file through my code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/812/1*pT77lO8QKjhSD_gheuANNg.png" /><figcaption>The orange- whitish plot</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/397/1*mFLjyepLSiAepOcAJE3AYw.png" /><figcaption>Same plot magnified 3 times</figcaption></figure><p>My perspective about my seemingly ‘small’ contribution changed. Significantly.</p><h4><strong>Working on the UI</strong></h4><p>I designed the new UI for the kml dock widget using PyQt Designer. It makes designing GUI items quite easy to design and incorporate within code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/653/1*vDYnNnTcCCbv3w_5egPZ7g.png" /><figcaption>Original UI</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/949/1*NmKPZTw4K9UeJOs0Gq0kiA.png" /><figcaption>New UI : Added elements, previous elements are kept for functionality of code.</figcaption></figure><p>My design didn’t involve much of Design as compared to Ease of Access. I decided to keep the items ‘spacy’ and minimalistic.</p><p>Thankfully, my 2 PRs have been accepted, and I am working hard to finish my next WIP pull request :))</p><h3>Week 4 : ( June 23 — June 29 ) — Making Progress</h3><p>Sometimes, I get hyper. Not usually, but yeah sometimes.</p><p>I was researching so much online about PyQt and having fun, I redesigned the UI <em>again</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*NJHvqkZx1NeBdOzUR8oLSA.png" /><figcaption>Clicking on the ‘Add Multiple KML Files’ would open a dialog box.</figcaption></figure><p>My thought process behind this change was that if someone wanted to add multiple KML Files, they could simply click the button. For users with single file usage, there should be no change in existing functionality.</p><p>Clicking on ‘Add Multiple KML Files’ would open a fully designed UI Dialog box with easy to use features!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/406/1*c2IkdnX9M1TqAmFm9jBLmA.png" /><figcaption>The UI that wasn’t.</figcaption></figure><p>When I showed the design to my mentors, well … they wanted a single User Interface. I did not feel good at the time, but the mentors are experienced, and are themselves users of the software.</p><p>I didn’t lose heart. Removed the extra UI, integrated into the original UI. I also added a ListWidget to store the list of KML Files! There were still problems with the logic, but I worked at it, and well.. take a look :))</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/772/1*qoM1pYLLcyIk5bWgUuoswA.png" /><figcaption>Displaying 5 different KML Files simultaneously!</figcaption></figure><p>My first month ended on this high! Finally, from scratch to current implementation to the proposed project. I had come far. And I had learnt a lot.</p><p>Still a long way to go!</p><p><em>(Currently, I am progressing with my project in the second month of GSoC. I will write about the next part of my journey soon!)</em></p><p><strong>Thank you for Reading!</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/0*V1bT5LqCBhuvQ88-.jpg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c7040bc4ff8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mapping my way through GSoC’20!]]></title>
            <link>https://medium.com/@wwaryan/mapping-my-way-through-gsoc20-a2bed6cdd151?source=rss-f6a9c79d65f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/a2bed6cdd151</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[gsoc]]></category>
            <category><![CDATA[gis]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[google-summer-of-code]]></category>
            <dc:creator><![CDATA[Aryan Gupta]]></dc:creator>
            <pubDate>Fri, 26 Jun 2020 06:16:13 GMT</pubDate>
            <atom:updated>2020-08-31T16:42:15.746Z</atom:updated>
            <content:encoded><![CDATA[<h4>MONTHLY LEARNINGS IN GOOGLE SUMMER OF CODE 2020</h4><h3>Mapping my Journey through GSoC’20!</h3><p><em>It’s a new day, it’s a new plan, I’ve been waiting for you.. Here I am.</em></p><p>Hello all, I am Aryan Gupta, a 2nd year student of <a href="https://ducic.ac.in/">Cluster Innovation Centre</a>, University of Delhi. I am pursuing B.Tech in I.T. &amp; M.I.(Information Technology and Mathematical Innovation) with a minor in System Biology.</p><p>This is a journal of my time working under the program Google Summer of Code 2020.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*miJ8dG1qyErkZkN4.png" /><figcaption>This Design is so simple, and beautiful!</figcaption></figure><p>I call this a journal, because.. its the middle of the pandemic. We all are stuck at home. Time moves <em>really</em> slow nowadays. And I’m hoping this keeps me focused and tracks my time and progress well.</p><p><strong>About the Program</strong> : Google Summer of Code is a global program focused on bringing more student developers into open source software development. Students get to work with an open source organisation on a 3 month programming project during their break from school.</p><p>I wouldn’t like to bore you with technical details; how to apply etc. Chances are you searched for this article or it was recommended to you, so you probably already know it. For a newbie who has chanced on this article, do first take a look at <a href="https://summerofcode.withgoogle.com/">this for context</a>.</p><p><em>Right, lets get started!</em></p><p>This year, I will be working with Mission Support System, a sub org of Python Software Foundation. I am really excited for this opportunity! And honestly, a bit nervous too :))</p><h3>About My Organisation : Mission Support System</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/0*3NcO3tY_4Pv8uSAG.png" /><figcaption><a href="http://mss.readthedocs.io/">Mission Support System</a></figcaption></figure><p>Mission Support System (MSS) has been written and is used by atmospheric scientists. The MSS software helps to plan scientific flights used for measuring atmospheric parameters. Its fully Open Source.</p><p>The measurement of relevant parameters, for example the chemical composition of trace gases, temperature or aerosol particle characteristics, are needed to improve the scientific understanding of the processes in the atmosphere. This is of significant importance for the understanding for example of climate change or the recovery of the ozone hole.</p><p>The research aircrafts typically carry a comprehensive scientific payload comprised of data acquisition instruments by different companies and research institutions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/849/0*Ahlm3NDjN0w68fjW.gif" /><figcaption><a href="https://www.halo.dlr.de/">The HALO Research Aircraft</a></figcaption></figure><p>Typically, scientific research flights are conducted to answer different scientific questions. Forecasts of relevant parameters by a model simulation for a specific location give hints where to fly, to answer the scientific questions by measurements.</p><p>A lot of other conditions apply to research flights, that concern flight altitude and range, ambient temperature, flight permissions in different flight information regions and aircraft traffic routes. Thus proposed flight paths are necessary while conducting research.</p><p>MSS optimises the output of research flights by displaying planned flight routes based on the above factors. This does two important things : reduces flight hours to answer scientific questions, and saves a lot of taxpayer money.</p><p>You can read more about MSS in this <a href="https://gmd.copernicus.org/articles/5/55/2012/gmd-5-55-2012.pdf">research paper</a>.</p><blockquote><em>And I have this wonderful opportunity to contribute to this noble work!!</em></blockquote><h3>About My Project : Enhancing KML Support</h3><p><em>Here’s the </em><a href="https://summerofcode.withgoogle.com/projects/#5216600321425408"><em>link</em></a><em> to my Project, right up on the GSoC page :))</em></p><p><a href="https://developers.google.com/kml/documentation/kml_tut">KML</a> stands for Keyhole Markup Language. KML has been derived from XML and is a file format to display geographic data in browsers or geographic information systems such as <a href="https://www.arcgis.com/">Arcgis</a> or in my case, MSS.</p><p>Its basically XML for geographic data. Softwares are used to parse data in KML Files and display the information <em>visually</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/0*h4uR5FR921smQa1X.png" /><figcaption>Basic example of KML</figcaption></figure><p>MSS visualizes KML data in 2D in the form of Point, Lines and Multi-Geometries. Below is a plot of a basic KML File.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/714/0*-wwI9TYCYL1fVsp7" /></figure><p>My project focuses on enhancing the KML experience. Right from the UI to the finer points (pardon) of the visualization!</p><p>My main aim is to provide support for Multiple KML Files. At present, only a single KML file can be executed and displayed, which in a way, does not give the full picture. With the new support, different KML Files could be displayed <em>simultaneously</em> with different colours and references.</p><p><em>You can read my Proposal for this project </em><a href="https://docs.google.com/document/d/1CqKeUrWIVderLWGh7aKV5_3WCKhiWSaYdCliuWDbdB8/edit?usp=sharing"><em>here</em></a><em>.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/941/0*uncxHkiImpr0rGiT.png" /><figcaption>Current implementation of MSS — KML Overlay</figcaption></figure><p>I think I’ll keep it till here for this chapter; Next, I’ll be writing on my weekly experiences and learnings. Stay tuned to know more :))</p><blockquote>Edit : During my GSoC , I wrote this blog realtime, for every month — with all the challenges and the way to persevere through. If you wish to read about my experiences and learnings, check out the following blogs :</blockquote><ul><li><a href="https://medium.com/@wwaryan/mapping-my-journey-through-gsoc20-pilot-9c7040bc4ff8">Mapping my Journey through GSoC’20 : Pilot.</a></li><li><a href="https://medium.com/@wwaryan/mapping-my-journey-through-gsoc20-flight-2f4184cd4513">Mapping my Journey through GSoC’20 — Flight.</a></li><li><a href="https://medium.com/@wwaryan/mapping-my-journey-through-gsoc20-landing-abdc151f2327">Mapping my Journey through GSoC’20 — Landing.</a></li></ul><p>Hope you enjoy reading it as much as I enjoyed writing :))</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a2bed6cdd151" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>