# this is # ---------------------------------------------------------------------------- # $Id$ # # Copyright (c) 2002 by Thomas Forbriger (IMG Frankfurt) # # SFF header manipulation # # ---- # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # ---- # # This is a collection of tools that support SFF (Stuttgart File Format) # header manipulation. # # You will find the following targets: # # sehefi sets the fields station, channel, auxid and instype in the WID2 # lines of an SFF data file to explicite values # coma creates a table of equidistant receiver coordinates # chaco uses a tabel produced by coma to set receiver and source # coordinates in an SFF data file # cooset this program sets receiver and source coordinates for global # seismic data; receiver coordinates are obtained from a table of # seismic stations # epi prints a list of receiver offsets contained in an SFF file # offli prints a list of receiver offsets contained in an SFF file # this program provied different output formats to craete control # files for refmet, chaco, or wolle info files # merse combines all traces from several different SFF input data files # within one single SFF data file (does no waveform stacking); use # fidase if you want to manipulate the waveform to and if you want # to stack data at identical offsets # sesoc set the source coordinate in an SFF data file # sesot set the source time in an SFF data file # # To compile this code with the rules given below, you need the f2c compiler # from Netlib. # # To link the programs, you need libraries provided in packages that can be # downloaded from the place, you obtained this package from. You will need the # following additional packages: # # libsff provides libsff.a # libtf provides libtf.a # libsffu provides libsffu.a # libtime provides libtime_trad.a and libtime++.a # libgsexx provides libgsexx.a # libsffxx provides libsffxx.a # libtfxx provides libtfxx.a # libaff provides libaff.a # # See README.compile for further information # # REVISIONS and CHANGES # 14/03/2002 V1.0 Thomas Forbriger # 05/07/2007 V1.1 prepared for package creation # 13/12/2007 V1.2 g77 is the standard Fortran compiler now # # ============================================================================ # # NOTICE: fallback solution (f2c is default) can be activated by the # environment variable TF_FALLBACK # This option will disappear somewhere in the future! # all: install install: sehefi coma epi chaco sesoc offli sesot merse cooset flist: Makefile $(wildcard *.f *.cc) echo $^ | tr ' ' '\n' | sort > $@ .PHONY: edit edit: flist; vim $< .PHONY: clean clean: ; -find . -name \*.bak | xargs --no-run-if-empty /bin/rm -v -/bin/rm -vf flist *.o FLAGS += $(MYFLAGS) F2CLIB=-lf2c -lm -L${SERVERLIBDIR} G2CLIB=-lg2c -lm -L${SERVERLIBDIR} F2CFLAGS=-f -u FCFLAGS=-Wall -ff2c -ffixed-line-length-0 -fno-backslash $(FLAGS) CFLAGS=-O3 -I${SERVERINCLUDEDIR} -I${LOCINCLUDEDIR} $(FLAGS) CXXFLAGS=-Wall $(FLAGS) LDFLAGS=-L$(LOCLIBDIR) $(FLAGS) CPPFLAGS=-I$(LOCINCLUDEDIR) $(FLAGS) ifeq ($(TF_FALLBACK),yes) .f.o: f2c $(F2CFLAGS) $< gcc $(CFLAGS) $(<:.f=.c) -c -I${SERVERINCLUDEDIR} -I${LOCINCLUDEDIR} @rm $(<:.f=.c) else %.o: %.f; $(FC) -o $@ -c $(FCFLAGS) $< endif ifeq ($(TF_FALLBACK),yes) sehefi coma epi chaco sesoc: %: %.o $(CC) -o $@ $< -ltf -lsff $(F2CLIB) /bin/mv -fv $@ offli sesot merse: %: %.o $(CC) -o $@ $< -ltf -lsffu -ltime_trad -lsff $(F2CLIB) /bin/mv -fv $@ cooset: %: %.o $(CXX) -o $@ $^ -I$(LOCINCLUDEDIR) -lsffxx -ltime++ -lgsexx -laff \ -ltfxx -L$(LOCLIBDIR) $(CXXFLAGS) $(FLAGS) /bin/mv -fv $@ else sehefi coma epi chaco sesoc: %: %.o $(FC) -o $@ $< -ltf -lsff -L$(LOCLIBDIR) /bin/mv -fv $@ $(LOCBINDIR) offli sesot merse: %: %.o $(FC) -o $@ $< -ltf -lsffu -ltime_trad -lsff -L$(LOCLIBDIR) /bin/mv -fv $@ $(LOCBINDIR) cooset: %: %.o $(CXX) -o $@ $^ -I$(LOCINCLUDEDIR) -lsffxx -ltime++ -lgsexx -laff \ -ltfxx -L$(LOCLIBDIR) $(CXXFLAGS) $(FLAGS) /bin/mv -fv $@ $(LOCBINDIR) endif #====================================================================== # create package # -------------- VERSIONCODE=$(shell date +'%Y%m%d') PACKAGE=sffutilhd$(VERSIONCODE) PUBLICATIONPATH=$(HOME)/public_html/download/software TMPPATH=$(HOME)/tmp/$(PACKAGE) package: /bin/rm -rfv $(TMPPATH); mkdir -pv $(TMPPATH) cd $(TMPPATH)/..; cvs export -l -r HEAD \ -d $(PACKAGE) thof/src/conv/sff cd $(TMPPATH)/..; cvs export -r HEAD -d $(PACKAGE) thof/src/LICENSE.GPL cd $(TMPPATH)/..; cvs export -r HEAD \ -d $(PACKAGE) thof/src/README.compile cd $(TMPPATH)/..; cvs export -r HEAD \ -d $(PACKAGE) thof/src/README.1st /bin/bash -c 'cd $(TMPPATH); \ export LOCBINDIR=bin; mkdir -v bin; \ make all; make clean' cd $(TMPPATH)/..; tar cvf $(PUBLICATIONPATH)/$(PACKAGE).tar $(PACKAGE) gzip --force -9 $(PUBLICATIONPATH)/$(PACKAGE).tar cd $(TMPPATH)/..; tar cvf $(PUBLICATIONPATH)/$(PACKAGE).tar $(PACKAGE) bzip2 -f $(PUBLICATIONPATH)/$(PACKAGE).tar # ----- END OF Makefile -----