日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

usgs地震记录如何下载_用大叶草绘制USGS地震数据

發(fā)布時(shí)間:2023/11/29 编程问答 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 usgs地震记录如何下载_用大叶草绘制USGS地震数据 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

usgs地震記錄如何下載

One of the many services provided by the US Geological Survey (USGS) is the monitoring and tracking of seismological events worldwide. I recently stumbled upon their earthquake datasets provided at the website below.

美國地質(zhì)調(diào)查局(USGS)提供的眾多服務(wù)之一是對(duì)全球地震事件的監(jiān)視和跟蹤。 我最近偶然發(fā)現(xiàn)了下面網(wǎng)站提供的地震數(shù)據(jù)集。

The site has data feeds that contain ‘live’ csv data for every significant earthquake over the past hour, day, week, or month. The data is updated every minute and contains magnitudes, lat/long, depth, and other earthquake descriptors.

該站點(diǎn)的數(shù)據(jù)源包含過去一小時(shí),一天,一周或一個(gè)月中每次重大地震的“實(shí)時(shí)” csv數(shù)據(jù)。 數(shù)據(jù)每分鐘更新一次,其中包含震級(jí),緯度/經(jīng)度,深度和其他地震描述符。

While there are lots of earthquake visualizations out there, I thought it would be a fun exercise to see what could be easily created in Folium from the raw data. For this project, we will be plotting every earthquake worldwide using just Pandas and Folium. We will also add some tectonic plate boundaries with geoJSON just for fun.

盡管那里有很多地震可視化內(nèi)容,但我認(rèn)為從原始數(shù)據(jù)中輕松地在Folium中創(chuàng)建什么內(nèi)容將是一個(gè)有趣的練習(xí)。 對(duì)于此項(xiàng)目,我們將僅使用熊貓和大葉子繪制全球每次地震的圖。 我們還將通過geoJSON添加一些構(gòu)造板塊邊界,只是為了好玩。

導(dǎo)入我們的數(shù)據(jù) (Importing Our Data)

I will be using the data feed located at the following URL.

我將使用位于以下URL的數(shù)據(jù)提要。

https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_month.csv

https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_month.csv

That is the direct link to a csv formatted file containing every earthquake greater than magnitude 2.5, worldwide, over the last month. I encourage you to try out the other data feeds, but I found that the size of the dataset really balloons when you include smaller quakes.

這是指向csv格式文件的直接鏈接,該文件包含最近一個(gè)月在世界范圍內(nèi)發(fā)生的每一次大于2.5級(jí)的地震。 我鼓勵(lì)您嘗試其他數(shù)據(jù)饋送,但是我發(fā)現(xiàn)當(dāng)包含較小的地震時(shí),數(shù)據(jù)集的大小實(shí)際上會(huì)膨脹。

In the code below, we import our libraries, and use the pandas.read_csv() function to create a DataFrame object directly from the URL.

在下面的代碼中,我們導(dǎo)入我們的庫,并使用pandas.read_csv()函數(shù)直接從URL創(chuàng)建一個(gè)DataFrame對(duì)象。

Available columns from earthquake DataFrame地震DataFrame中的可用列

The data column descriptions are well documented on the USGS website. The relevant columns for our project will be: latitude, longitude, and mag (magnitude of the quake). All are stored as float objects and there is no preprocessing necessary. Thank you USGS for keeping these datasets clean and user friendly.

數(shù)據(jù)列的說明在USGS網(wǎng)站上有詳細(xì)記錄。 為我們的項(xiàng)目相關(guān)列將是:緯度,經(jīng)度和MAG(地震的大小)。 所有這些都存儲(chǔ)為浮點(diǎn)對(duì)象,并且不需要任何預(yù)處理。 感謝USGS保持這些數(shù)據(jù)集干凈和用戶友好。

在Folium中制作底圖 (Making a Base Map in Folium)

We will start by making a simple map in Folium using the code below.

