⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tour.tex

📁 国外免费地震资料处理软件包
💻 TEX
字号:
\title{Revisiting SEP tour with RSF and SCons}\email{sergey.fomel@beg.utexas.edu}\author{Sergey Fomel}\righthead{RSF tour}\lefthead{Fomel}\maketitle\begin{abstract}Many appreciative users were introduced to SEPlib\cite[]{Claerbout.sep.70.413} by an excellent article of\cite{Dellinger.sep.73.461}. In this paper, I show how to create a similarexperience using RSF and SCons.\end{abstract}\section{Getting started}Similarly to SU and SEPlib, RSF programs can be piped and executed from thecommand line, for example:\begin{verbatim}bash$ sfspike n1=1000 k1=300 title="\s200 Welcome to \c2 RSF" | \sfbandpass fhi=2 phase=1 | sfwiggle | xtpen\end{verbatim}If you are already familiar with SEPlib, you can find most of the familiarprograms with the names prepended by ``sf''.Typing a command without arguments, should produce a conciseself-documentation. \begin{verbatim}bash$ sfbandpass\end{verbatim}The recommended way of using RSF, however, is not with the command line butwith SCons and ``SConstruct'' files.\subsection{Setting up}\definecolor{frame}{rgb}{0.905,0.905,0.905}\lstset{language=Python,backgroundcolor=\color{frame},showstringspaces=false,numbers=left,numberstyle=\tiny}Open a file named ``SConstruct'' in your favorite editor and start it with aline \lstinputlisting[firstline=5,lastline=5,frame=single]{rsftour/SConstruct}This line tells Python to load the RSF project module.\subsection{Obtaining the test data}Add a Fetch command as follows:\lstinputlisting[firstline=11,lastline=11,frame=single]{rsftour/SConstruct}Now, by running \begin{verbatim}bash$ scons Txx.HH\end{verbatim}you can instruct SCons to connect to an anonymous data server and extract(fetch) the data file ``Txx.HH'' from the ``septour'' directory.\subsection{Displaying the data}\inputdir{rsftour}Add the following line to the \texttt{SConstruct} file:\lstinputlisting[firstline=17,lastline=17,frame=single]{rsftour/SConstruct}Note that it does not matter if this line appears before or after the``Fetch'' line. You are simply instructing SCons how to create aresult plot from the input.Run\begin{verbatim}bash$ scons wiggle0.view\end{verbatim}If everything is setup correctly in your environment, you should see something like the following output in your terminal:\begin{verbatim}bash$ scons wiggle0.viewscons: Reading SConscript files ...scons: done reading SConscript files.scons: Building targets ...retrieve(["Txx.HH"], [])< Txx.HH /path/to/RSF/bin/sfwiggle > Fig/wiggle0.vpl/path/to/RSF/bin/xtpen Fig/wiggle0.vpl\end{verbatim}and a figure similar to Figure~\ref{fig:wiggle0} appearing on your screen.\plot{wiggle0}{width=6in}{To see this figure on your screen, run \texttt{scons~wiggle0.view}}\section{Processing exercises}\subsection{Windowing and plotting}Our next task is to window and plot a significant portion of the data. Add thefollowing line to the \texttt{SConstruct} file:\lstinputlisting[firstline=23,lastline=23,frame=single]{rsftour/SConstruct}The window command selects the first ten traces and the time window between0.4 and 0.8 seconds.We will plot the windowed data with three different plotting programs.\lstinputlisting[firstline=25,lastline=30,frame=single]{rsftour/SConstruct}For convenience, plotting parameters are put in a string called\texttt{plotpar}. A Python string can be enclosed in single, double,or triple quotes. Triple quotes allow the string to span multiplelines. In this case, we use triple quotes for convenience. Next, weloop (using Python's \texttt{for} construct) through three differentprograms (\texttt{wiggle}, \texttt{contour}, and \texttt{grey}). Foreach program, the command portion of \texttt{Result} is formed byconcatenating two strings with Python's addition operator.Try running \texttt{scons -Q wiggle.view}. You should see something like thefollowing output in your terminal:\begin{verbatim}bash$ scons -Q wiggle.view< Txx.HH /path/to/RSF/bin/sfwindow n2=10 n1=200 f1=200 > windowed.rsf< windowed.rsf /path/to/RSF/bin/sfwiggle transp=y poly=y yreverse=y pclip=100 nc=200 > Fig/wiggle.vpl/path/to/RSF/bin/xtpen Fig/wiggle.vpl\end{verbatim}and a figure similar to Figure~\ref{fig:wiggle} appearing on yourscreen. The \texttt{-Q} switch tells SCons to run in a quiet mode,suppressing verbose comments. We will use it from now on to savespace. You can dismiss the figure by using the ``q'' key on thekeyboard or by hitting the ``quit'' button.Run \texttt{scons -Q view}, and you should see simply\begin{verbatim}bash$ scons -Q view/path/to/RSF/bin/xtpen Fig/wiggle.vpl\end{verbatim}Since the \texttt{wiggle.vpl} figure is up to date, SCons does not rebuildit. After quitting the figure, SCons will resume processing with\begin{verbatim}< windowed.rsf /path/to/RSF/bin/sfcontour transp=y poly=y yreverse=y pclip=100 nc=200 > Fig/contour.vpl/path/to/RSF/bin/xtpen Fig/contour.vpl\end{verbatim}and a figure similar to Figure~\ref{fig:contour} appearing on yourscreen. Quitting the figure, produces\begin{verbatim}< windowed.rsf /path/to/RSF/bin/sfgrey transp=y poly=y yreverse=y pclip=100 nc=200 > Fig/grey.vpl/path/to/RSF/bin/xtpen Fig/grey.vpl\end{verbatim}and Figure~\ref{fig:grey}.\plot{wiggle}{width=6in}{To see this figure on your screen, run \texttt{scons~wiggle.view}} \plot{contour}{width=6in}{To see this figure on your screen, run \texttt{scons~contour.view}}\plot{grey}{width=6in}{To see this figure on your screen, run \texttt{scons~grey.view}}\subsection{Resampling}The next example demonstrated simple signal processing using the Fast FourierTransform. We will first subsample the original data and then recover the datausing Fourier interpolation.Subsampling is accomplished with \texttt{sfwindow}.\lstinputlisting[firstline=36,lastline=37,frame=single]{rsftour/SConstruct}Running \texttt{scons -Q subsampled.rsf} produces\begin{verbatim}< windowed.rsf /path/to/RSF/bin/sfwindow j1=2 > subsampled.rsf\end{verbatim}We can verify that the size of the first axis has decreased by running\begin{verbatim}sfin windowed.rsf subsampled.rsf. \end{verbatim}Try also \texttt{sfwiggle < subsampled.rsf | xtpen} to quickly inspect the subsampled data on the screen.To interpolate the data back to the original sampling, the following sequenceof steps can be applied:\begin{enumerate}\item Fourier transform from time domain to frequency domain.\item Pad the frequency axis\item Inverse Fourier transform from frequency to time.\end{enumerate}All three steps are conveniently combined into one using pipes.\lstinputlisting[firstline=39,lastline=41,frame=single]{rsftour/SConstruct}Why do we pad the Fourier domain to 102? The time length of the original datais 201 samples. In the frequency domain, it can be represented with 101positive frequencies plus the zero frequency, which amounts to 102. Note thatthe output of \texttt{sffft1} does not contain negative frequencies.Finally, we display the result. The reconstructed data is shown inFigure~\ref{fig:resampled}. Comparing this result withFigure~\ref{fig:wiggle}, we can verify a fairly accurate reconstruction.\lstinputlisting[firstline=43,lastline=43,frame=single]{rsftour/SConstruct}\plot{resampled}{width=6in}{To see this figure on your screen, run \texttt{scons~resampled.view}} As an exercise, try subsampling the data by a factor of 4 and see if you canstill reconstruct the original data with the Fourier method.\subsection{Normal Moveout}The next example applies a simple constant-velocity NMO correction to thewindowed dataand pipes the result to a wiggle plotting command:\lstinputlisting[firstline=49,lastline=53,frame=single]{rsftour/SConstruct}Running \texttt{scons -Q nmo.view} produces \begin{verbatim}< windowed.rsf /path/to/RSF/bin/sfnmostretch v0=2.05 half=n | /path/to/RSF/bin/sfwiggle pclip=100 max1=0.6 poly=y > Fig/nmo.vpl/path/to/RSF/bin/xtpen Fig/nmo.vpl\end{verbatim}and Figure~\ref{fig:nmo}. Note that SCons does not recreate the\texttt{windowed.rsf} file if that file is up to date. You canexperiment with the NMO velocity (2.05~km/s) or with plottingparameters to get different results. As \cite{Dellinger.sep.73.461}point out, the NMO velocity of 2.05~km/s ``appears to split thedifference between two distinctly non-hyperbolic shear waves''.\plot{nmo}{width=6in}{To see this figure on your screen, run \texttt{scons~nmo.view}}\subsection{Advanced plotting}Sometimes, we need to combine different plots either by overlayingthem on top of each other or by putting them side by side. Here is anexample of accomplishing it with RSF and SCons.Start by creating common plotting plotting arguments and plotting thedata in greyscale. \lstinputlisting[firstline=59,lastline=62,frame=single]{rsftour/SConstruct}Next, plot the wiggle traces twice: the fist time, using thick blacklines (\texttt{plotcol=0 plotfat=10}), and the second time, usingthinner white lines (\texttt{plotcol=7 plotfat=5}).\lstinputlisting[firstline=63,lastline=66,frame=single]{rsftour/SConstruct}The plots are combined by overlaying or by putting them side by side.\lstinputlisting[firstline=68,lastline=69,frame=single]{rsftour/SConstruct}The resultant plots are shown in Figures~\ref{fig:overplot} and~\ref{fig:sidebyside}. \plot{overplot}{width=6in}{To see this figure on your screen, run \texttt{scons~overplot.view}}\plot{sidebyside}{width=6in}{To see this figure on your screen, run \texttt{scons~sidebyside.view}}\begin{comment}Running \texttt{scons -Q overplot.view} produces \begin{verbatim}< windowed.rsf /path/to/RSF/bin/sfgrey wheretitle=t wherexlabel=b transp=y poly=y yreverse=y pclip=100 nc=100 allpos=n min1=.4 max1=.8 max2=1. min2=.05 poly=n > grey.vpl< windowed.rsf /path/to/RSF/bin/sfwiggle plotcol=0 plotfat=10 transp=y poly=y yreverse=y pclip=100 nc=100 allpos=n min1=.4 max1=.8 max2=1. min2=.05 poly=n > wiggle1.vpl< windowed.rsf /path/to/RSF/bin/sfwiggle plotcol=7 plotfat=3 transp=y poly=y yreverse=y pclip=100 nc=100 allpos=n min1=.4 max1=.8 max2=1. min2=.05 poly=n > wiggle2.vpl/path/to/RSF/bin/vppen erase=o vpstyle=n grey.vpl wiggle1.vpl wiggle2.vpl > Fig/overplot.vpl/path/to/RSF/bin/xtpen Fig/overplot.vpl\end{verbatim}\end{comment}\section{Conclusions}This tour is not designed as a comprehensive manual. It simply gives aglimpse into working in a reproducible research environment with RSFand SCons. The reader is encouraged to experiment with the\texttt{SConstruct} file attached to this tour and included in theAppendix. For other documentation on RSF, please see\begin{itemize}\item \href{http://egl.beg.utexas.edu/RSF/book/rsf/rsf/tour_html/}{Introduction to RSF}  \item  \href{http://egl.beg.utexas.edu/RSF/book/rsf/rsf/install_html/}{Installation instructions}\item \href{http://egl.beg.utexas.edu/RSF/}{Self-documentation reference for RSF programs}\item A \href{http://egl.beg.utexas.edu/RSF/book/rsf/rsf/prog_html/}{guide to RSF programs}\item A \href{http://egl.beg.utexas.edu/RSF/book/rsf/rsf/format_html/}  {guide to RSF file format}\item A \href{http://egl.beg.utexas.edu/RSF/book/rsf/rsf/api_html/}{guide to    RSF programming interface}\item A \href{http://egl.beg.utexas.edu/RSF/book/rsf/rsf/demo_html/}{guide to programming with RSF}\item A  \href{http://egl.beg.utexas.edu/RSF/book/rsf/scons/paper_html/}{guide    to SCons interface for reproducible computations}\end{itemize}\section{Acknowledgments}Thanks to Joe Dellinger and S\'{a}ndor T\'{a}las for creating ``SEPtour'' and to James Rickett for updating it. Several generations ofSEP students contributed to SEPlib. We try to preserve all their goodideas when refactoring SEPlib into RSF.The test dataset used in this paper is courtesy of Beltram Nolte and L. Neil Frazer.\bibliographystyle{seg}\bibliography{SEG,SEP2}\appendix\section{SConstruct file}Here is a complete listing of the \texttt{SConstruct} file used in thisexample.\lstinputlisting[frame=single]{rsftour/SConstruct}%%% Local Variables: %%% mode: latex%%% TeX-master: t%%% End: 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -