next up previous [pdf]

Next: sfreverse: Reverse one or Up: Main programs Previous: sfput: Input parameters into

sfreal: Extract real (sfreal) or imaginary (sfimag) part of a complex dataset.

sfreal < cmplx.rsf > real.rsf

sfreal extracts the real part of a complex type dataset. The imaginary part can be extracted with sfimag, an the real and imaginary part can be combined together with sfcmplx.

Here is a simple example. Let us first create a complex dataset with sfmath

bash$ sfmath n1=10 type=complex output="(2+I)*x1" > cmplx.rsf
bash$ fdisfil < cmplx.rsf
   0:          0,         0i         2,         1i         4,         2i
   3:          6,         3i         8,         4i        10,         5i
   6:         12,         6i        14,         7i        16,         8i
   9:         18,         9i
Extracting the real part with sfreal:
bash$ sfreal < cmplx.rsf | sfdisfil
   0:             0            2            4            6            8
   5:            10           12           14           16           18
Extracting the imaginary part with sfimag:
bash$ sfimag < cmplx.rsf | sfdisfil
   0:             0            1            2            3            4
   5:             5            6            7            8            9


next up previous [pdf]

Next: sfreverse: Reverse one or Up: Main programs Previous: sfput: Input parameters into

2012-07-19