<?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 M. Emre Coskun, PhD on Medium]]></title>
        <description><![CDATA[Stories by M. Emre Coskun, PhD on Medium]]></description>
        <link>https://medium.com/@mecoskun?source=rss-a0a6d19340fd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*PweK4y9AfLcOl0Tc</url>
            <title>Stories by M. Emre Coskun, PhD on Medium</title>
            <link>https://medium.com/@mecoskun?source=rss-a0a6d19340fd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 10:52:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mecoskun/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 sound of freedom..]]></title>
            <link>https://medium.com/@mecoskun/the-sound-of-freedom-26000aaac4ae?source=rss-a0a6d19340fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/26000aaac4ae</guid>
            <category><![CDATA[freedom]]></category>
            <category><![CDATA[poetry]]></category>
            <category><![CDATA[poem]]></category>
            <category><![CDATA[life-inspiration]]></category>
            <category><![CDATA[freedom-of-expression]]></category>
            <dc:creator><![CDATA[M. Emre Coskun, PhD]]></dc:creator>
            <pubDate>Sat, 22 Aug 2026 19:45:12 GMT</pubDate>
            <atom:updated>2026-08-22T19:45:12.654Z</atom:updated>
            <content:encoded><![CDATA[<p>I was inspired to write this simple poem on Saturday, August 22 2026.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P4XZ2PSlgMjxKPHnpKpAJA.png" /><figcaption>Poetry by the author, Illustrated by ChatGPT.</figcaption></figure><p>Hope it inspires you too.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=26000aaac4ae" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mapping out the devastating earthquakes occurred on February 6th 2023 in Turkey]]></title>
            <link>https://medium.com/@mecoskun/mapping-out-the-devastating-earthquakes-occurred-on-february-6th-2023-in-turkey-ebdda414e7a7?source=rss-a0a6d19340fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/ebdda414e7a7</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[folium]]></category>
            <category><![CDATA[earthquake]]></category>
            <category><![CDATA[turkey]]></category>
            <category><![CDATA[gis]]></category>
            <dc:creator><![CDATA[M. Emre Coskun, PhD]]></dc:creator>
            <pubDate>Sat, 25 Feb 2023 03:07:01 GMT</pubDate>
            <atom:updated>2023-03-12T15:08:36.007Z</atom:updated>
            <content:encoded><![CDATA[<p>This post explores the double earthquakes of February 6th 2023 in Turkey and their aftershocks using maps created with Python’s Folium library.</p><p>On February 6th, 2023, Turkey experienced a catastrophic event as two major earthquakes shook the ground, causing widespread devastation and loss of life. The first earthquake, which had a magnitude of 7.8, struck the Gaziantep region at 04:17 am local time (01:17 UTC), resulting in widespread destruction and loss of life across 10 provinces. The damage caused by the earthquake left the region reeling, and officials and citizens alike were struggling to cope with the scale of the disaster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/0*dSRdFTqVM91kbjst.jpg" /><figcaption>Drone photo of a neighborhood in Antakya region (<a href="https://www.hurriyet.com.tr/gundem/deprem-faciasini-gozler-onune-seren-kareler-hatay-havadan-goruntulendi-42219034">source</a>)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gHeUdG54vr0wNA3X" /><figcaption>Drone photo of a neighborhood in Kahramanmaras region (<a href="https://www.ntv.com.tr/ntvpara/turk-isten-genelge-deprem-kriz-masalari-olusturulacak,8bKHoGXesEG_MH3ogrKUXg">source</a>)</figcaption></figure><p>Just 9 hours after the first earthquake, as people and officials were trying to make sense of the event and its aftermath, the second major earthquake struck, this time in the north-east Kahramanmaras Province, which was just 90 km (56 miles) north of the epicenter of the first earthquake. The earthquake had a magnitude of 7.5 and hit at 1:24 pm local time (10:24 UTC), compounding the damage already inflicted by the first earthquake.</p><p>The series of earthquakes triggered a large number of aftershocks, with some reaching magnitudes ranging from Mw 5.7 to Mw 6.6. The impact of these earthquakes on Turkey and its people was severe and far-reaching, causing widespread damage to buildings and infrastructure, as well as significant loss of life. At least 13.5 million people and 4 million buildings across 10 Turkish provinces have been affected. As of writing this post, official sources have reported <a href="https://en.afad.gov.tr/press-bulletin-34-about-the-earthquake-in-kahramanmaras">44,218 deaths</a> and <a href="https://en.afad.gov.tr/press-bulletin-31-about-the-earthquake-in-kahramanmaras">108,068 injured</a> individuals in Turkey (AFAD, 2023). More than 41,000 buildings have been destroyed or heavily damaged, with a further 61,000 buildings set to be demolished. At least 150,000 people have been left homeless as a result of the earthquakes. The earthquakes have left an indelible mark on Turkey’s history, and the recovery efforts are ongoing. The event serves as a stark reminder of the power of natural disasters and the need for constant preparedness in the face of such disasters.</p><h3>Mapping the earthquakes using Python</h3><h4>Data Source</h4><p>To map out the earthquakes in Turkey I used <a href="http://www.koeri.boun.edu.tr/scripts/lst0.asp">the earthquake data with geo-spatial information periodically released</a> by the Bogazici University Kandilli Observatory and Earthquake Research Institute’s (KOERI) Regional Earthquake-Tsunami Monitoring Center (RETMC).</p><p>This data source contains dates, times, locations (latitude and longitude), places, depth and magnitude of the most recent 500 earthquakes occurred in Turkey. I first used requests and BeautifulSoup libraries in Python to web-scrape the data periodically and kept collecting it since the first major earthquake hit Turkey. The requests library allows us to make HTTP requests in a simple way. We use the Beautiful Soup library to scrape the data from KOERI’s website. These are not standard Python libraries, so you have to install them before importing them in your code. I use <a href="https://docs.conda.io/en/latest/">Conda</a> system to manage my packages, so my code does not have the install commands.</p><p>To follow along with the project you can use this <a href="https://nbviewer.org/github/mecoskun/earthquake_Turkey2023_map_folium/blob/main/deprem_.ipynb">nbviewer</a> link or directly access the code and data on my <a href="https://github.com/mecoskun/earthquake_Turkey2023_map_folium">github</a>.</p><pre>import requests<br>from bs4 import BeautifulSoup<br><br>response = requests.get(&quot;http://www.koeri.boun.edu.tr/scripts/lst0.asp&quot;)<br>if response.status_code == 200:<br>    soup = BeautifulSoup(response.text, &quot;html.parser&quot;)<br>    response_text = soup.pre.text</pre><p>First I manually run the scraping code after the first earthquake hit and I saved the data in ‘csv’ format. Each following time I kept manually running the scrape code and saved the updated data in ‘csv’ files. Although I tried to keep regular updates of the earthquakes I have missed some records due to the manual updating process. (My next step is to automate this process). This has resulted in total records of 5536 earthquakes occurred between February 4th 2023 7:40 am and February 20th 2023 21:22. Among these are the two major earthquakes and 42 aftershocks with magnitude exceeding 5.0. Below is a bargraph of all earthquakes with magnitude greater than 4, where red bars show whose magnitudes exceed 5 and blue bars show earthquakes with magnitudes between 4 and 5. The two gaps in the timeline show the data points I have missed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EeWji9Y8IwGLf4bwjxRU8g.png" /><figcaption>Earthquakes over M 4; red bars show the ones with M&gt;5, blue bars show those with 4&lt;M&lt;5.</figcaption></figure><h4>Magnitudes and Strengths of Earthquakes</h4><p>Comparing Earthquakes</p><p>The standard earthquake magnitude measures are in logarithmic scale. This scale makes interpretation and comparison between earthquakes easier. However, taking these magnitude measures at the face value leads to a misleading understanding about the scale and strength of earthquakes. As a matter of fact, a whole number increase in reported magnitude (M) actually corresponds to a tenfold (10x) increase in the size of the earthquake (<a href="https://www.usgs.gov/programs/earthquake-hazards/earthquake-magnitude-energy-release-and-shaking-intensity">USGS</a>, 2023). For example a magnitude 7 earthquake is 100 (=10x10) times bigger than a magnitude 5 earthquake. If we compare the two major earthquakes that struck on February 6th, the first one with magnitude 7.8 is approximately double the size of the second earthquake with magnitude 7.5. In mathematical terms:</p><p>10**(7.8)/10**(7.5) = 10**(7.8–7.5) = 10**0.3 = 1.9952623149688795</p><p>As a visual guide to compare earthquake sizes I prepared the below plot using ‘matplotlib’ library in Python. In the plot sizes of earthquakes with magnitudes 5.5, 6.6, 7.5 and 7.8 are represented with circles on top of each other. This plot shows how dramatically differs a large 7.8 earthquake from a 5.5 aftershock in size.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/1*jcrvmQXh9r1WmF0Dw81pog.png" /><figcaption>Earthquake size comparison plot (image by author).</figcaption></figure><p>Not only earthquake magnitudes differ from their respective size, but they also differ from the strength (energy) of the earthquakes. The strength of the earthquake refers to the energy released by the seismic activity caused by the quake. It is this energy release that shakes the ground and causes damage to constructions, essentially determining how destructive an earthquake is. Just like the relationship between magnitude and size, there is a logarithmic relationship between magnitude and energy level of an earthquake. One unit increase in magnitude corresponds to approximately 32 times (10**1.5 = 31.623 times to be precise, <a href="https://www.math.wichita.edu/~richardson/earthquake.html">source</a>) increase in the energy released by a quake (USGS, 2023). Check <a href="https://www.youtube.com/watch?v=yNN7eDXzlMo">this cool video on YouTube</a> that compares energy released by some of the biggest earthquakes occurred. I prepared a plot in Python similar to the one above to compare energy released by earthquakes with magnitudes 5.5, 6.6, 7.5 and 7.8. This plot might give the wrong impression that a 6.6 earthquake is small, which is only relatively true compared to a 7.8 magnitude earthquake. It actually shows how gigantic the amount of energy released by a 7.8 earthquake is.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/582/1*pr3JuPokotuwI3QGGmPJgA.png" /><figcaption>Earthquake energy release comparison plot (image by author).</figcaption></figure><h4>Mapping out the recent earthquakes that struct Turkey</h4><p>Depicting earthquakes on a map using the ‘folium’ library in Python</p><p>I used the Folium library in Python to draw all snapshot and time-animated maps of the recent major earthquakes and their aftershocks in Turkey. Folium builds on the JavaScriptleaflet.js library to make it easy to visualize data on a Leaflet map in Python. An advantage of using folium is its feature to automatically display a base map without importing a separate geographic file.</p><p>After installing the folium library we can use the standard folium.Map() function to create a base map where location argument set to latitude and longitude degrees. By default the base map data is retrieved from ‘<a href="https://www.openstreetmap.org/">OpenStreetMap</a>’. For example the following code displays the map of Turkey.</p><pre>#conda install -c conda-forge folium<br>import folium<br>tr_lat = 38.9597594<br>tr_lon = 34.9249653<br><br>folium.Map(location=[tr_lat,tr_lon])</pre><p>On the Turkey’s base map I used folium.CircleMarker() to display all earthquakes with magnitudes greater than 3 that occurred between February 4th 2023 and February 24th 2023. There are 1609 such earthquakes in the data. First, I used a single color to mark all quakes and set the radius to the exponent of magnitude measures to approximate the size of each quake. Here is the resulting map:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XN0P0VhQmhEB07tGpfFnOA.png" /><figcaption>Earthquakes with M&gt;3 displayed with folium library in Python (image by author)</figcaption></figure><p>Next, I added some more color to this map by setting both the color and fill options inside the CircleMarker() function to intervals of the depth of earthquakes. On this map, earthquakes with less than or equal to 5 kilometers depth are shown in dark red, those that occurred between 5 to 10 kilometers down the earth are shown in orange, those between 10 to 20 kilometers depth are in yellow and the rest are in green color. Note that the lower the depth of an earthquake the stronger it affects the ground. I also zoom into the Gaziantep and Kahramanmaras provinces in this map, which are the central regions affected by the recent major quakes. A minimap is also added using the MiniMap plugin to make reference to the region. Code snippet and the new map are shown below.</p><pre>from folium import plugins<br>minimap = plugins.MiniMap()<br><br>eq_map = folium.Map(location=[tr_lat, tr_lon], zoom_start=7) <br><br>for row in geo_data[geo_data.magnitude &gt; 3].itertuples():<br>    folium.CircleMarker([row.latitude, row.longitude], radius=np.exp(0.5*float(row.magnitude)),<br>        color=&#39;#C30303&#39; if float(row.depth) &lt;=5 else &#39;orange&#39; if float(row.depth) &lt;10 else &#39;yellow&#39; if float(row.depth) &lt;20 else &#39;green&#39;,<br>        popup=&#39;Location:{}, Magnitude:{}, Depth:{}&#39;.format(row.location,row.magnitude,row.depth),<br>        fill=True, fill_color=&#39;#C30303&#39; if float(row.depth) &lt;=5 else &#39;orange&#39; if float(row.depth) &lt;10 else &#39;yellow&#39; if float(row.depth) &lt;20 else &#39;green&#39;, fill_opacity=0.3<br>    ).add_to(eq_map)<br><br>eq_map.add_child(minimap)<br>eq_map</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CdXr2xN-J66vZExBznwrew.png" /><figcaption>Earthquakes with M&gt;3 displayed on a map centered on Kahramanmaras (image by author)</figcaption></figure><p>In the following map I keep the color setting the same but change the radius of circle markers. Instead of setting the radius to the exponent of magnitudes I set it equal to 10 to the power of magnitude of each earthquake. I also scaled this measure down with a linear constant because some radius measures became too large to fit on the screen. The resulting map allows to visually compare the true size of the earthquakes. As a result smaller aftershocks turned into points only, while the major quakes and large aftershocks were emphasized. The largest circle on this map represents the very first earthquake of magnitude 7.8, and the second largest circle belongs to the second major earthquake of magnitude 7.5, both of which occurred on February 6, 2023. It can also be seen that the aftershocks for these two earthquakes were aligned across their separate fault lines. One fault line lies between Hatay and Adiyaman provinces in SW-NE direction. The second major fault line lies between Kahramanmaras and Malatya provinces in W-E direction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*md8oMYJRHk1DvYoTY4KOBg.png" /><figcaption>Earthquakes with M&gt;3 displayed with their true size (image by author)</figcaption></figure><h4>Time-animated map of the recent earthquakes</h4><p>Finally, I used TimestampedGeoJson plugin from the folium library to make a time animated map of the recent earthquakes. In order to use the <a href="https://python-visualization.github.io/folium/plugins.html#folium.plugins.TimestampedGeoJson">TimestampedGeoJson</a> plugin you need a timestamped GeoJSON file, which is explained in folium’s guide as follows:</p><blockquote>A geo-json is timestamped if:</blockquote><blockquote>- it contains only features of types LineString, MultiPoint, MultiLineString, Polygon and MultiPolygon.</blockquote><blockquote>- each feature has a ‘times’ property with the same length as the coordinates array.</blockquote><blockquote>- each element of each ‘times’ property is a timestamp in ms since epoch, or in ISO string.</blockquote><p>So, I had to convert my earthquakes dataframe into a geojson format such that its features have ‘time’ properties which is set to a date-time formatted column in the original data. The <a href="https://python-visualization.github.io/folium/plugins.html#folium.plugins.TimestampedGeoJson">TimestampedGeoJson</a> function also allows to control how fast the map updates by the setting the period argument inside the function. In my example I set the period to a frame per 1 hour.</p><p>In the animated map I set the circle marker radius of each earthquake to the natural exponent of its magnitude to emphasize all quakes including smaller aftershocks. The whole animation can be watched in the Jupyter Notebook file. Since the file size of the whole animation exceeds file limit I cut a part of it that goes from Feb 5th 2023 to Feb 9th 2023. I also used a file converter to save the file in GIF format to be able to directly post here, which unfortunately reduced the image quality.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*giHRMs29RaV3L3B5s2gLPw.gif" /><figcaption>Animated map of earthquakes with M&gt;3 (image by author)</figcaption></figure><h4>Concluding remarks</h4><p>In this project, I used Python to scrape and map the data of recent earthquakes in Turkey and Syria. The aim of the project was to raise awareness about the recent massive earthquakes and to allow the readers make sense of the size and location of these earthquake using maps. I will share the github code for the project here soon.</p><p>Meanwhile, if you would like to send your support to the earthquake victims in Turkey, you may do so by donating to the following agencies.</p><ul><li><a href="https://donate.unhcr.org/int/en/turkiye-syria-earthquake-emergency?utm_source=timemag&amp;utm_medium=referral&amp;utm_campaign=HQ_PI_EN_teq">UNHCR, the UN Refugee Agency</a></li><li><a href="https://www.unicefusa.org/?form=FUNNPGQXEGQ&amp;utm_campaign=20230206_Emergencies&amp;utm_medium=Organic&amp;utm_source=2622SyriaEarthquake&amp;utm_content=HelpNow2622SyriaEarthquake&amp;ms=Organic_PRL_2023_Emergencies_20230206_2622SyriaEarthquake_HelpNow2622SyriaEarthquake_none_none&amp;initialms=Organic_PRL_2023_Emergencies_20230206_2622SyriaEarthquake_HelpNow2622SyriaEarthquake_none_none">UNICEF</a></li><li><a href="https://whitehelmets.org/en/">The White Helmets</a></li><li><a href="https://www.kizilay.org.tr/Bagis">Turkish Red Crescent (Türk Kızılay)</a></li><li><a href="https://help.rescue.org/donate?ms=ws_resq_top_nav_btn_fy22_NS_mmus_jul&amp;initialms=ws_resq_top_nav_btn_fy22_NS_mmus_jul&amp;_ga=2.152128894.616619708.1675704089-1510743552.1675704089">The International Rescue Committee (IRC)</a></li><li><a href="https://www.savethechildren.org/us/what-we-do/emergency-response/turkey-syria-earthquake">Save the Children</a></li></ul><p>Code source:</p><p><a href="https://github.com/mecoskun/earthquake_Turkey2023_map_folium">https://github.com/mecoskun/earthquake_Turkey2023_map_folium</a></p><p>References:</p><p>AFAD (the Disaster and Emergency Management Authority), 2023, <em>PRESS BULLETIN-31 about the Earthquake in Kahramanmaraş</em></p><p>AFAD, 2023, <em>PRESS BULLETIN-35 about the Earthquake in Kahramanmaraş</em></p><p>USGS, 2023, <em>Earthquake Magnitude, Energy Release, and Shaking Intensity, retrieved from: </em><a href="https://www.usgs.gov/programs/earthquake-hazards/earthquake-magnitude-energy-release-and-shaking-intensity">https://www.usgs.gov/programs/earthquake-hazards/earthquake-magnitude-energy-release-and-shaking-intensity</a></p><p>Wikipedia, 2023, <em>2023 Turkey-Syria Earthquake</em>, retrieved from: <a href="https://en.wikipedia.org/wiki/2023_Turkey%E2%80%93Syria_earthquake">https://en.wikipedia.org/wiki/2023_Turkey%E2%80%93Syria_earthquake</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ebdda414e7a7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>