sfmath (3.0) indexsystem/main/math.cDocumentation
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=

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/tti3 geo2009TTIModeSeparation/vti3 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 freeusp/land marmousi/fdmod marmousi2/fdMod marmousi2mp/modelproc nankai/data nankai/shots pluto/fdmod seam-phase1-2d/cvs segsalt/data sigsbee/data2A sigsbee/fdmod2A sigsbee/fs2B sigsbee/nfs2B sigsbee/ptest sigsbee/pwemig sigsbee/wemig teapotdome/scdecon teapotdome/vels teapotdome/zomig

 EEG marchenko/example

 GALLERY bp/lowrank 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 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

 GEO384W hw1/code hw1/wave hw2/cmp hw2/eikonal hw3/synth hw4/sigsbee hw4/synth hw5/hyper hw5/lsmig hw5/sigsbee 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 gvdseisint/bei gvdseisint/ocmodel gvdseisint/vti riesz/linefit txsopf/curvedmodel txsopf/data2 txsopf/model txyapf/curve vdseislet/demultiple vdseislet/haskell vdseislet/nmo

 M8R format/format 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 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/nmo tutorials/parameters tutorials/semblance tutorials/slicing tutorials/spitz tutorials/survey tutorials/talitrus 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 apefint/alias apefint/misscurv apefint/missing apefint/ray apefint/sean 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 dbortho/hyper deblend/fairfield-initmfnew deblend/linear deblend/synthcomplex deblend/synthhyper decomp/frenchtri decomp/homoortho decomp/homotri diffr/chan3d diffr/fault diffr/gom dsd/conflict dsd/field1 dsd/field2 dsd/real dsrtomo/accuracy dsrtomo/hessian dsrtomo/marm eikods/check eikods/marm eikods/migration elas/french-dc elas/gradient elas/homomono3d elas/homotric3d-dc elas/homotric3d elas/twolayer3d emdpf/synsig 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