JSAC.seis | R Documentation |
Read SEGY/SAC format binary data
JSAC.seis(fnames, Iendian = 1 , HEADONLY=FALSE,
BIGLONG=FALSE, PLOT = -1, RAW=FALSE)
JSEGY.seis(fnames, Iendian = 1 , HEADONLY=FALSE,
BIGLONG=FALSE, PLOT = -1, RAW=FALSE)
fnames |
vector of file names to be extracted and converted. |
Iendian |
vector, Endian-ness of the data: 1,2,3: "little", "big", "swap". Default = 1 (little) |
HEADONLY |
logical, TRUE= header information only |
BIGLONG |
logical, TRUE=long=8 bytes |
PLOT |
integer, <0 no plot; 0 interactive; >0 number of seconds to sleep |
RAW |
logical, default=FALSE(convert to volts) , TRUE (return counts intead of volts) |
Uses readBin to extract data in SAC format. user must know what kind of machine the data was created on for I/O purposes.
For SEGY data the program is the same, although SEGY data does not have the problem of the BIGLONG so that is ignored.
For either code, a full header is returned, although the header for each format may be different.
List containing the seismic data and header information. Each trace consists of a list with:
fn |
original file name |
sta |
station name |
comp |
compnent |
dt |
delta t in seconds |
DATTIM |
time list |
yr |
year |
jd |
julian day |
mo |
month |
dom |
day of month |
hr |
hour |
mi |
minute |
sec |
sec |
msec |
milliseconds |
dt |
delta t in seconds |
t1 |
time start of trace |
t2 |
time end of trace |
off |
off-set |
N |
number of points in trace |
units |
units |
amp |
vector of trace values |
HEAD |
Full header as a data-frame of values (mixture of float and character strings) |
N |
Number of samples in trace |
units |
Units of samples, possibly: counts, volts, s, m/s, Pa, etc |
IO |
list: kind, Iendian, BIGLONG flags for I/O |
SAC created on PC (windows) or LINUX machines typically will be in little endian format. SAC created on a SUN will be in big endian format. If you want to swap endian-ness , choose swap.
MAC uses different convention.
Iendian can be a vector if input files have different endian-ness.
SAC inserts -12345 for no data.
There are other issues regarding the size of long.
The units are often questionable and depend on the processing. The user should be careful and check to see that the proper conversions and multipliers have been applied.
Jonathan M. Lees<jonathan.lees@unc.edu>
Mine.seis, rseis2sac
##### make some SAC files, then read them in
data(GH)
apath = tempdir()
## setwd(apath)
## apath = 'TEMP'
J = rseis2sac(GH, sel =1:5, path = apath, BIGLONG =FALSE )
####### next read them in
Lname <- list.files(path=J , pattern='SAC', full.names=TRUE)
S1 <- JSAC.seis(Lname, Iendian = .Platform$endian, BIGLONG =FALSE , PLOT = -1)
#### check just the first one
i = 1
plotGH(S1[[i]])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.