sfmath
(4.0)
index
system/main/math.c
Documentation
Mathematical operations on data files.
Synopsis
sfmath > out.rsf nostdin=n n#= d#=(1,1,...) o#=(0,0,...) label#= unit#= type= label= unit= output=
Known functions:
cos, sin, tan, acos, asin, atan,
cosh, sinh, tanh, acosh, asinh, atanh,
exp, log, sqrt, abs,
erf, erfc, sign (for float data),
arg, conj, real, imag (for complex data).
sfmath will work on float or complex data, but all the input and output
files must be of the same data type.
An alternative to sfmath is sfadd, which may be more efficient, but is
less versatile.
Examples:
sfmath x=file1.rsf y=file2.rsf power=file3.rsf output='sin((x+2*y)^power)' > out.rsf
sfmath < file1.rsf tau=file2.rsf output='exp(tau*input)' > out.rsf
sfmath n1=100 type=complex output="exp(I*x1)" > out.rsf
Arguments which are not treated as variables in mathematical expressions:
datapath=, type=, out=
See also: sfheadermath.
Parameters
float
d#=(1,1,...)
sampling on #-th axis
string
label=
data label
string
label#=
label on #-th axis
largeint
n#=
size of #-th axis
bool
nostdin=n
[y/n]
y - ignore stdin
float
o#=(0,0,...)
origin on #-th axis
string
output=
Mathematical description of the output
string
type=
output data type [float,complex]
string
unit=
data unit
string
unit#=
unit on #-th axis
Used In
BEI
dpmv/matt
dwnc/sigmoid
ft1/autocor
ft1/brad
ft1/ft2d
ft1/matrix
trimo/all
vela/strat
vela/vscan
CHEN
test/fpca
test/wavmod
test/xtime
CUP
rna2d/real
rna2d/shot
rna2d/simple
rna3d/shot
rna3d/sin
CWP
geo2006TimeShiftImagingCondition/flat
geo2006TimeShiftImagingCondition/icomp
geo2006TimeShiftImagingCondition/zicig
geo2007StereographicImagingCondition/flat4
geo2007StereographicImagingCondition/gaus1
geo2007StereographicImagingCondition/sigsbee2
geo2008InterferometricImagingCondition/circle
geo2008InterferometricImagingCondition/sact1
geo2008InterferometricImagingCondition/sigs2
geo2008IsotropicAngleDomainElasticRTM/marm2allA
geo2008IsotropicAngleDomainElasticRTM/marm2oneA
geo2008NumericWEMVAoperators/flatWEMVA
geo2008NumericWEMVAoperators/saltWEMVA
geo2009TTIModeSeparation/fold
geo2009TTIModeSeparation/marmousi2
geo2009TTIModeSeparation/operator
geo2009TTIModeSeparation/tti3
geo2009TTIModeSeparation/vti3
geo2009VTIModeSeparation/aniopsize
geo2009VTIModeSeparation/oporder
geo2009VTIModeSeparation/separate2
geo2009VTIModeSeparation/separate3
geo2009VTIModeSeparation/separate5
geo2009VTIModeSeparation/sigsbee
geo2011WideAzimuthAngleDecomposition/flatEICangle
geo2011WideAzimuthAngleDecomposition/seam357
jse2006RWEImagingOverturningReflections/sigsbee
pept2011MicroearthquakeMonitoring/saf1
pept2011MicroearthquakeMonitoring/saf2
pept2011MicroearthquakeMonitoring/saf3
DATA
alaska/line31-81-m8r
amoco/fdmod
cant12/lpf
cant12/stk
freeusp/land
marmousi/fdmod
marmousi2/fdMod
marmousi2mp/modelproc
nankai/data
nankai/shots
p-cable/ntg
pluto/fdmod
seam-phase1-2d/compare
seam-phase1-2d/cvs
seam-phase1-2d/sfawefd2d
seam-phase1-2d/sfawefd2d_split
segsalt/data
sigsbee/data2A
sigsbee/fdmod2A
sigsbee/fs2B
sigsbee/nfs2B
sigsbee/ptest
sigsbee/pwemig
sigsbee/wemig
teapotdome/angmig
teapotdome/canoren
teapotdome/interp-model
teapotdome/scdecon
teapotdome/tahscplot
teapotdome/tahscscale
teapotdome/vels
teapotdome/zomig
DIRACK
examples/modelAndStack
examples/pefInterpolation
examples/vfsa-set-t0-m0
examples/vfsa-simple
EEG
marchenko/example-cluster
marchenko/example
GALLERY
bp/lowrank
bp/oway
bptti/model
constant/gazdag
constant/kirch
constant/lowrank
constant/model
constant/oway
constant/stolt
constant/vc
french/lowrank
french/oway
gradient/fakirmig
gradient/lowrank
gradient/model
gradient/oway
hessvti/model
marmousi/model
marmousi/recurkir
overthrust/kirch
overthrust/oway
segsalt/lowrank
segsalt/model
sigsbee/ffd
sigsbee/kirMulti
sigsbee/lowrank
sigsbee/lrostep
sigsbee/model
sigsbee/oway
statics94/model
teapot/angmig
teapot/zomig
twohalf/oway
vofz/gazdag
vofz/kirch
vofz/lowrank
vofz/model
vofz/oway
vofz/stolt
vofz/vc
GEE
ajt/galilee
hlx/futterman
hlx/helgal
iin/chevron
iin/galilee
iin/invint
lal/multiscale
lmn/sep77
lsq/antoine
lsq/lomask
lsq/puck
lsq/vesuvio
mda/geostat
mda/levint
mda/mad
mda/misif
mda/pefex
mda/seabeam
noiz/antoine
noiz/burst
noiz/rbst
noiz/softclip
pch/tvdecon
prc/seab
prc/sep94
GEO384H
hw3/compress
hw3/pocs
hw3/rotate
hw4/invint
hw5/pattern
hw5/seabeam
GEO384S
hw0/channel2
hw0/local
hw2/groundroll
hw2/migration
hw3/dmo
hw4/alaska
hw4/teapot
hw4/viking
hw5/pradon
hw5/radon
hw6/gazdag
hw6/kirchhoff
hw6/rtm
GEO384W
hw1/code
hw1/wave
hw2/cmp
hw2/eikonal
hw3/synth
hw4/sigsbee
hw4/synth
hw5/hyper
hw5/hyper2
hw5/lsmig
hw6/blake
hw6/hyper
GEOSTATS
simulate/rfield
simulate/simple
spatial_stats/correlogram
spatial_stats/covariance
spatial_stats/gr_variogram
spatial_stats/variogram
GPGN658
fdmod/exercise
rtmig/exercise
HANSUNG
cgg/syn
ICP
sam2013gpushortestpath/test
JLU
apefsnsep/dune
apefsnsep/simplegroll
fspfint/cmp
fspfint/curve
fspfint/noise_curve
fspfint/noise_qdome
fspfint/qdome
fspfint/sean
fspfint/snr
fxyspfdenoi/qdome
gvdseisint/bei
gvdseisint/ocmodel
gvdseisint/vti
lcfs/conq-model
lcfs/conq-noise
lcfs/lcfest
lcfs/rdata
lcfs/varq-model
riesz/linefit
spefdecon/atten-model
spefdecon/gap-fre
spefdecon/rdata
spefdecon/simple
spefdecon/wedge
txsopf/curvedmodel
txsopf/data2
txsopf/model
txyapf/curve
txyspfint/curve
txyspfint/field3
txyspfint/french
txyspfint/jp
vdseislet/demultiple
vdseislet/haskell
vdseislet/nmo
M8R
api/afdm
data/freeusp
format/format
parallel/omp
shell/sfmath
MILANO
taupvel/cmp
taupvel/synth
OSU
shalek/elastic2d
shalek/elastic3d
shalek/mod3d
PSU
ligo/test
RSF
animate/movie
bash/mpi
bash/plot
bash/sample1
bash/sample2
challenge/rain
reprobook/exam2
reprobook/exam3
reprobook/exam4
reprobook/exam5
rsf/afdm
rsf/fractal
rsf/plot
rsf/radial
rsf/sfawefd
rsf/sfderiv
rsf/sfdots
rsf/sfenvelope
rsf/sfgraph
rsf/sfnderiv
rsf/sfnoise
rsf/sfwiggle
rsf/unif3
rsf/wedge
school/clip_test
school/complex
school/data
school/gauss
school/horizon
school/marm
school/modeling
school/ray
school/sigsbee
school/single
school/tapprox
school/trig
school2009/channel2
school2009/local
school2012/plot
school2012/sample1
school2012/sample2
school2015/adapt
school2015/asc2rsf
school2015/born
school2015/channel2
school2015/local
school2015/modmig
school2016/synth
school2017/c++
school2017/c
school2017/csem
school2017/f90
school2017/python
school2017/seismic
school2020/csem
school2020/seismic
scons/rsf
scons/rsfpy
su/rsfdecon
su/rsfdipfilt
su/rsffdmod2
su/rsfkfupm
su/rsflab10
su/rsflab15
su/rsflab16
su/rsflab5
su/rsflab8
su/rsfreadwrite
su/rsfscales
su/rsfsmooth3d
tutorial2017/radon
tutorial2017/synth
tutorials/attr
tutorials/colormaps
tutorials/cs
tutorials/hilbert
tutorials/images
tutorials/interp
tutorials/lineaments
tutorials/nmo
tutorials/parameters
tutorials/petro2
tutorials/rockphysic
tutorials/scicolormaps
tutorials/semblance
tutorials/slicing
tutorials/spitz
tutorials/survey
tutorials/talitrus
tutorials/timefreq
tutorials/tuning
tutorials/wavelet
tutorials/wedge
tutorials/well-tie
SEP
aal/gulf
angle/agmig
balance/ampl
bspl/bintest
bspl/chirp
bspl/chirp2
bspl/sei3d
burg/gtens
burg/tension
fat/migration
fmeiko/tri
fmsec/cvel
forwd/chirp
forwd/chirp2
fractal/random
geostat/miss
helft/mult
helft/spike
helmholtz/wavemovie
huygens/gauss
huygens/marmousi
lineiko/test
oc2/cup
passive/synth
pefmult/haskell
pefmult/mobil
pefmult/syn
plane/cube
plane/eplane
precon/cube
precon/oned
precon/seab
pwd/blast
pwd/dune
pwd/hector
pwd/seab
pyramid/model
pyramid/pyramid
rwe/simp1
seaofgal/gal
sparse2/test
stack/miginv
steer/shot
steer/wz25
stoltst/elfst
stoltst/imps
super/tau
texture/fft
txamo/app
vc2/beivc
vc2/elfvc
vc2/sigvc
vc2/spec
velspec/sigvc
waverays/gauss
SLIM
geo2008NewInsightsPareto/pareto
slimUserManual/sfsort
slimUserManual/sfthr
SWAG
anisogath/synth
eikds/marm2
eikds/smvel
itime/oz2
itime/oz6
itime/syn
tau/arte
tau/hess
tau/iso
tau/lens
tau/linear
tau/marm
tau/vertical
waveds/fdmod
waveds/fdmodnoSS
waveds/svmod
TCCS
acrossfault/clyde
acrossfault/louis2d
acrossfault/synth
aii/heidrun
anisodiff/barrolka
anisodiff/pcable
anisodiff/simple
anisodiff/simple3d
apefint/alias
apefint/misscurv
apefint/missing
apefint/ray
apefint/sean
apwd/crnfld
apwd/trace
asa/dipping
asa/sigsep
asa/simple
asa/tracesep
atten/enerd
atten/karman1
atten/karmand
atten/pdepth
atten/qcurve
atten/spectra
attr/attr
attr/vecta
avo/avo
avo/stat
butterfly/field2
butterfly/synth2D-1-timer
butterfly/synth2D-2
butterfly/synth2D-3
butterfly/synth2D-4
crs/dome2
cs/coef
cs/sean
cs/synth
dbortho/hyper
dealiase/coef
dealiase/field
dealiase/linear
dealiase/synth
dealiase/synth30Hz
dealiase2/bei
dealiase2/hyper
dealiase2/hypern
deblend/fairfield-initmfnew
deblend/linear
deblend/synthcomplex
deblend/synthhyper
decomp/frenchtri
decomp/homoortho
decomp/homotri
demulemd/haskell
demulemd/mobil
demulemd/syn
diffr/chan3d
diffr/fault
diffr/gom
dipseis/sigmoid
dlaugment/exp
dlchan/label
dlchan/testing
dlchan/thin
drr5d/snrs_ratio
drr5d/synth
dsd/conflict
dsd/field1
dsd/field2
dsd/real
dsrtomo/accuracy
dsrtomo/hessian
dsrtomo/marm
dtwaniso/dtw-example
dtwaniso/synthetic-gather
eikods/check
eikods/marm
eikods/migration
elas/french-dc
elas/gradient
elas/homomono3d
elas/homotric3d-dc
elas/homotric3d
elas/twolayer3d
emdpf/synsig
enhemd/postack
enhemd/prestack
enhemd/sigmoid
eseis/demo2
eseis/demo4
eseis/field
eseis/nonseis
eseis/sparse
ffd/anisotropic
ffd/bptti
ffd/cos
ffd/ffd
flat/comaz
flat/flat
flat/flatelf
fpwd/const
fpwd/sigmoid
fpwd/teapot
fraclapl/diffq
fraclapl/twolayer
fwiseislet/blend
fwiseislet/encoding-spar
fwiseislet/encoding
fwiseislet/noise-spar
fwiseislet/noise
fwiseislet/timedomain
fwiseislet/wavelet
gmresq/bpgas
group/ell
group3/bptti
group3/tiltorthocompare
halfthr/hyper
halfthr/linear
halfthr/sean
hyper/amarm
hyper3/seam2
intshape/fsyn
intshape/sean
lfd/aniso
lfd/bptti
lfd/dispersion1
lfd/oned
lfd/twod
lowrank/aniso
lowrank/bptti
lowrank/fio
lowrank/impres
lowrank/threed
lpf/lpf
lpf/regr
ltft/groll
ltft/timefreq
ltft/vecta
medianfilter/window
merge/apache
merge/pcable
merge/pcable2
nar/chirp
nar/hou
nar/mirko
nar/trace
nar/vecta
nmo3/azimuthtest
nmo3/mcelroy
nmodeblend/bei
nmodeblend/class
nmodeblend/simple
nmodeblend/synth
nmodeblend/timespace
npm/hou
npm/mirko
npm/trace
npm/vecta-nar
npm/vecta-stlc
oc3/bei
oc3/fault
oc3/french
oc3/frenchint
onestep/abc
onestep/bptti
onestep/bptti2
onestep/bpttirtm
onestep/fio1d
onestep/fowler
onestep/grad
onestep/grad2
onestep/tiltorth
optapert/depthMig
optapert/gibson
optapert/rightSigsbee
optapert/sigsbee
optapert/theo
opwd/circle
opwd/freq
opwd/pick
opwd/wrap
ortho/orthocomplex
ortho/orthocsimul
ortho/orthofair
ortho/orthorna
orthogroll/field
orthorhombic/orth
orthorhombic/test
orthorhombic/tiltn
ovc/nankai
ovc/psovc
ovc/toy
pcastack/field
pcastack/synth
phase/boon
phase/boon3
phase/nonstat
phase/signal
phase/zero
pi/barrolka
pi/bei
pi/simple-model
pmig/mig
pmig/nmo
probdif/nankai
probdif/noisy-synthetic
probdif/synthetic
probdif/toy
psp/models
pwshape/parihaka
pwshape/qdome
pwshape/qdome3
reversible/delta
reversible/nscnmo
scan3/fourevents
scan3/noncwavg-1
scan3/realdata
seislet/diplet
seislet/lena
seislet/plane
seislet/seis
seislet/sin2
sgk/synth
sglowrank/avo
sglowrank/bp3
sglowrank/dispersion
sglowrank/mms1d-all-vv
sglowrank/mms1d-dt-vv
sglowrank/mms1d-dx-vv
sglowrank/mms1d-fre
sglowrank/oned
sglowrank/tlayer3
shape/beivc
shape/int1
shape/smoo
shemd/nonstat
simistack/bei
simistack/flat4
simistack/simple
sobel/pari
sobel/penobscot
sparse/sparse-experim-shaping
sparse/vg
specrecom/gulf
specrecom/ricker
specrecom/tf
sswtapp/boonsville
sswtapp/strata
stackadcig/flat
stackadcig/sigsbee
stackadcig/simple
strat/sigmoid1
strat/spec-decom
strat/three-d
strfilter/bei
strfilter/hongliu
strfilter/spray
svmf/bei
svmf/class
svmf/test
svmf/testnoise
svmf/timespatial
svscan/bei
svscan/beicmps
svscan/class
svscan/field
svscan/simple
svscan/synth
synth/ordexample20hz
synth/small-khuff
synwav/gch1
synwav/lowf
t2dweak/alaska
t2dweak/field
t2dweak/grad
t2dweak/slow
time2depth/masha2
time2depth2/beinew
time2depth2/hs2grad
time2depth2/synth
time2depth2/vgrad
timefreq/chev
timefreq/lowf
timefreq/syn
timelapse/duri
timelapse/long1
timelapse/timelapse
uncert/beivc
varipick/global-gom
varipick/horizon
varipick/newviking
vc3/fracs
vc3/threedim
vscan/bei
vscan/hw
vscan/synth
welllogs/logs
welllogs/synthetic-example
wetm/beivel
wetm/nankaizone
wetm/synthetic4
TONGJI
decoupledpropagation/bptti2007.smooth
decoupledpropagation/hessvti.2nd.decoupled
decoupledpropagation/twolayer2dti.2nd.coupled.0.5ms
decoupledpropagation/twolayer2dti.2nd.coupled.1.5ms.FD
decoupledpropagation/twolayer2dti.2nd.coupled.compare
decoupledpropagation/twolayer2dti.2nd.decoupled.1ms
lrmode/bptti2007.comparison
lrmode/bptti2007.smth
lrmode/bptti2007
lrmode/hessvti
lrmode/twolayer2dti
lrmode/twolayer3dtti
lrmode/twolayer3dvti
qpwave/bptti2007
qpwave/comparison.operators
qpwave/hessvti
qpwave/homovti.eta0.05
qpwave/homovti.eta0.5
qpwave/twolayer2dti
qswave/bptti2007
qswave/homovti.eta0.05
qswave/homovti.eta0.5
qswave/twolayer3dvti
TRIP
asg/project
hpcss/test1
hpcss/test2
hpcss/test3
hpcss/test4
hpcss/test5
pscons/project
struct/project
TUTORIAL
authors/data
UH
avostack/cmp1
avostack/cmp2
avostack/stack
avostack/synh
avostack/synl
UWA
geo2013ElasticModellingGPU/bp2d
geo2013ElasticModellingGPU/homo3d
geo2013ElasticModellingGPU/homog2d
geo2013ElasticModellingGPU/hti3d
geo2013ElasticModellingGPU/test2d
geo2013ElasticModellingGPU/test3d
XJTU
fraclap/ps2d
gpufwi/fbrec
gpufwi/speedup
gpurtm/marmousi
mcaseislet/sep2
modeling2fwi/fbrec2d
modeling2fwi/modeling2d
primer/marmousi
primer/modeling2d
primer/rtmadcig
primer/testaniso
primer/testeb
primer/testelastic2d
primer/testfd2d
primer/testfd3d
primer/testspml
test/checkptdemo
test/dlct
test/excitationic
test/fpocs2d
test/fpocs3d
test/gpufd3d
test/lsinterp2d
test/marmousi
test/mpifwi
test/mwni2d
test/pocs5d
test/rtmodcig
test/rtmva2d
test/sigsbee
test/viscoa2d
test/viscoe2d
ZJU
diffrlrra/fault
diffrlrra/nankai_new
diffrlrra/synth
dtv/marm
odrr3d/hyp3d
odrr3d/hyp3d_N20
odrr5d/snrs_ratio
odrr5d/synth
odrr5d/synth2
optnoise/postack
optnoise/prestack
q/field
q/simple
q/var
sosvmf/hyper