Editing
Guide to RSF file format
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Reading and writing SEG-Y and SU files=== The SEG-Y format is based on the proposal of Barry et al. (1975<ref>[http://www.seg.org/SEGportalWEBproject/prod/SEG-Publications/Pub-Technical-Standards/Documents/seg_y_rev0.pdf Barry, K. M., D. A. Cavers, and C. W. Kneale, 1975, Report on recommended standards for digital tape formats: Geophysics, '''40''', 344--352]</ref>). It was revised in 2002<ref>See http://www.seg.org/SEGportalWEBproject/prod/SEG-Publications/Pub-Technical-Standards/Documents/seg_y_rev1.pdf</ref>. The SU format is a modification of SEG-Y used in Seismic Unix (Stockwell, 1997<ref>Stockwell, J. W., 1997, Free software in education: A case study of CWP/SU: Seismic Unix: The Leading Edge, '''16''', 1045--1049.</ref>). To convert files from SEG-Y or SU format to RSF, use the <tt>sfsegyread</tt> program. Let us first manufacture an example file using SU utilities (Stockwell, 1999<ref>-------- 1999, The CWP/SU: Seismic Un*x package: Computers and Geosciences, '''25''', 415--419.</ref>): <pre> bash$ suplane > plane.su bash$ segyhdrs < plane.su | segywrite tape=plane.segy </pre> To convert it to RSF, use either <pre> bash$ sfsuread < plane.su tfile=tfile.rsf endian=0 > plane.rsf </pre> or <pre> bash$ sfsegyread < plane.segy tfile=tfile.rsf \ hfile=file.asc bfile=file.bin > plane.rsf </pre> The endian flag is needed if the SU file originated from a little-endian machine like a Linux PC. Several files are generated. The standard output contains an RSF file with the data (32 traces with 64 samples each): <pre> bash$ sfin plane.rsf plane.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 </pre> The contents of this file are displayed in the figure. [[Image:plane.png|frame|center|The output of suplane, converted to RSF and displayed with <tt>sfwiggle</tt>.]] The <tt>tfile</tt> is an RSF integer-type file with the trace headers (32 headers with 71 traces each): <pre> bash$ sfin tfile.rsf tfile.rsf: in="/tmp/tfile.rsf@" esize=4 type=int form=native n1=71 d1=? o1=? n2=32 d2=? o2=? 2272 elements 9088 bytes </pre> The contents of trace headers can be quickly examined with the <tt>sfheaderattr</tt> program. The <tt>file.asc</tt> is the ASCII header file for the whole record. <pre> bash$ head -c 242 file.asc C This tape was made at the C C Center for Wave Phenomena </pre> The <tt>file.bin</tt> is the binary header file. To convert files back from RSF to SEG-Y or SU, use the <tt>sfsegywrite</tt> program and reverse the input and output: <pre> bash$ sfsuwrite > plane.su tfile=tfile.rsf endian=0 < plane.rsf </pre> or <pre> bash$ sfsegywrite > plane.segy tfile=tfile.rsf \ hfile=file.asc bfile=file.bin < plane.rsf </pre> If <tt>hfile=</tt> and <tt>bfile=</tt> are not supplied to <tt>sfsegywrite</tt>, the corresponding headers will be generated on the fly. The trace header file can be generated with <tt>sfsegyheader</tt>. Here is an example: <pre> bash$ sfheadermath < plane.rsf output=N+1 | sfdd type=int > tracl.rsf bash$ sfsegyheader < plane.rsf tracl=tracl.rsf > tfile.rsf bash$ sfsegywrite < plane.rsf tfile=tfile.rsf > plane.segy </pre> ====Unusual trace header keys==== Sometimes, SEG-Y files deviate from the standard by creating additional trace header keys. If, for example, you find out that the SEG-Y file contains an additional trace header key stored in bytes 225-226, you can either remap one of the standard two-byte keys <pre> bash$ sfsegyread < file.segy tfile=tfile.rsf gut=224 > file.rsf </pre> or create a new key <pre> bash$ sfsegyread < file.segy tfile=tfile.rsf \ key1=mykey key1_len=2 mykey=224 > file.rsf </pre> Any number of additional keys can be created this way.
Summary:
Please note that all contributions to Madagascar are considered to be released under the GNU Free Documentation License 1.3 or later (see
My wiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
English
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Getting Madagascar
download
Installation
GitHub repository
SEGTeX
Introduction
Package overview
Tutorial
Hands-on tour
Reproducible documents
Hall of Fame
User Documentation
List of programs
Common programs
Popular programs
The RSF file format
Reproducibility with SCons
Developer documentation
Adding programs
Contributing programs
API demo: clipping data
API demo: explicit finite differences
Community
Conferences
User mailing list
Developer mailing list
GitHub organization
LinkedIn group
Development blog
Twitter
Slack
Tools
What links here
Related changes
Special pages
Page information