我們將使用下面的代碼在Folium中制作一個(gè)簡單的地圖開始。

We chose a lat/long of (0, 0) since we are plotting the whole world. A zoom value of 2 worked well for me to see the entire Earth in openstreetmap. My resulting earthquakes.html file looked like this.

由于繪制整個(gè)世界,因此我們選擇了緯度/經(jīng)度(0,0) 。 縮放值為2可以很好地使我在openstreetmap中看到整個(gè)地球。 我生成的地震.html文件看起來像這樣。

Basic world map基本的世界地圖

使用Folium Circles添加地震數(shù)據(jù) (Adding Earthquake Data using Folium Circles)

Now that we have a working base map, let’s plot our earthquakes. We will use Folium’s Circle object to represent each quake. To start, we will just make all the earthquakes the same size.

現(xiàn)在我們有了工作底圖,讓我們繪制地震圖。 我們將使用Folium的Circle對(duì)象來表示每個(gè)地震。 首先,我們將使所有地震大小相同。

In the code above, we iterated through each earthquake in the DataFrame, created a Circle object at that location, and added it to my map using the add_to() method. We end up with an already impressive map showing all of the significant earthquakes over the past month. The data is constantly changing, so your attempt might look different.

在上面的代碼中,我們遍歷了DataFrame中的每次地震,在該位置創(chuàng)建了一個(gè)Circle對(duì)象,然后使用add_to()方法將其添加到我的地圖中。 最后,我們得到了一張已經(jīng)令人印象深刻的地圖,顯示了過去一個(gè)月中所有的重大地震。 數(shù)據(jù)在不斷變化,因此您的嘗試可能看起來有所不同。

可視化地震幅度 (Visualizing Earthquake Magnitudes)

To give us a quick visual representation of the magnitudes, I chose to alter the size of each circle based on the size of the quake. (alternately, you could experiment with colormaps or heatmaps)

為了讓我們快速直觀地看到震級(jí),我選擇根據(jù)地震的大小來改變每個(gè)圓的大小。 (或者,您可以嘗試使用顏色圖或熱圖)

For the last map, I used a radius of 10 for every Circle and we saw each earthquake represented by a blue dot. The Circle object’s radius is displayed in meters on your map, so each Circle marker shows up as a 10m ring when you zoom all the way in on your interactive map.

對(duì)于最后一張地圖,我為每個(gè)圓使用了10的半徑,并且我們看到每個(gè)地震都由一個(gè)藍(lán)點(diǎn)表示。 “圓”對(duì)象的半徑以米為單位顯示在地圖上,因此當(dāng)您在交互式地圖上一直放大時(shí),每個(gè)“圓”標(biāo)記都顯示為10m的圓環(huán)。

We will make the radius a function of the earthquake’s magnitude. Large magnitude quakes will be represented by large radius Circle markers.

我們將半徑作為地震震級(jí)的函數(shù)。 大地震將由大半徑圓形標(biāo)記表示。

I chose to set my radius equal to 50,000 times the magnitude. A 4.0 earthquake would show on my map as having a radius of 200,000m or 200km. That value felt right for me, but you could certainly change it, especially if you were plotting regional data.

我選擇將半徑設(shè)置為等于半徑50,000倍。 我的地圖上會(huì)顯示4.0級(jí)地震的半徑為200,000m或200km。 該值對(duì)我來說很合適,但是您可以更改它,尤其是在繪制區(qū)域數(shù)據(jù)時(shí)。

Now we can clearly see the relative size of the plotted earthquakes, although we certainly have some work to do on the formatting.

現(xiàn)在我們可以清楚地看到繪制的地震的相對(duì)大小,盡管我們當(dāng)然需要進(jìn)行一些格式化工作。

使它漂亮 (Making it Pretty)

The map is now functional with minimal coding. We can now use the Circle object’s keyword arguments to make them more attractive.

