day1/session5.tex
changeset 261 9cce24d00957
parent 259 bb77a470e00a
child 262 9664eddee075
equal deleted inserted replaced
259:bb77a470e00a 261:9cce24d00957
   144 %%   \frametitle{\typ{loadtxt}}
   144 %%   \frametitle{\typ{loadtxt}}
   145 %% \end{frame}
   145 %% \end{frame}
   146 
   146 
   147 \section{Interpolation}
   147 \section{Interpolation}
   148 \begin{frame}[fragile]
   148 \begin{frame}[fragile]
   149 \frametitle{Interpolation}
   149 \frametitle{Loading data (revisited)}
   150 \begin{itemize}
   150 \begin{itemize}
   151   \item Given data file \typ{points.txt}.
   151   \item Given data file \typ{points.txt}.
   152   \item It contains x,y position of particle.
   152   \item It contains x,y position of particle.
   153   \item Plot the given points.
   153   \item Plot the given points.
   154 %%  \item Interpolate the missing region.
   154 %%  \item Interpolate the missing region.
   155 \end{itemize}
   155 \end{itemize}
   156 \emphbar{Loading data (revisited)}
       
   157 \begin{lstlisting}
   156 \begin{lstlisting}
   158 In []: data = loadtxt('points.txt')
   157 In []: data = loadtxt('points.txt')
   159 In []: data.shape
   158 In []: data.shape
   160 Out[]: (40, 2)
   159 Out[]: (40, 2)
   161 In []: x = data[:,0]
   160 In []: x = data[:,0]
   162 In []: y = data[:,1]
   161 In []: y = data[:,1]
   163 In []: plot(x, y, '.')
   162 In []: plot(x, y, '.')
   164 \end{lstlisting}
   163 \end{lstlisting}
   165 \end{frame}
   164 \end{frame}
   166 
   165 
       
   166 \begin{frame}
       
   167   \frametitle{Plot}
       
   168   \begin{center}
       
   169     \includegraphics[height=2in, interpolate=true]{data/missing_points}
       
   170   \end{center}
       
   171 \end{frame}
   167 %% \begin{frame}[fragile]
   172 %% \begin{frame}[fragile]
   168 %% \frametitle{Interpolation \ldots}
   173 %% \frametitle{Interpolation \ldots}
   169 %% \begin{small}
   174 %% \begin{small}
   170 %%   \typ{In []: from scipy.interpolate import interp1d}
   175 %%   \typ{In []: from scipy.interpolate import interp1d}
   171 %% \end{small}
   176 %% \end{small}