forked from jorisvandenbossche/DS-python-geospatial
-
Notifications
You must be signed in to change notification settings - Fork 1
/
slides.html
executable file
·487 lines (304 loc) · 12.3 KB
/
slides.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
<!DOCTYPE html>
<html>
<head>
<title>Title</title>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="img/slides.css">
<!--
<link rel="stylesheet" href="./img/font-awesome-4.7.0/css/font-awesome.min.css">
<style>
@import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz);
@import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic);
@import url(https://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic);
body { font-family: 'Droid Serif'; }
h1, h2, h3 {
font-family: 'Yanone Kaffeesatz';
font-weight: normal;
}
.remark-code, .remark-inline-code { font-family: 'Ubuntu Mono'; }
#slideshow .slide .content .cols.two .col { width: 48%; }
</style>
-->
<style>
.section_background {background-color:#c2c444; color: #fff}
.day_background {background-color:#ececec; color: #000}
</style>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}});
</script>
<script type="text/javascript" async
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
</head>
<body>
<textarea id="source">
class: center, middle
# Python for GIS and Geoscience
Specialist course Doctoral schools of Ghent University,<br>
5-6-8 October 2020
Joris Van den Bossche, Stijn Van Hoey
https://github.com/jorisvandenbossche/DS-python-geospatial
---
### Joris Van den Bossche
<a href="https://twitter.com/jorisvdbossche"><i class="fa fa-twitter" aria-hidden="true"></i> jorisvdbossche</a>,
<a href="https://github.com/jorisvandenbossche"><i class="fa fa-github" aria-hidden="true"></i> jorisvandenbossche</a><br>
* Open source software developer and teacher
* Pandas, GeoPandas, scikit-learn, Apache Arrow
---
### Stijn Van Hoey
<a href="https://twitter.com/svanhoey"><i class="fa fa-twitter" aria-hidden="true"></i> SVanHoey</a>,
<a href="https://github.com/stijnvanhoey"><i class="fa fa-github" aria-hidden="true"></i> stijnvanhoey</a>
* Research software engineer
.center[
![:scale 90%](./img/work_stijn_1.png)]
---
class: middle, section_background
# Setting up a working environment
---
## Setting up a working environment
For the setup instructions, see the [setup page](https://jorisvandenbossche.github.io/DS-python-geospatial/setup.html).
---
class: left, middle
0. Everyone has conda installed and the environment setup? If not, see [1-install-python-and-the-required-python-packages](https://jorisvandenbossche.github.io/DS-python-geospatial/setup.html#1-install-python-and-the-required-python-packages)
1. Make sure to (re)download ALL the course material, see [2-getting-the-course-materials](https://jorisvandenbossche.github.io/DS-python-geospatial/setup.html#2-getting-the-course-materials) also if you already did this before. We had to update the material this morning...
2. Next, also do section 3 and 4 of the [setup](https://jorisvandenbossche.github.io/DS-python-geospatial/setup.html)
3. Log in to [Ufora](https://ufora.ugent.be/d2l/home/329089) and enter the course room of the '2020-10-05-morning-session' session
> If you succesfully done 0, 1, 2 and 3, give a thumbs up in the discord `#status` channel.
Next:
- Surf to and fill in [the questionnaire](https://hackmd.io/L9fDTVspSbG7BIBJAT2xLQ?both)
- In Jupyter Lab, start with the 'notebooks/00-jupyter_introduction.ipynb'.
Installation or setup issues? Post them on the discord `#installation-issues` channel
---
class: center, middle
When you see something like this...
![:scale 100%](./img/startup.png)
...relax, you're ready to start!
---
class: center, middle
![:scale 100%](https://i.ytimg.com/vi/PlaYMh-u-2w/maxresdefault.jpg)
---
class: center, middle
# Why python?
---
class: center, middle
# Python is...
---
## …WIDESPREAD
* Large world-wide community ensures **fast development**
* Used in **scientific** and non-scientific institutes <br> (Google, NASA, ESRI, VMM,...)
* Python is a standard in **GIS** <br> (commercial and non-commercial tools)
* **Multiplatform** (linux, windows,…)
---
## …REPRODUCIBLE
.center[
instead of
> *what did you/I clicked a few months ago?’-style WYSISYG*
]
--
## …MULTI-FUNCTIONAL
* Research and development: the python *scientific ecosystem*
* Webdevelopment (Django, Flask)
* Daily use: great as ducttape/glue
* **Automation** of time-consuming returning tasks
--
## …OPEN SOURCE
* No license costs!
---
## ...SO WHAT? The Holy Grail ? No!
* Commercial packages give specific support and more direct help-functions (cfr. MATLAB)
* Commercial packages can be more client-friendly
* For hard number-crunching stuff, NOT the fastest solution
* R, Fortran, C++ etc are also ‘widespread’, so python is just a language amongst the others
* Risk of getting lost in the forest/flood of ‘useful packages’
---
# Conda
### Why using conda?
- Consistent package manager across Windows, Mac and Linux
- Many precompiled packages available
- Less problems with installation
--
### Why different environments?
- Manage the dependencies of a specific project/paper/group/...
- You can install different version of Python and other packages alongside on your computer
- Easily share environments with other
---
## Small overview of conda commands
Creating a new environment:
```
conda create -n my_env python=3.7 pandas
# or from environment file
conda env create -f environment.yml
```
Activating an environment:
```
conda activate my_env
```
Install a new package:
```
conda install matplotlib # if not working, try: pip install ...
```
List all installed packages: `conda list`
List all your environments: `conda info -e`
See the docs: http://conda.pydata.org/docs/using/index.html
---
class: center, middle
### Keep track of your python ecosystem <br>with an `environment.yml`
<br><br>
```
conda env export > environment.yml
```
---
class: middle, section_background
# Working with Python
---
## IPython console
<br>
.center[![:scale 75%](./img/ipython.png)]
---
## Interactive Development Environment (IDE)
* [**Spyder**](https://pythonhosted.org/spyder/) is shipped with Anaconda. The familiar environment for Matlab/Rstudio-users...
* [**PyCharm**](https://www.jetbrains.com/pycharm/): Popular for web-development and Django applications, powerful when doing 'real' development (packages, libraries, software)
* [Eclipse + **pyDev plugin**](http://www.pydev.org/): If you like working in Eclipse, just add the python environment
* [**VS Code**](https://code.visualstudio.com/), [**Atom**](https://atom.io/), ...
---
## Jupyter Notebook
<small>(*previously called IPython notebook*)</small>
**Jupyter notebook** provides an **interactive** scripting environment,<br> ideal for exploration, prototyping,...
.center[![:scale 70%](./img/notebook.png)]
--
...the stuff we're dealing with in this course!
---
class: middle, left
### Time is divided between
- group sessions: we explain new concepts (aka 'theory')
- break-out sessions: you work on exercises
In case of questions, remarks, suggestions, you can always post messages in the discord `#daily-channel`
### Status check
We will regularly ask for a check (ready with exercise, installation succesfull...). Use the discord `#status` channel to put 👍 (`thumbs up`).
### Feel lost?
Feel free to send a discord direct message to one of us, we are stand by.
---
class: middle, center
![:scale 80%](./img/issuetracker.png)
Report bugs, typo's, suggestions... as issues ([New issue](https://github.com/jorisvandenbossche/DS-python-geospatial/issues/new))
or see the [contributing guidelines](https://github.com/jorisvandenbossche/DS-python-geospatial/blob/master/CONTRIBUTING.md)
---
class: middle, center
## Let's start
---
class: middle, center
...
---
class: center, middle
# How are you feeling?
![:scale 100%](http://esq.h-cdn.co/assets/15/51/980x490/landscape-1450137389-john-cleese.JPG)
### https://forms.gle/PhxSAW768fTBqLJz8
Please fill in the questionnaire!
---
class: center, middle
# Closing notes
---
class: center, middle
# Python's scientific/GIS ecosystem
#### Inspired by figure by Jake VanderPlas
---
class: center, middle, bgheader
background-image: url(./img/ecosystem-gis-overview_6.svg)
background-size: cover
---
class: center, middle, bgheader
background-image: url(./img/ecosystem-gis-overview_5.svg)
background-size: cover
---
class: center, middle, bgheader
background-image: url(./img/ecosystem-gis-overview_3.svg)
background-size: cover
---
class: center, middle, bgheader
background-image: url(./img/ecosystem-gis-overview_2.svg)
background-size: cover
---
class: center, middle, bgheader
background-image: url(./img/ecosystem-gis-overview_1.svg)
background-size: cover
---
class: center, middle, bgheader
background-image: url(./img/ecosystem-gis-overview.svg)
background-size: cover
---
# A rich ecosystem of packages
<br>
![:scale 60%](https://pysal.org/assets/pysal_nav_logo.svg)
Python Spatial Analysis Library (https://pysal.org). Collection of packages for:
* detection of spatial clusters, hot-spots, and outliers
* construction of graphs from spatial data
* spatial regression and statistical modeling on geographically embedded networks
* spatial econometrics
* exploratory spatio-temporal data analysis
* ...
---
# A rich ecosystem of packages
<br>
Building up on / integrating with GeoPandas:
**MovingPandas** (https://anitagraser.github.io/movingpandas/): working with movement data
**Momepy** (http://docs.momepy.org/en/latest/): quantitative analysis of urban morphology
**geoplot** (https://residentmario.github.io/geoplot/): high-level Python geospatial plotting library (combining GeoPandas, matplotlib and cartopy)
**...**
---
# A rich ecosystem of packages
<br>
Building up on / integrating with xarray:
**Satpy** (https://satpy.readthedocs.io/en/stable/): package for earth-observing satellite data processing
**xesmf** (https://xesmf.readthedocs.io/): Universal Regridder for Geospatial Data
**verde** (https://www.fatiando.org/verde/): interpolating spatial data on regular grids
**rioxarray** (https://github.com/corteva/rioxarray): linking rasterio functionality with xarray
**...**
---
# A rich ecosystem of packages
<br>
Several more domain/application specific packages:
**MetPy** (https://unidata.github.io/MetPy): working with weather data
**xgcm** (https://xgcm.readthedocs.io/en/latest/index.html): working with output from General Circulation Models
**osmnx** (https://github.com/gboeing/osmnx): street networks
**...**
---
# A rich ecosystem of packages
<br>
**Machine learning**: scikit-learn, tensorflow, pytorch, keras, chainer, ...
**Performance**: Numba, Cython, Numexpr, Pythran, C/Fortran wrappers, ...
**Visualisation**: Bokeh, Seaborn, Plotnine, Altair, Plotly, Mayavi, HoloViews, datashader, vaex ...
**Data structures and parallel/distributed computation**: Xarray, Dask, Distributed, Cupy, ...
Specialized packages in many **scientific fields**: astronomy, natural language processing, image processing, geospatial, ...
**Packaging and distribution**: pip/wheels, conda, Anaconda, Canopy, ...
---
class: center, middle
### Reading advice
[Good Enough Practices in Scientific Computing](https://arxiv.org/pdf/1609.00037v1.pdf)
> "*However, while most scientists are careful to validate their laboratory and field equipment, most do not know how reliable their software is*"
---
class: center, middle
## Good luck!
![](http://www.backwaterreptiles.com/images/pythons/angolan-python-for-sale.jpg)
</textarea>
<!-- <script src="https://gnab.github.io/remark/downloads/remark-latest.min.js">
</script>-->
<script src="img/remark.min.js" type="text/javascript">
</script>
<script>
var slideshow = remark.create();
</script>
<script>
remark.macros.scale = function (percentage) {
var url = this;
return '<img src="' + url + '" style="width: ' + percentage + '" />';
};
var slideshow = remark.create();
</script>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</body>
</html>