該地圖現(xiàn)在可以以最少的編碼運(yùn)行。 現(xiàn)在,我們可以使用Circle對(duì)象的關(guān)鍵字參數(shù)使它們更具吸引力。

This time, we specified five new keyword arguments (weight, color, opacity, fill_color, and fill_opacity) in our Circle objects. We now see multiple earthquakes on top of each other. In addition to the relative sizes to represent magnitude, the darker red now represents hot spots (multiple quakes), and gives it a heatmap effect.

這次,我們?cè)贑ircle對(duì)象中指定了五個(gè)新的關(guān)鍵字參數(shù)(權(quán)重,顏色,不透明度,fill_color和fill_opacity)。 現(xiàn)在,我們可以看到多個(gè)地震相互疊加。 除了代表大小的相對(duì)大小外,深紅色現(xiàn)在還代表熱點(diǎn)(多次地震),并賦予其熱圖效果。

使用GeoJSON添加構(gòu)造板塊 (Adding Tectonic Plates Using GeoJSON)

When we look at the resulting map, we see a visualization of the Pacific rim’s ‘ring of fire’. I immediately had the thought of laying the actual tectonic plate boundaries as an overlay to my map.

當(dāng)查看生成的地圖時(shí),我們看到了太平洋邊緣的“火環(huán)”的可視化圖像。 我立刻想到放置實(shí)際的構(gòu)造板塊邊界作為我的地圖的疊加層。

A quick google search led me to this file on github with the polygons for the tectonic boundaries stored in geoJSON format.

谷歌的快速搜索將我?guī)У絞ithub上的該文件,其中以geoJSON格式存儲(chǔ)了構(gòu)造邊界的多邊形。

GeoJSON is my personal favorite filetype for shapes when using Python and Folium, but you could use other shape files as well. The geoJSON format has the advantage of working as a JSON file and can be treated like a dictionary in Python should you need to.

在使用Python和Folium時(shí),GeoJSON是我個(gè)人最喜歡的形狀文件類型,但是您也可以使用其他形狀文件。 geoJSON格式的優(yōu)點(diǎn)是可以作為JSON文件使用,如果需要,可以將其視為Python中的字典。

The code below shows how Folium can easily handle a GeoJson file to add a map overlay.

下面的代碼顯示Folium如何輕松處理GeoJson文件以添加地圖疊加層。

The GeoJson object is added directly to the map we just created. Resaving the map gives the following result.

GeoJson對(duì)象直接添加到我們剛剛創(chuàng)建的地圖中。 重新保存地圖將得到以下結(jié)果。

The map results are exactly as you might expect. Earthquakes are neatly placed along the boundaries of our tectonic plates, just like they were in my middle school science textbook.

地圖結(jié)果完全符合您的預(yù)期。 地震沿我們構(gòu)造板塊的邊界整齊地放置,就像在我的中學(xué)科學(xué)教科書中一樣。

走得更遠(yuǎn) (Going Further)

Now that we have an attractive earthquake map, you may want to do some additional work to create something even more amazing.

現(xiàn)在我們有了一張引人入勝的地震圖,您可能想要做一些額外的工作來創(chuàng)建更令人驚奇的東西。

Consider making a web application with controls for magnitude, time ranges, and locations. In the photo below, we see all of the earthquakes in San Francisco over the past seven days.

考慮制作一個(gè)具有幅度,時(shí)間范圍和位置控件的Web應(yīng)用程序。 在下面的照片中,我們看到了過去七天舊金山的所有地震。

Cisco 7 day map思科7天地圖

Consider looking into the significant formatting options of the Folium Circle class. With the popup kwarg, you can insert html tags for every earthquake. You could then add the magnitude and description for every quake worldwide. The image below is an example of a popup that displays the string from the ‘place’ column

