<?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[Codefarm - Medium]]></title>
        <description><![CDATA[Using code to improve farming - Medium]]></description>
        <link>https://medium.com/codefarm?source=rss----7a155e2ef949---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Codefarm - Medium</title>
            <link>https://medium.com/codefarm?source=rss----7a155e2ef949---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 09:26:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/codefarm" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Water sensitive paper textures]]></title>
            <link>https://medium.com/codefarm/water-sensitive-paper-textures-8224376c248d?source=rss----7a155e2ef949---4</link>
            <guid isPermaLink="false">https://medium.com/p/8224376c248d</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Hugo Pires]]></dc:creator>
            <pubDate>Tue, 05 Jun 2018 20:48:39 GMT</pubDate>
            <atom:updated>2018-06-05T20:48:53.376Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DCmrP6sBw6qW5I4viODgBQ.jpeg" /></figure><p>In my last article I analyzed sample water sensitive papers based on Blob detection, size and number of droplet impacts. In this one I will use another <a href="http://scikit-learn.org/stable/index.html">scikit</a> functionality, comparing textures and trying not to assume which feature is most important to compare droplet impressed water sensitive papers.</p><h4>First things first</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6b16c6279aff5cdf39537bf7ca7b008c/href">https://medium.com/media/6b16c6279aff5cdf39537bf7ca7b008c/href</a></iframe><p>I’ve build a dataset from <a href="http://sprayers101.com/water-sensitive-paper-for-assessing-spray-coverage/">http://sprayers101.com/water-sensitive-paper-for-assessing-spray-coverage/</a> using different spray pressures and nozzle diameters and I am loading it. I’ll use <a href="https://docs.python.org/3/library/pathlib.html">Pathlib</a> to read through the image dataset directory, transforming RGB images in multidimensional arrays.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/17e2a2d56e9e1cf2b2b9118fdb1fee7d/href">https://medium.com/media/17e2a2d56e9e1cf2b2b9118fdb1fee7d/href</a></iframe><h4>First approach</h4><p>My first approach will be to flatten the image arrays and use it as vectors of a n-dimensional space. Then I will use <strong>Principal Component Analysis (PCA) </strong>to reduce dimension number to 2.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3616436c26a26a454ddc6212ff8917eb/href">https://medium.com/media/3616436c26a26a454ddc6212ff8917eb/href</a></iframe><p>Each image is now a two-dimension vector which I can scatter plot with the help of <a href="https://altair-viz.github.io/"><strong>Altair</strong></a> (I am starting to test this more declarative alternative to <a href="https://matplotlib.org/"><strong>Matplotlib</strong></a>).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4c1e7362d870d0df3aa86f889ac89cc5/href">https://medium.com/media/4c1e7362d870d0df3aa86f889ac89cc5/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/504/1*qsgu0Y8ljHIpuHADeY0L6g.png" /></figure><p>Considering that <strong>fine_12</strong> is the best coverage:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/232/1*ALODxdC2GXofchM-LGr3vA.png" /></figure><p>I’ve noticed (as expected) that the “second best” (and closest) is <strong>fine_8</strong>, but the third one is <strong>medium_12</strong>. <strong>Fine_4</strong> is not clearly separated from other several alternatives.</p><h3>Second aproach</h3><p>I’ve decided also to compare images using <a href="https://en.wikipedia.org/wiki/Co-occurrence_matrix">Haralick features</a>. According to Wikipedia they are based on the <em>Co-occurence matrix</em> of a given image. <a href="http://mahotas.readthedocs.io/en/latest/"><strong>Mahotas</strong></a> library does it for us, but before I will convert the images to gray scale and simplify it.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/21c1ee389055d03cba08ee07d4252d8f/href">https://medium.com/media/21c1ee389055d03cba08ee07d4252d8f/href</a></iframe><p>I’ll now reduce <strong>13 Haralick features</strong> space to 2D space using PCA.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8c1fbfb6d10f84385e546ab69bde991f/href">https://medium.com/media/8c1fbfb6d10f84385e546ab69bde991f/href</a></iframe><p>And plot the result as I did it before.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4c1e7362d870d0df3aa86f889ac89cc5/href">https://medium.com/media/4c1e7362d870d0df3aa86f889ac89cc5/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/489/1*2_v5K-8-GYZwwCMjWCHjVA.png" /></figure><p>Although the results are slightly different, both approaches agree that the best alternative to <strong>fine_12</strong> is <strong>fine_8</strong>. Nevertheless, simple PCA from raw images seems to give a more clear classification of water sensitive papers.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8224376c248d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codefarm/water-sensitive-paper-textures-8224376c248d">Water sensitive paper textures</a> was originally published in <a href="https://medium.com/codefarm">Codefarm</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[5 tips to save money and the world on pesticide application using Python code]]></title>
            <link>https://medium.com/codefarm/5-tips-to-save-money-and-the-world-on-pesticide-application-using-python-code-c3b6a34d0c11?source=rss----7a155e2ef949---4</link>
            <guid isPermaLink="false">https://medium.com/p/c3b6a34d0c11</guid>
            <category><![CDATA[pesticides]]></category>
            <category><![CDATA[sustainable-development]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Hugo Pires]]></dc:creator>
            <pubDate>Sun, 10 Dec 2017 18:31:30 GMT</pubDate>
            <atom:updated>2017-12-10T18:31:30.185Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*snLVCP9fhUi9Niv_Q67vAw.jpeg" /><figcaption><a href="https://pixabay.com/en/forest-trees-ecology-environment-272595/">https://pixabay.com/en/forest-trees-ecology-environment-272595/</a></figcaption></figure><p>Everybody is talking about technology and farming these days. But bringing agriculture and computers together is not only developing new apps and interfaces. First of all, it is building a new approach to old problems using computer science. Throughout 2017 I’ve been writing some posts (based on Jupyter Notebooks) on how Python could help us on this effort.</p><h3>1. Calculate what your orchard really needs</h3><p>It’s funny that I’ve started trying to learn OOP and I’ve ended thinking about pesticide spraying in a quite different way. The question is simple: if you don’t know two identical orchards, why do you spray them the same way? In this story we use Python code to build some classes that perform calculations, assuring that you deliver the right amount of water and pesticide on your trees.</p><p><a href="https://medium.com/codefarm/coding-pesticide-spraying-e78602d0e523">Coding pesticide spraying</a></p><h3>2. Make some changes if you have a vineyard</h3><p>In the first story of Codefarm, I’ve started to calculate what is the correct spray volume for a given orchard. In the second one, I made some calculations on vineyards. It was easier since I could reuse some classes, but I needed (as expected) some modifications. I’ve also addressed the problem of pesticide doses.</p><p><a href="https://medium.com/codefarm/vineyard-spray-volume-rate-f53e02fc47d8">Vineyard spray volume rate</a></p><h3>3. Keep attention to difference in trees</h3><p>When you spray a fruit tree, you should do it from bottom to top. But should you do it the same way? I’ve addressed that question on this infographic. I didn’t forget that I have to use the same pressure, although there could be some small variations along the hose.</p><p><a href="https://medium.com/codefarm/changing-spray-volume-rate-4a83acf0b6dc">Changing spray volume rate</a></p><h3>4. Statistics helps you to understand what spray is made of</h3><p>Until now we have used Python to observe pesticide spraying from outside. In this story, I shared some ideas on what spray is made of: droplets. Most of the times we use hydraulic spraying, produced by different kinds of nozzles. After the liquid (a mixture of water and pesticide) is pressurized by a pump, there is a small place where it finds atmospheric pressure (the nozzle) and, as a result, it is pulverized in millions of small droplets. Python abilities to data analysis and visualization helped us to understand better this phenomena.</p><p><a href="https://medium.com/codefarm/spray-droplet-analysis-d41911e04fce">Spray droplet analysis</a></p><h3>5. Use image analysis and a great tool to check if everything is ok</h3><p>Water sensitive paper (WSP) was always recommended as a good tool to address pesticide spray coverage. Although is not as precise as magnesium oxide samples or fluorescence pigment quantification, it is so much easier to use, that it became a de facto standard in the industry. In this story, I’ve used Python image analysis and segmentation to count how many droplets did we get from the sprayer.</p><p><a href="https://medium.com/codefarm/water-sensitive-paper-analysis-39d8cf57d4f3">Water sensitive paper analysis</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c3b6a34d0c11" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codefarm/5-tips-to-save-money-and-the-world-on-pesticide-application-using-python-code-c3b6a34d0c11">5 tips to save money and the world on pesticide application using Python code</a> was originally published in <a href="https://medium.com/codefarm">Codefarm</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Water Sensitive Paper Analysis]]></title>
            <link>https://medium.com/codefarm/water-sensitive-paper-analysis-39d8cf57d4f3?source=rss----7a155e2ef949---4</link>
            <guid isPermaLink="false">https://medium.com/p/39d8cf57d4f3</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[pesticides]]></category>
            <category><![CDATA[sustainable-farming]]></category>
            <dc:creator><![CDATA[Hugo Pires]]></dc:creator>
            <pubDate>Mon, 06 Nov 2017 21:41:11 GMT</pubDate>
            <atom:updated>2017-11-06T21:41:10.545Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*wepq742iQkCjDe9IE2ZpQA.jpeg" /><figcaption><a href="https://commons.wikimedia.org/wiki/File:In_Colour_(8086505303).jpg">https://commons.wikimedia.org/wiki/File:In_Colour_(8086505303).jpg</a></figcaption></figure><h3>Introduction</h3><p>Since my first work on spraying assesment, water sensitive paper (WSP) was recomended as a good tool. Althoug is not as precise as magnesium oxide samples or flourescence pigment quantification, it is so much easier to use, that it became a <em>de facto</em> standard on the industry.</p><p>I had dealt with several thousand of samples using a free tool available on <a href="http://compdent.uthscsa.edu/dig/itdesc.html">UT Health</a>. As I have been trying to use Python as a tool to analyse some questions on pesticide application. So, why not to use <a href="http://scikit-image.org/">Scikit Image </a>, based on a tutorial that I found on <a href="https://www.analyticsvidhya.com/blog/2014/12/image-processing-python-basics/">https://www.analyticsvidhya.com/blog/2014/12/image-processing-python-basics/</a> that help us to count stars on telescope photos. Droplet impression on WSP cards are not so diferent from a “starry, starry night”</p><p>If you prefer to use some more ready to use solution, try Snap Card application produced by <a href="https://www.agric.wa.gov.au/">Government of West Australia </a>that you can find on <a href="https://play.google.com/store/apps/details?id=com.dafwa.snapcard">Play Store</a></p><h3>First things first</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9a4d4aa4a6c4c164630ae3afbb1f963f/href">https://medium.com/media/9a4d4aa4a6c4c164630ae3afbb1f963f/href</a></iframe><p>I’ve build a dataset from <a href="http://sprayers101.com/water-sensitive-paper-for-assessing-spray-coverage/">http://sprayers101.com/water-sensitive-paper-for-assessing-spray-coverage/</a> using different spray pressures and nozzle diameters and I am loading it. Lets’ render one of the images</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4b8e461ae36f7a5eb9b6060aa7c6fdaa/href">https://medium.com/media/4b8e461ae36f7a5eb9b6060aa7c6fdaa/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/378/1*FcBLNCAHs7UcOWFaEy7hFg.png" /></figure><p>And now let’s take a different look at it using Skimage blob detection</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8471c813c7836e328878005f8b85cbd3/href">https://medium.com/media/8471c813c7836e328878005f8b85cbd3/href</a></iframe><pre>Number of droplets counted :  325<br>Medium radius :  1.23781574127</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/378/1*ZnMjiRkqrpMj8cFKP4hTkg.png" /></figure><p>These are the two parameters that we will use to create a dataframe of all the images. Let’s refactor the code, creating a function that we will use in each image iteration.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/610610e1cfd3e85248f1ffdbd0c7eb2a/href">https://medium.com/media/610610e1cfd3e85248f1ffdbd0c7eb2a/href</a></iframe><p>We will now create a Pandas Dataframe that we will use to analyse and plot the results</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/26908b43412b38df84d6d6a4e4e01541/href">https://medium.com/media/26908b43412b38df84d6d6a4e4e01541/href</a></iframe><p>We can get a small performance improvement using job parallelization.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3b2df53cbdd40e85a1b2b6e2d4928922/href">https://medium.com/media/3b2df53cbdd40e85a1b2b6e2d4928922/href</a></iframe><p>As I told you, WSP is not very good to access diameter. Nevertheless, we can a spot a trend in which diameter gets higher with coarser nozzles.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/59038c5f81137f13ed8242c3cb3e1790/href">https://medium.com/media/59038c5f81137f13ed8242c3cb3e1790/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/408/1*m8LvJIzt6DIbvWIRVZdGXA.png" /></figure><p>When we try to analyse droplet number, it gets much better. We get less droplet with coarser nozzles…</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/39e9ccdef0dc707c63103e10809bc407/href">https://medium.com/media/39e9ccdef0dc707c63103e10809bc407/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/385/1*oG_xwjuz1Wx65queV25dcQ.png" /></figure><p>… and more droplets with higher pressures.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d84df1e2a1855a77c9658d23fbd77765/href">https://medium.com/media/d84df1e2a1855a77c9658d23fbd77765/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/385/1*PD0VknEIqyNSYsZdZsFU7g.png" /></figure><h3>Conclusion</h3><p>After some stories about pesticide application, I’ve decided to write some about WSP. I will do it again next time, addressing spray coverage quality analysis.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=39d8cf57d4f3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codefarm/water-sensitive-paper-analysis-39d8cf57d4f3">Water Sensitive Paper Analysis</a> was originally published in <a href="https://medium.com/codefarm">Codefarm</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Spray droplet analysis]]></title>
            <link>https://medium.com/codefarm/spray-droplet-analysis-d41911e04fce?source=rss----7a155e2ef949---4</link>
            <guid isPermaLink="false">https://medium.com/p/d41911e04fce</guid>
            <category><![CDATA[science]]></category>
            <dc:creator><![CDATA[Hugo Pires]]></dc:creator>
            <pubDate>Mon, 21 Aug 2017 21:53:12 GMT</pubDate>
            <atom:updated>2017-08-21T19:56:54.326Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hj39tP2nrqUF9T8elLvzPg.jpeg" /><figcaption><a href="https://commons.wikimedia.org/wiki/File:US_Air_Force_050719-F-2585R-001_Aerial_Spraying.jpg?uselang=en-gb">https://commons.wikimedia.org/wiki/File:US_Air_Force_050719-F-2585R-001_Aerial_Spraying.jpg?uselang=en-gb</a></figcaption></figure><h3>Introduction</h3><p>I hope you found the python thoughts on Pesticide and flow volume useful. Today I want to share some ideas on what spray is made of: droplets. Most of the times we use hidraulic spraying, produced by diferent kinds of nozzles. After the liquid (mixture of water and pesticide) is pressurized by a pump, there is a small place where it finds atmosferic pressure (the nozzle) and, as a result it is pulverized in millions of small droplets.</p><h3>Droplet diameter and volume</h3><p>Since they are almost made of water, droplets keeps its properties, like surface tension. When they are free in the air, they tend to be spherical and so, the most characteristic descriptor is the diameter. Because we are dealing with such small objects, the diameter is measured in <em>micron,</em> a 1/1000 of a milimeter. If you want to get an idea of how small it is, a human hair has 100 microns of diameter.</p><h3>VMD and span</h3><p>As you can imagine, it’s impossible to know the diameter of all droplet in the spray. The equipment that measures it, samples some droplets and generates a distribution of size, giving us some statistics.</p><ul><li>VMD (or DV 0.5) : median or 50% percentile</li><li>DV 0.1 : 10% percentile</li><li>DV 0.9 : 90% percentile</li><li>SPAN : Relative span</li></ul><p>What is <strong>relative span</strong>? Let’s define a function than calculates it:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9a099a1e7e881a2b6059611ee5f91605/href">https://medium.com/media/9a099a1e7e881a2b6059611ee5f91605/href</a></iframe><p>Python ecosystem has some useful tools for data simulation and visualization.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1cbe629a702373962820a786ef2c4634/href">https://medium.com/media/1cbe629a702373962820a786ef2c4634/href</a></iframe><p>Let’s simulate two different droplet distributions.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3fecbf455b03a24832abddd06f46956e/href">https://medium.com/media/3fecbf455b03a24832abddd06f46956e/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*KSRkdMkRj3fQBw34vQhhjA.png" /></figure><p>After that we can calculate the indicators, using a method from the distribution and show them with the “f” strings.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/93eabc342220c74c76c7484a21ed923b/href">https://medium.com/media/93eabc342220c74c76c7484a21ed923b/href</a></iframe><pre>&#39;The 10 percentile is 137.2 micron, the VMD is 150.0 micron and the 90 percentile is 162.8 micron.The span is 0.2&#39;</pre><p>When the pressure rises, as the flow increases, the VMD decreases and span too. We can say that we can have different distribution, depending on the pressure. A spray with a larger VMD is called coarse, but it’s better to know the classification according to it:</p><ul><li>Very fine : &lt; 159 micron</li><li>Fine : 159–231 micron</li><li>Medium : 231–326 micron</li><li>Coarse : 326–386 micron</li><li>Very coarse : 386–484 micron</li><li>Extremely coarse : 484–553 micron</li><li>Ultra coarse : &gt; 553 micron</li></ul><p>Take a look on the data for Albuz ATR nozzles:</p><p><strong>Between diferent nozzles at same pressure</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/081ae63f1806455bf64a86cc6666142d/href">https://medium.com/media/081ae63f1806455bf64a86cc6666142d/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*k3RqgSmjluq2YFtrpK-zug.png" /></figure><p><strong>Between diferent pressures on the same nozzle</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/798f34125d6dc21dd07260045c00b6d3/href">https://medium.com/media/798f34125d6dc21dd07260045c00b6d3/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*moe_IOP94SOtvoWjfQVrog.png" /></figure><h3>Conclusion</h3><p>Understanding spray droplet size is fundamental to fully predict its behavior. There is always a trade-off between thinner, more efficient droplets (since they can cover more with less spray volume) and coarser, better environmental behaved droplets (that less drifted by the wind towards non target areas.</p><h3>Resources</h3><ul><li><a href="https://pesticidestewardship.org/pesticide-drift/understanding-droplet-size/">https://pesticidestewardship.org/pesticide-drift/understanding-droplet-size/</a></li><li><a href="http://www.spray.com/literature_pdfs/B459C_Understanding_Drop_Size.pdf">http://www.spray.com/literature_pdfs/B459C_Understanding_Drop_Size.pdf</a></li><li><a href="http://albuz-spray.com/images/file/cat_UK_albuz_29_06_17.compressed.pdf">http://albuz-spray.com/images/file/cat_UK_albuz_29_06_17.compressed.pdf</a></li><li><a href="http://www.agratech.co.uk/pdf-downloads/Albuz-ATR-Chart.pdf">http://www.agratech.co.uk/pdf-downloads/Albuz-ATR-Chart.pdf</a></li><li><a href="http://www.agrozapp.pt/modules/agrozapp/website/inline_assets/8a89c9e8bf4b8fe20a71e3d2a197cab8.pdf">http://www.agrozapp.pt/modules/agrozapp/website/inline_assets/8a89c9e8bf4b8fe20a71e3d2a197cab8.pdf</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d41911e04fce" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codefarm/spray-droplet-analysis-d41911e04fce">Spray droplet analysis</a> was originally published in <a href="https://medium.com/codefarm">Codefarm</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Changing spray volume rate]]></title>
            <link>https://medium.com/codefarm/changing-spray-volume-rate-4a83acf0b6dc?source=rss----7a155e2ef949---4</link>
            <guid isPermaLink="false">https://medium.com/p/4a83acf0b6dc</guid>
            <category><![CDATA[sustainable-farming]]></category>
            <category><![CDATA[pesticides]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Hugo Pires]]></dc:creator>
            <pubDate>Sun, 02 Jul 2017 19:32:53 GMT</pubDate>
            <atom:updated>2017-07-02T19:31:54.384Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*sfjsb-HQALKZZ4QSqLoy3g.jpeg" /><figcaption><a href="https://commons.wikimedia.org/wiki/Category:Field_sprayers#/media/File:Turbine_81_Super.jpg">https://commons.wikimedia.org/wiki/Category:Field_sprayers#/media/File:Turbine_81_Super.jpg</a></figcaption></figure><h3>Introduction</h3><p>In the first and notebooks of this series, I’ve started to calculate what is the correct spray volume for an orchard and a vineyard. The answer was one nozzle using one pressure.</p><p>If I make some small changes on flow rate using pressure variation, I will get a non-linear variation.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/076f148709ee782b6fc1215d6b4fd0bd/href">https://medium.com/media/076f148709ee782b6fc1215d6b4fd0bd/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/375/1*GDu421qvCkj0O8isV1EKbQ.png" /></figure><p>But the question is: should I spray a tree the same way all way to the top? I’ve addressed that question on <a href="https://www.agrozapp.pt/modules/agrozapp/website/inline_assets/84d08022aaaf4eb32f3ec9eeec57dca1.pdf">this infografhic</a>. Well, don’t forget that I have to use the same pressure, although there could be some small variations along the hose. So, the total amount of flow rate will depend on the same pressure value.</p><p>Let’s make some tests in order to choose, not only one nozzle, but a set of proper nozzles.</p><p><a href="http://www.albuz-spray.com/en/busesenceramique-ceramicnozzles-boquillasdeceramica">Albuz ATR 80 hollow cone nozzles</a>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a67ae899e3d30b3777db5d4a6967755e/href">https://medium.com/media/a67ae899e3d30b3777db5d4a6967755e/href</a></iframe><p>Let’s reuse some classes that I’ve created on the first notebook:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c3d767a40b7416d7ca15f6bcfe36d997/href">https://medium.com/media/c3d767a40b7416d7ca15f6bcfe36d997/href</a></iframe><p>But with some changes:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/95caec87501f91f108d89124bd645fb8/href">https://medium.com/media/95caec87501f91f108d89124bd645fb8/href</a></iframe><h3>Let’s spray</h3><p>The same places in the same old way.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/88bff13e52e5701d323646c5e294f15e/href">https://medium.com/media/88bff13e52e5701d323646c5e294f15e/href</a></iframe><p>Let´s get the flow rate for this application, and the right nozzle</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/023432cbfdfbd99ee569dcbf19548297/href">https://medium.com/media/023432cbfdfbd99ee569dcbf19548297/href</a></iframe><pre>ORANGE<br>15.0<br>17.0</pre><p>Now I know that I have to use <strong>10</strong> <strong>Orange</strong> nozzles at <strong>15 bar</strong> to get a sum of <strong>17 L/min</strong> in the sprayer.</p><h3>What if I want to use more than one nozzle color?</h3><p>I will use a quite simple way. A lower flow rate nozzle to the bottom of the tree and higher flow rate nozzle to the top. The Class Nozzle now have two useful attributes that help me to find out which ones.</p><pre>the_right_nozzle.upper_color_code</pre><pre>&#39;RED&#39;</pre><pre>the_right_nozzle.lower_color_code</pre><pre>&#39;YELLOW&#39;</pre><p>So, 5 nozzles each side of the sprayer, according to the following sequence:</p><ul><li>1 YELLOW (bottom)</li><li>3 ORANGE (medium)</li><li>1 RED (top)</li></ul><p>Finally, I will just check if the sum of the different flow rates is close to the calculated previously:</p><pre>COLOR_CODES[3], PRESSURES[10], FLOW_RATES[10,3]</pre><pre>(&#39;YELLOW&#39;, 15.0, 1.25)</pre><pre>COLOR_CODES[4], PRESSURES[10], FLOW_RATES[10,4]</pre><pre>(&#39;ORANGE&#39;, 15.0, 1.69)</pre><pre>COLOR_CODES[5], PRESSURES[10], FLOW_RATES[10,5]</pre><pre>(&#39;RED&#39;, 15.0, 2.33)</pre><pre>(FLOW_RATES[10,3] + 3 * FLOW_RATES[10,4] + FLOW_RATES[10,5]) * 2</pre><pre>17.3</pre><p>Quite good. I’ve changed the vertical distribution but I’ve kept (almost) the total sprayer flow rate.</p><h3>Resources</h3><p>This work is made of four ingredients: some ideas, lots of discussion with colleagues and farmers, support from <a href="http://www.impactwave.com/">Impactwave</a> team (specially Gonçalo Martins) and all the effort of the Python community:</p><ul><li><a href="https://docs.python.org/3/">Python 3.5.2 documentation</a></li><li><a href="http://matplotlib.org/">matplotlib</a></li><li><a href="http://www.numpy.org/">NumPy</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a83acf0b6dc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codefarm/changing-spray-volume-rate-4a83acf0b6dc">Changing spray volume rate</a> was originally published in <a href="https://medium.com/codefarm">Codefarm</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Vineyard spray volume rate]]></title>
            <link>https://medium.com/codefarm/vineyard-spray-volume-rate-f53e02fc47d8?source=rss----7a155e2ef949---4</link>
            <guid isPermaLink="false">https://medium.com/p/f53e02fc47d8</guid>
            <category><![CDATA[vineyard]]></category>
            <category><![CDATA[sustainable-farming]]></category>
            <category><![CDATA[pesticides]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Hugo Pires]]></dc:creator>
            <pubDate>Thu, 22 Jun 2017 20:19:41 GMT</pubDate>
            <atom:updated>2017-06-22T20:19:48.293Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*OWeeEZBHq0ejge9DmkHMLA.jpeg" /><figcaption><a href="https://commons.wikimedia.org/wiki/File:Vineyards_in_Napa_Valley_7.jpg?uselang=en-gb">https://commons.wikimedia.org/wiki/File:Vineyards_in_Napa_Valley_7.jpg</a></figcaption></figure><h3>Introduction</h3><p>In the <a href="https://medium.com/codefarm/coding-pesticide-spraying-e78602d0e523">first notebook of this series</a>, I’ve started to calculate what is the correct spray volume for a given vineyard. In this one I will make some calculation on vineyards. As you will see, I can reuse some code, but I will need (as expected) some modifications.</p><h3>As usual,</h3><p>I will need some libraries…</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9348a641a39a1bac3c6c368ebb65d742/href">https://medium.com/media/9348a641a39a1bac3c6c368ebb65d742/href</a></iframe><h4>…and some data</h4><p>on <a href="http://www.albuz-spray.com/en/busesenceramique-ceramicnozzles-boquillasdeceramica">Albuz ATR 80 hollow cone nozzles</a>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a67ae899e3d30b3777db5d4a6967755e/href">https://medium.com/media/a67ae899e3d30b3777db5d4a6967755e/href</a></iframe><p>Let’s reuse some classes that I’ve created on the first notebook, with diferent names if needed.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/02f0cb1e606cf88ef53d945e1d10c3b4/href">https://medium.com/media/02f0cb1e606cf88ef53d945e1d10c3b4/href</a></iframe><h3>Let’s spray</h3><p>A slightly different place…</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8ddb0efe0da477314fd0224727d84279/href">https://medium.com/media/8ddb0efe0da477314fd0224727d84279/href</a></iframe><p>Let´s get the flow rate for this application, and the proper nozzle</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f7f3c7afa5d7517d1f9aeef450400855/href">https://medium.com/media/f7f3c7afa5d7517d1f9aeef450400855/href</a></iframe><pre>YELLOW<br>7.0<br>8.55<br>Mix 1000 L of water with 6550 g of pesticide in tank</pre><p>But in some pesticides, a dosis per LWA unit is available, expressed in ammount of product per 10 000 m2</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e7b87fcb4c017b8899c8d3609b006945/href">https://medium.com/media/e7b87fcb4c017b8899c8d3609b006945/href</a></iframe><p>Let’s use a new fungicide with the a lower dosis per LWA</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/47776166cea6d4ce771879b8126222ee/href">https://medium.com/media/47776166cea6d4ce771879b8126222ee/href</a></iframe><p>Now, with some changes</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4747c431d031ec8919f63552e43c4d5d/href">https://medium.com/media/4747c431d031ec8919f63552e43c4d5d/href</a></iframe><pre>YELLOW<br>7.0<br>8.55<br>Mix 1000 L of water with 4211 g of pesticide in tank</pre><h3>Resources</h3><p>This work is made of four ingredients: some ideas, lots of discussion with coleagues and farmers, support from <a href="http://www.impactwave.com/">Impactwave</a> team (specially Gonçalo Martins) and all the effort of the Python community:</p><ul><li><a href="https://docs.python.org/3/">Python 3.5.2 documentation</a></li><li><a href="http://matplotlib.org/">matplotlib</a></li><li><a href="http://www.numpy.org/">NumPy</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f53e02fc47d8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codefarm/vineyard-spray-volume-rate-f53e02fc47d8">Vineyard spray volume rate</a> was originally published in <a href="https://medium.com/codefarm">Codefarm</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Orchard Spray Volume Rate]]></title>
            <link>https://medium.com/codefarm/coding-pesticide-spraying-e78602d0e523?source=rss----7a155e2ef949---4</link>
            <guid isPermaLink="false">https://medium.com/p/e78602d0e523</guid>
            <category><![CDATA[pesticides]]></category>
            <category><![CDATA[sustainable-farming]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Hugo Pires]]></dc:creator>
            <pubDate>Sun, 18 Jun 2017 15:31:10 GMT</pubDate>
            <atom:updated>2017-06-22T20:05:12.729Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*jzGxFdGcIQL3wIFcd1F1qg.jpeg" /><figcaption><a href="https://commons.wikimedia.org/wiki/File:Apple_orchard_-_geograph.org.uk_-_620040.jpg?uselang=en-gb">https://commons.wikimedia.org/wiki/File:Apple_orchard_-_geograph.org.uk_-_620040.jpg</a></figcaption></figure><h3>Introduction</h3><p>While striving to improve my skills I soon realized that trying to learn Object Oriented programing by yourself can be difficult, so I’ve decided to use some examples from my working expertise, pesticide application, using Python.</p><p>On this notebook, I will bring together some formulas usually used to plan a proper pesticide application. They have been used for long time, published, proved and presented in training sessions. I will just connect them on a train of thought.</p><p>It’s funny that I’ve started trying to learn OOP and I’ve ended thinking about pesticide spraying in a quite different way. I’ve learned that bringing agriculture and computers together is not only developing new apps and interfaces. First off all it is building a new approach to old problems using computer science.</p><p>And the result is one possible way to organize our pesticide application process, using very simple classes that explain the formulas. I’ll be using this method here, on the ag-tech solution development in <a href="http://www.impactwave.com/">Impactwave</a>, aiming to a more efficient and sustainable agriculture.</p><h3>First of all</h3><p>I will need some libraries…</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8620e2e290db0a8948f71faafca735c4/href">https://medium.com/media/8620e2e290db0a8948f71faafca735c4/href</a></iframe><h4>…and some data on nozzles.</h4><p>When, early in my work, I started to work on reducing volume rate, I used <a href="http://www.albuz-spray.com/en/busesenceramique-ceramicnozzles-boquillasdeceramica">Albuz ATR 80 hollow cone nozzles</a>. I went back, remembered those times, and came up with some examples.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a67ae899e3d30b3777db5d4a6967755e/href">https://medium.com/media/a67ae899e3d30b3777db5d4a6967755e/href</a></iframe><h3>Preparing the machinery</h3><p>First of all I need to describe the orchard (vineyard will be analysed later). I can be pretty sure about distances and the area, but what is the tree height and width? For now, let’s use some average values and I will talk about sampling later.</p><ul><li>Height and width are tree canopy parameters (in meters)</li><li>Row and tree distance tell us how far are the trees and then how many trees we have in the orchard (in meters,too)</li><li>The area of the orchard is in hectares</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8fb6bfbf41bd7ea849b7cd821ceb2f7b/href">https://medium.com/media/8fb6bfbf41bd7ea849b7cd821ceb2f7b/href</a></iframe><p>I’ve been using the Tree Row Volume method. Although it is a very simple model (with lots of limitations), it can quantify a very simple fact: there are not two identical orchards. You can read details about it on <a href="http://www.apsnet.org/publications/PlantDisease/BackIssues/Documents/1984Articles/PlantDisease68n06_480.pdf">Sutton and Unrath paper</a>. You can find an <a href="http://app.agrozapp.pt/admin/private/selene/download.php?URI=private%2Fstorage%2Finline_assets%2F39f3f5b40919b78d9f3a5e0bf9bca401.pdf&amp;name=TRV.pdf">interesting infographics</a> on that subject that we’ve made for Agrozapp Newsletter.</p><p>Probably you have some mold or bug annoying you and decided to apply some pesticide. By now I just want to know its name and dose to be applied per hectare.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c318eb2d52d7114bbf39ce3fe753c2bd/href">https://medium.com/media/c318eb2d52d7114bbf39ce3fe753c2bd/href</a></iframe><p>What do you use to spray? Well, most of the times, a sprayer…</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c468556358704a1d33c9ba977252249e/href">https://medium.com/media/c468556358704a1d33c9ba977252249e/href</a></iframe><p>…with some nozzles on it…</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/268876283729ca7c7d1dd1f27117fb9c/href">https://medium.com/media/268876283729ca7c7d1dd1f27117fb9c/href</a></iframe><p>and pulled by a big and strong tractor.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/474eaf2d42c0320055ffbb69f3f7a5ad/href">https://medium.com/media/474eaf2d42c0320055ffbb69f3f7a5ad/href</a></iframe><p>So, the <strong>application</strong> itself, uses all this objects to work.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1afae81902c82ed038c9965dbf923d67/href">https://medium.com/media/1afae81902c82ed038c9965dbf923d67/href</a></iframe><h3>Let’s spray</h3><p>So, let’s get started. I have a small pear tree orchard from which I know a few things:</p><ul><li>The height of the canopy,</li><li>And its width</li><li>The distance between rows and between trees</li><li>And the area</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6900eef78c8db2780675a7ce45ad2415/href">https://medium.com/media/6900eef78c8db2780675a7ce45ad2415/href</a></iframe><p>We’ve decided to use an copper based fungicide.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/10192a5dbeb74bd6e0630e3f619c45f2/href">https://medium.com/media/10192a5dbeb74bd6e0630e3f619c45f2/href</a></iframe><p>And all the machinery in the farm.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/eb31c76927bbd4d15e6a582743ad643c/href">https://medium.com/media/eb31c76927bbd4d15e6a582743ad643c/href</a></iframe><p>After all this work, I want some answers. So, what nozzle should I use?</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2af1a13a463cec0021e57f63bfc750bf/href">https://medium.com/media/2af1a13a463cec0021e57f63bfc750bf/href</a></iframe><pre>ORANGE<br>15.0</pre><p>And what tank mixture?</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/059cef5df594023b78ce57b1ddb0f9a7/href">https://medium.com/media/059cef5df594023b78ce57b1ddb0f9a7/href</a></iframe><pre>&#39;Mix 1000 L of water with 4706 g of pesticide in tank&#39;</pre><h3>Some more issues on TRV</h3><p>By the way, did you notice that volume rate is a linear function of Tree Row Volume? The intercept is 200, which it means that every orchard will receive 200 L per hectare and the slope is 0.02, 20 L per 1000 m3 of tree row. Let’s make a simple plot to show it.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/833f8b182f141083300ecb7db35cb28c/href">https://medium.com/media/833f8b182f141083300ecb7db35cb28c/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/546/1*K8XDTUWzPegjOoKRbIt1Jw.png" /></figure><p>The TRV, besides addressing the variation <strong>between</strong> diferent orchards can also deal with variation <strong>inside</strong> the same orchard along the phenological state. Again according to <a href="http://www.apsnet.org/publications/PlantDisease/BackIssues/Documents/1984Articles/PlantDisease68n06_480.pdf">Sutton and Unrath, 1984</a>, we know the coeficients:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9025d9cb3e8fce8f64d3668370b6cde6/href">https://medium.com/media/9025d9cb3e8fce8f64d3668370b6cde6/href</a></iframe><p>and we can create a slightly diferent <strong>Orchard</strong> class (inheriting from the first), expanding the one that we’ve been using until now:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9eed72e0bde7daa0463f572f7f0b8eb7/href">https://medium.com/media/9eed72e0bde7daa0463f572f7f0b8eb7/href</a></iframe><pre>YELLOW<br>21.0</pre><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d7e783e1c4934ce8ed730c55d738ea8a/href">https://medium.com/media/d7e783e1c4934ce8ed730c55d738ea8a/href</a></iframe><pre>&#39;Mix 1000 L of water with 5424 g of pesticide in tank&#39;</pre><h3>Conclusion</h3><p>I showed some evidence that the concentration depends on the dose and spray volume rate. When you change one of them, you must recalculate the others. That is the beginning of a good pesticide application.</p><p>This little work is not only useful by now, but also to the future. Classes could be reused in different scenarios — fertilization for instance, and could be “expanded” to add new features like dosis calculation, pressure adjustment and air flow rate.</p><h3>Resources</h3><p>This work is made of four ingredients: some ideas, lots of discussion with coleagues and farmers, support from <a href="http://www.impactwave.com/">Impactwave</a> team (specially Gonçalo Martins) and all the effort of the Python community:</p><ul><li><a href="https://docs.python.org/3/">Python 3.5.2 documentation</a></li><li><a href="http://matplotlib.org/">matplotlib</a></li><li><a href="http://www.numpy.org/">NumPy</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e78602d0e523" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codefarm/coding-pesticide-spraying-e78602d0e523">Orchard Spray Volume Rate</a> was originally published in <a href="https://medium.com/codefarm">Codefarm</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>