Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
A trip to earth science with python as a companion
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Nikoleta
October 29, 2017
Programming
54
0
Share
A trip to earth science with python as a companion
My talk for PyConUK 217.
Nikoleta
October 29, 2017
More Decks by Nikoleta
See All by Nikoleta
Arcas: Using Python to access open research literature
nikoletav3
1
180
Optimisation of short memory strategies in the Iterated Prisoners Dilemma
nikoletav3
0
57
Testing Research Software
nikoletav3
0
330
Arcas
nikoletav3
0
510
SSI Selection Day
nikoletav3
0
420
SWORDS-03-10-2016
nikoletav3
0
53
PyCon UK 2016
nikoletav3
0
170
Other Decks in Programming
See All in Programming
AI時代だからこそ「Bloc」を採用する価値があるのかもしれない
takuroabe
0
250
ReactとSvelteのその先、Ripple-TS / Beyond React and Svelte: Ripple-TS
ssssota
3
1.3k
~ 秘伝のタレ化した『神スプシ』と戦う ~ 関数型パラダイムで壊れない仕組みへ
h0r15h0
1
140
Zod v4 Codec でスキーマに型変換を埋め込む REST API 設計 #TSKaigi2026
ryutaro_yako
0
160
TypeScriptだけでAIエージェントを作る フロント・エージェント・インフラのフルスタック実践
har1101
6
1.1k
開発とはなにか、Essenceカーネルで見えるもの
ukin0k0
0
220
AI時代になぜ書くのか
mutsumix
0
470
The Arts and Crafts of Work in the AI Era — Toward Mastery in Software Development
kuranuki
1
610
自動レビューエンジンの実装と運用 ~レビューのない世界へ~
kurukuru1999
2
280
RailsTokyo 2026#4: AI様があれば、 Hotwireの弱点は消えるか?
naofumi
5
1k
気づいたらRubyで100作品 ー クリエイティブコーディングが生活の一部になるまで / 100 Ruby Sketches Later: How Creative Coding Became Part of My Life
chobishiba
2
430
GitHub Copilot CLIのいいところ
htkym
2
1.1k
Featured
See All Featured
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.3k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
190
Code Review Best Practice
trishagee
74
20k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
420
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
118
120k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
290
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
sira's awesome portfolio website redesign presentation
elsirapls
0
260
Technical Leadership for Architectural Decision Making
baasie
3
380
Become a Pro
speakerdeck
PRO
31
5.9k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.6k
Transcript
A trip to earth science with Python as a companion
@NikoletaGlyn
HINTS:
HINTS: several things have been invented by my ancestors;
mathematics make use of my alphabet;
None
None
None
N S W E
None
cores crust mantle
>>> import quakefeeds >>> from quakefeeds import QuakeFeed >>> feed
= QuakeFeed("2.5", "month") >>> feed.title ’USGS Magnitude 2.5+ Earthquakes, Past Month’
MAGNITUDE
Class Magnitude Great 8 or more Major 7 - 7.9
Strong 6 - 6.9 Moderate 5 - 5.9 Light 4 - 4.9 Minor 3 -3.9
{’geometry’: {’coordinates’: [27.3346, 36.9405, 5.01], ’type’: ’Point’}, ’id’: ’us1000apsm’, ’properties’:
{’alert’: None, ’cdi’: 4.1, ’code’: ’1000apsm’, ’detail’: ’https://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/us1000apsm.geojson’, ’dmin’: 0.962, ’felt’: 59, ’gap’: 45, ’ids’: ’,us1000apsm,’, ’mag’: 4.4, ’magType’: ’mb’, ’mmi’: None, ’net’: ’us’, ’nst’: None, ’place’: ’6km NE of Kos, Greece’, ’rms’: 0.82, ’sig’: 322, ’sources’: ’,us,’, ’status’: ’reviewed’, ’time’: 1507665564350, ’title’: ’M 4.4 - 6km NE of Kos, Greece’, ’tsunami’: 0, ’type’: ’earthquake’, ’types’: ’,dyfi,geoserve,origin,phase-data,’, ’tz’: 120, ’updated’: 1508097562926, ’url’: ’https://earthquake.usgs.gov/earthquakes/eventpage/us1000apsm’}, ’type’: ’Feature’}
>>> import earthquakes >>> from earthquakes import earthquakes >>> report
= earthquakes.get_report() >>> report[’title’] ’USGS Significant Earthquakes, Past Hour’ >>> report = earthquakes.get_report(’week’, ’4.5’)
>>> create_map = feed.create_google_map(style="titled") >>> feed.write_google_map("map.html", style="titled")
MATPLOTLIB BASEMAP TOOLKIT http://introtopython.org/visualization_earthquakes.html
from mpl_toolkits.basemap import Basemap import matplotlib.pyplot as plt import numpy
as np plt.figure() my_map = Basemap(projection=’ortho’, lat_0=22, lon_0=30.22, resolution=’h’) my_map.drawcoastlines() plt.show()
from mpl_toolkits.basemap import Basemap import matplotlib.pyplot as plt import numpy
as np plt.figure() my_map = Basemap(projection=’ortho’, lat_0=22, lon_0=30.22, resolution=’h’) my_map.drawcoastlines() my_map.drawcountries() my_map.fillcontinents(color=’orange’) my_map.drawmapboundary() meridians = np.arange(0, 360, 30) parallels = np.arange(-90, 90, 30) my_map.drawmeridians(meridians) my_map.drawparallels(parallels) plt.show()
World Map
plt.figure() my_map = Basemap(projection=’merc’, lat_0=40, lon_0=19, resolution = ’h’, llcrnrlon=20.577,
llcrnrlat=33.568 urcrnrlon=28.1905, urcrnrlat=39.701) my_map.drawcoastlines() my_map.drawcountries() my_map.fillcontinents(color=’orange’) plt.axis(’off’) plt.show()
plt.figure() my_map = Basemap(projection=’merc’, lat_0=40, lon_0=19, resolution = ’h’, llcrnrlon=20.577,
llcrnrlat=33.568 urcrnrlon=28.1905, urcrnrlat=39.701) my_map.drawcoastlines() my_map.drawcountries() my_map.fillcontinents(color=’orange’) x,y = my_map(lons, lats) my_map.plot(x, y, ’ro’, markersize=10) plt.axis(’off’) plt.show()
time 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 magnitude
Mexico Earthquake
World Map magnitude 5 magnitude <5 magnitude <3
https://github.com/obspy/obspy/wiki
07:22:2907:22:5907:23:2907:23:5907:24:2907:24:59 1200 800 400 0 400 800 1200 .RJOB..Z 2005-10-06T07:21:59.85
- 2005-10-06T07:24:59.845
>>> import quakefeeds >>> import earthquakes >>> from mpl_toolkits.basemap import
Basemap >>> import obspy @NikoletaGlyn https://github.com/Nikoleta-v3