考慮研究Folium Circle類的重要格式化選項(xiàng)。 使用彈出式kwarg,您可以為每次地震插入html標(biāo)簽。 然后,您可以添加全球每個(gè)地震的震級(jí)和描述。 下圖是顯示“ place ”列中的字符串的彈出窗口的示例

example of popup彈出示例

See what you can create with these fantastic datasets. If you make something beautiful, let me know. Good luck!

看看您可以使用這些出色的數(shù)據(jù)集創(chuàng)建什么。 如果您做的很漂亮,請(qǐng)告訴我。 祝好運(yùn)!

翻譯自: https://levelup.gitconnected.com/plotting-usgs-earthquake-data-with-folium-8f11ddc21950

usgs地震記錄如何下載

總結(jié)

以上是生活随笔為你收集整理的usgs地震记录如何下载_用大叶草绘制USGS地震数据的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 无码粉嫩虎白一线天在线观看 | 色欲av无码精品一区 | 日韩欧美www | 久久久久人妻一区精品色 | 色黄大色黄女片免费中国 | 另类色综合 | 黄色特级一级片 | 久草新| 91精品国产高清一区二区三蜜臀 | 亚洲一区二区三区av无码 | 综合成人在线 | 精品日韩在线视频 | 成人网址在线观看 | 国产精品大屁股白浆一区 | 香蕉视频在线网站 | 国产首页 | 亚洲AV不卡无码一区二区三区 | 女生和男生一起插插插 | 懂色一区二区三区免费观看 | 国产人免费人成免费视频 | 欧美性猛交乱大交xxxx | 国产一区二区视频免费在线观看 | 超碰97免费在线 | 国产免费观看一区 | 青青草免费av | 色哟哟在线视频 | 毛片在哪里看 | 日本视频在线观看免费 | 少妇精品久久久一区二区三区 | 69精品视频 | 国产精品高潮呻吟久久 | 老司机av导航 | 成人久久久精品国产乱码一区二区 | 热久久最新网址 | 精品国模| 国产一级特黄视频 | 国产白浆视频 | 中国zzji女人高潮免费 | 日韩精品一区二区三区无码专区 | 91久久精品一区二区三区 | 懂色av | a毛片毛片av永久免费 | 灌篮高手全国大赛电影 | 熟妇高潮一区二区 | 人妻毛片 | 伊人网在线播放 | 黄色的网站在线 | 日韩伦理一区二区三区 | 丰满大乳奶做爰ⅹxx视频 | 国产青草视频在线观看 | 久久久久99精品成人片三人毛片 | 欧美二区在线 | 亚洲精品麻豆 | 一区视频在线播放 | 国产男女猛烈无遮挡 | 欧美区一区二区三 | 成人深夜视频 | 波多野结衣在线电影 | 国内自拍在线 | 伊人影院网| 欧美日韩精品在线观看视频 | 国产污视频在线看 | 亚洲国产日韩在线一区 | 中日韩在线观看视频 | 91黄色免费视频 | 大桥未久在线视频 | 8x8ⅹ国产精品一区二区 | 亚洲午夜精品久久久久久人妖 | 女生张开腿让男生插 | 九九操| 国产乱子伦农村叉叉叉 | 久久网站免费看 | 亚洲第一看片 | 中国在线观看免费视频 | 日韩高清中文字幕 | 午夜爱| 久久成人小视频 | 成人在线免费网址 | 北条麻妃一区二区三区 | 国产精品毛片一区二区在线看舒淇 | 大肉大捧一进一出视频 | 香蕉视频性| 国产网站一区 | 日韩av自拍偷拍 | 欧美成人一区在线 | 国产乱码久久久久 | 91在线一区二区 | 欧美视频日韩视频 | 在线看片 | jizz在线看| 激情欧美一区二区免费视频 | 四季av国产一区二区三区 | 中文字幕在线三区 | www.奇米.com| 视频在线中文字幕 | 99久久久无码国产精品免费 | 九九九在线 | 欧美成人资源 | 久久精品一区二区国产 |