sfmath (2.0-git) 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 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 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 hw2/sorting hw3/compress hw3/pocs hw4/invint hw4/rotate 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 riesz/linefit 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/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 scons/rsf scons/rsfpy su/rsfdecon su/rsfdipfilt su/rsfkfupm su/rsflab10 su/rsflab15 su/rsflab16 su/rsflab5 su/rsflab8 su/rsfreadwrite su/rsfscales su/rsfsmooth3d 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/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 aii/heidrun amf/misfitexample 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 emdpf/synsig ffd/anisotropic ffd/bptti ffd/cos ffd/ffd flat/comaz flat/flat flat/flatelf fpwd/const fpwd/sigmoid fpwd/teapot fraclapl/diffq fraclapl/marmq fraclapl/twolayer gmresq/bpgas gmresq/exploding group/ell group3/bptti group3/tiltorthocompare 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 nar/chirp nar/hou nar/mirko nar/trace nar/vecta nmo3/azimuthtest nmo3/mcelroy nmodeblend/bei nmodeblend/class nmodeblend/simple nmodeblend/synth nmodeblend/timespace 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 phase/boon phase/boon3 phase/nonstat phase/signal phase/zero pi/barrolka pi/bei pi/simple-model pmig/mig pmig/nmo psp/models reversible/delta reversible/nscnmo scan3/fourevents scan3/noncwavg-1 scan3/realdata seislet/diplet seislet/lena seislet/plane seislet/seis seislet/sin2 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 specrecom/gulf specrecom/ricker specrecom/tf 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 synth/ordexample20hz synth/small-khuff synwav/gch1 synwav/lowf time2depth/masha2 time2depth2/beinew time2depth2/hs2grad time2depth2/synth time2depth2/vgrad timefreq/chev timefreq/lowf timefreq/syn timelapse/duri timelapse/long1 timelapse/timelapse uncert/beivc vc3/fracs vc3/threedim vscan/bei vscan/hw vscan/synth

 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 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/mwni2d test/pocs5d test/rtmodcig test/rtmva2d test/sigsbee test/viscoa2d test/viscoe2d