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

📄 format.tex

📁 国外免费地震资料处理软件包
💻 TEX
📖 第 1 页 / 共 2 页
字号:
files over network. It typically corresponds to big-endian byte ordering. Itis more efficient to process RSF files in the native binary format but, if youintend to access data from different platforms, it might be a good idea tostore the corresponding file in an XDR format. RSF also allows for an ASCII(plain text) form of data files. Conversion between different types and forms is accomplished with\texttt{sfdd} program. Here are some examples. First, let us create syntheticdata.\begin{verbatim}bash$ sfmath n1=10 output='10*sin(0.5*x1)' > sin.rsfbash$ sfin sin.rsfsin.rsf:    in="/tmp/sin.rsf@"    esize=4 type=float form=native    n1=10          d1=1           o1=0        10 elements 40 bytesbash$ < sin.rsf sfdisfil   0:             0        4.794        8.415        9.975        9.093   5:         5.985        1.411       -3.508       -7.568       -9.775\end{verbatim}Converting the data to the integer type:\begin{verbatim}bash$ < sin.rsf type=int > isin.rsfbash$ sfin isin.rsfisin.rsf:    in="/tmp/isin.rsf@"    esize=4 type=int form=native    n1=10          d1=1           o1=0        10 elements 40 bytesbash$ < isin.rsf sfdisfil   0:    0    4    8    9    9    5    1   -3   -7   -9\end{verbatim}Converting the data to the ASCII form:\begin{verbatim}bash$ < sin.rsf sfdd form=ascii > asin.rsfbash$ < asin.rsf sfdisfil   0:             0        4.794        8.415        9.975        9.093   5:         5.985        1.411       -3.508       -7.568       -9.775bash$ sfin asin.rsfasin.rsf:    in="/tmp/asin.rsf@"    esize=0 type=float form=ascii    n1=10          d1=1           o1=0        10 elementsbash$ cat /tmp/asin.rsf@0 4.79426 8.41471 9.97495 9.09297 5.98472 1.4112 -3.50783-7.56803 -9.7753\end{verbatim}\subsection{Hypercube}While RSF stores binary data in a contiguous 1-D array, the conceptualdata model is a multidimensional hypercube. By convention, thedimensions of the cube are defined with parameters \texttt{n1},\texttt{n2}, \texttt{n3}, etc.  The fastest axis is \texttt{n1}.Additionally, the grid sampling can be given by parameters\texttt{d1}, \texttt{d2}, \texttt{d3}, etc. The axes origins are givenby parameters \texttt{o1}, \texttt{o2}, \texttt{o3}, etc. Optionally,you can also supply the axis label strings \texttt{label1},\texttt{label2}, \texttt{label3}, etc., and axis units strings\texttt{unit1}, \texttt{unit2}, \texttt{unit3}, etc. \section{Compatibility with other file formats}It is possible to exchange RSF-formatted data with other popular data formats.\subsection{Compatibility with SEPlib}RSF is mostly compatible with its predecessor, the SEPlib file format.However, there are several important differences:\begin{enumerate}\item SEPlib program typically use the element size (\texttt{esize=}parameter) to distinguish between different data types:\texttt{esize=4} corresponds to floating point data, while\texttt{esize=8} corresponds to complex data. The typical typehandling mechanism in RSF is different: RSF looks at\texttt{data\_format=} to determine the data type.\item The default data form in SEPlib programs istypically XDR and not native as it is in RSF. \item It is possible to pipe theoutput of RSF programs to SEPlib:\begin{verbatim}bash$ sfspike n1=1 | Attr want=minminimum value = 1 at 1\end{verbatim}However, piping the output of SEPlib programs to RSF (or, for that matter, anyother non-SEPlib programs) will result in an unterminated process. Do not try\begin{verbatim}bash$ Spike n1=1 | sfattr want=min\end{verbatim}That happens because SEPlib uses sockets for piping and expects a socketconnection from the receiving program. RSF passes data through regular Unixpipes.\item SEP3D is an extension of SEPlib for operating with irregularly sampled  data \cite[]{Biondi.sep.92.343}. There is no equivalent of it in RSF for  the reasons explained in the beginning of this guide. Operations with  irregular datasets are supported through the use of auxiliary input files  that represent the geometry information.\end{enumerate}\subsection{Reading and writing SEG-Y and SU files}The SEG-Y format is based on the proposal of \cite{GEO40-02-03440352}.It was revised in 2002\footnote{See \url{http://seg.org/publications/tech-stand/seg_y_rev1.pdf}.}. TheSU format is a modification of SEG-Y used in Seismic Unix\cite[]{TLE16-07-10451049}.To convert files from SEG-Y or SU format to RSF, use the \texttt{sfsegyread}program. Let us first manufacture an example file using SU utilities\cite[]{su}:\begin{verbatim}bash$ suplane > plane.subash$ segyhdrs < plane.su | segywrite tape=plane.segy\end{verbatim}To convert it to RSF, use either\begin{verbatim}bash$ sfsegyread tape=plane.su su=y tfile=tfile.rsf endian=0 > plane.rsf\end{verbatim}or\begin{verbatim}bash$ sfsegyread tape=plane.segy tfile=tfile.rsf \hfile=hfile bfile=bfile endian=0 > plane.rsf\end{verbatim}The endian flag is needed if the SU file originated from a little-endianmachine such as Linux PC.Several files are generated. The standard output contains an RSF file with thedata (32 traces with 64 samples each):\begin{verbatim}bash$ sfin plane.rsfplane.rsf:    in="/tmp/plane.rsf@"    esize=4 type=float form=native    n1=64          d1=0.004       o1=0    n2=32          d2=?           o2=?        2048 elements 8192 bytes\end{verbatim}The contents of this file are displayed in Figure~\ref{fig:plane}.The \texttt{tfile} is an RSF integer-type file with the trace headers (32headers with 71 traces each):\begin{verbatim}bash$ sfin tfile.rsftfile.rsf:    in="/tmp/tfile.rsf@"    esize=4 type=int form=native    n1=71          d1=?           o1=?    n2=32          d2=?           o2=?        2272 elements 9088 bytes\end{verbatim}The contents of trace headers can be quickly examined with the \texttt{sfheaderattr} program.The \texttt{hfile} is the ASCII header file for the whole record.\begin{verbatim}bash$ head -c 242 hfileC      This tape was made at theC                                                                              C      Center for Wave Phenomena                         \end{verbatim}The  \texttt{bfile} is the binary header file.\plot{plane}{width=5in}{The output of \texttt{suplane}, converted to RSF and  displayed with \texttt{sfwiggle}.}To convert files back from RSF to SEG-Y or SU, use the \texttt{sfsegywrite}program and reverse the input and output:\begin{verbatim}bash$ sfsegywrite tape=spike.su su=y tfile=tfile.rsf endian=0 < spike.rsf\end{verbatim}or\begin{verbatim}bash$ sfsegywrite tape=spike.segy tfile=tfile.rsf \hfile=hfile bfile=bfile endian=0 < spike.rsf\end{verbatim}\subsection{Reading and writing ASCII files}Reading and writing ASCII files can be accomplished with the \texttt{sfdd}program. For example, let us take an ASCII file with numbers\begin{verbatim}bash$ cat file.asc1.0 1.5 3.04.8 9.1 7.3\end{verbatim}Converting it to RSF is as simple as\begin{verbatim}bash$ echo in=file.asc n1=3 n2=2 data_format=ascii_float > file.rsfbash$ sfin file.rsffile.rsf:    in="file.asc"    esize=0 type=float form=ascii    n1=3           d1=?           o1=?    n2=2           d2=?           o2=?        6 elements\end{verbatim}For more efficient input/output operations, it might be advantageous toconvert the data type to native binary, as follows:\begin{verbatim}bash$ echo in=file.asc n1=3 n2=2 data_format=ascii_float | \sfdd form=native > file.rsfbash$ sfin file.rsffile.rsf:    in="/tmp/file.rsf@"    esize=4 type=float form=native    n1=3           d1=?           o1=?    n2=2           d2=?           o2=?        6 elements 24 bytes\end{verbatim}Convert from RSF to ASCII is equally simple:\begin{verbatim}bash$ sfdd form=ascii out=file.asc < file.rsf > /dev/nullbash$ cat file.asc1 1.5 3 4.8 9.1 7.3\end{verbatim}You can use the \texttt{line=} and \texttt{format=} parameters in\texttt{sfdd} to control the ASCII formatting:\begin{verbatim}bash$ sfdd form=ascii out=file.asc \line=3 format="%3.1f " < file.rsf > /dev/nullbash$ cat file.asc1.0 1.5 3.04.8 9.1 7.3\end{verbatim}An alternative is to use \texttt{sfdisfil}.\begin{verbatim}bash$ sfdisfil > file.asc col=3 format="%3.1f " number=n < file.rsfbash$ cat file.asc1.0 1.5 3.04.8 9.1 7.3\end{verbatim}\section{Other documentation}This note should give you a general understanding of the RSF fileformat. Other relevant documentation is \begin{itemize}\item \href{http://egl.beg.utexas.edu/RSF/book/rsf/rsf/paper_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/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/rsf/tour_html/}{tour of RSF software}\item A \href{http://egl.beg.utexas.edu/RSF/book/rsf/scons/paper_html/}{guide to SCons interface for reproducible computations}\end{itemize}\bibliographystyle{seg}\bibliography{intro,SEG,SEP2}%%% Local Variables: %%% mode: latex%%% TeX-master: t%%% End: 

⌨️ 快捷键说明

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