ZGET.sac {RSEIS} | R Documentation |
Get single SAC file from binary data
ZGET.sac(infile, PLOT = FALSE)
infile |
path name to file |
PLOT |
logical, plot (not used) |
Program uses C-code to read in binary SAC files and returns the header information and the time series data
LIST:
x |
vector of amplitudes |
mints |
vector if integer SAC header values |
dubs |
vector if float(double) SAC header values |
mchars |
vector if 8-character SAC header values |
echars |
vector if 16-character SAC header values |
dubnames |
names of float values |
mintnames |
names of integer values |
charnames |
names of char values |
Sometimes information in the SAC header is omitted by the user and instead stored in the file name. In that case the station name and component name will have to be replaced by the appropriate string from the file name.
Jonathan M. Lees<jonathan.lees@unc.edu>
dogetsac, JGET.seis, Package:Rsac
## Not run: ### you must replace this file name with local SAC file name infile='VLI.BHZ.SAC' ZZ = ZGET.sac(infile) dt = ZZ$dubs[ which(ZZ$dubnames=='delta') ] yr = ZZ$mints[which(ZZ$mintnames=="nzyear")] jd= ZZ$mints[which(ZZ$mintnames=="nzjday")] hr= ZZ$mints[which(ZZ$mintnames=="nzhour")] mi= ZZ$mints[which(ZZ$mintnames=="nzmin")] sec= ZZ$mints[which(ZZ$mintnames=="nzsec")] msec=ZZ$mints[which(ZZ$mintnames=="nzmsec")] sec = sec+msec/1000 DATTIM=list(yr=yr, jd=jd, hr=hr, mi=mi, sec=sec) ### the SAC file does not have the correct names, so we read from the ### input file names sta = substr(infile, 1,3) comp = substr(infile, 7,7) ## End(Not run)