Updating project 1

This commit is contained in:
mhjensen
2018-09-12 14:26:52 +02:00
parent 4e470829f0
commit e71b95a3d7
8 changed files with 16 additions and 461 deletions
+9 -9
View File
@@ -125,7 +125,7 @@ Project 1 on Machine Learning, deadline October 1
% --- begin date ---
\begin{center}
Sep 11, 2018
Sep 12, 2018
\end{center}
% --- end date ---
@@ -175,7 +175,7 @@ which polynomial fits the data best.
The Python fucntion for the Franke function is included here (it performs also a three-dimensional plot of it)
\begin{print}
\begin{verbatim}
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
from matplotlib import cm
@@ -216,7 +216,7 @@ fig.colorbar(surf, shrink=0.5, aspect=5)
plt.show()
\end{print}
\end{verbatim}
\paragraph{Part a): Ordinary Least Square on the Franke function with resampling.}
@@ -257,14 +257,14 @@ We are going to download digital terrain data from the website \href{{https://ea
In order to obtain data for a specific region, you need to register as a user (free) at this website and then decide upon which area you want to fetch the digital terrain data from. In order to be able to read the data properly, you need to specify that the format should be \textbf{SRTM Arc-Second Global} and download the data as a \textbf{GeoTIF} file.
The files are then stored in \emph{tif} format which can be imported into a Python program using
\begin{print}
scipy.misc.imread
\end{print}
\begin{verbatim}
from imageio import imread
\end{verbatim}
Here is a simple part of a Python code which reads and plots the data from such files
\begin{print}
\begin{verbatim}
import numpy as np
from scipy.misc import imread
from imageio import imread
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
@@ -278,7 +278,7 @@ plt.imshow(terrain1, cmap='gray')
plt.xlabel('X')
plt.ylabel('Y')
plt.show()
\end{print}
\end{verbatim}
If you should have problems in downloading the digital terrain data, we provide two examples under the data folder of project 1. One is from a region close to Stavanger in Norway and the other Møsvatn Austfjell, again in Norway.