Esempio n. 1
0
    def write_header(self, fre, fim):
        self.outputre = rsf.Output(fre)
        self.outputim = rsf.Output(fim)
        self.outputre.put('n1', self.rcvs.n)
        self.outputre.put('n2', self.srcs.n)
        self.outputre.put('n3', self.freqs.n)
        self.outputre.put('d1', self.rcvs.d)
        self.outputre.put('d2', self.srcs.d)

        if self.freqs.n > 1:
            self.outputre.put('d3', (self.freqs.d[1] - self.freqs.d[0]))
            self.outputim.put('d3', (self.freqs.d[1] - self.freqs.d[0]))
        else:
            self.outputre.put('d3', self.freqs.d[0])
            self.outputim.put('d3', self.freqs.d[0])

        self.outputre.put('o1', self.rcvs.o)
        self.outputre.put('o2', self.srcs.o)
        self.outputre.put('o3', self.freqs.d[0])
        self.outputim.put('n1', self.rcvs.n)
        self.outputim.put('n2', self.srcs.n)
        #self.outputim.put('n3',self.freqs.n)
        self.outputim.put('d1', self.rcvs.d)
        self.outputim.put('d2', self.srcs.d)
        self.outputim.put('d3', self.freqs.d)
        self.outputim.put('o1', self.rcvs.o)
        self.outputim.put('o2', self.srcs.o)
        self.outputim.put('o3', self.freqs.d[0])
Esempio n. 2
0
 def write(self, output=None, f=None):
     #print('hehe')
     if output is None:
         output = rsf.Output(f)
     #print('hehe 2')
     self.write_header(output)
     #print('hehe 3')
     output.write(np.float32(self.d))
     output.close()
Esempio n. 3
0
 def write(self, output=None, f=None):
     if output is None:
         output = rsf.Output(f)
     output.put('n1', self.nt)
     output.put('n2', self.nrcv)
     output.put('n3', self.nsrc)
     output.put('d1', self.dt)
     output.put('d2', self.drcv)
     output.put('d3', self.dsrc)
     output.put('o1', self.ot)
     output.put('o2', self.orcv)
     output.put('o3', self.osrc)
     output.write(np.float32(self.d))
     output.close()
Esempio n. 4
0
File: rdata.py Progetto: rienkt/rnpy
 def write_header(self,fre):
   self.output=rsf.Output(fre)
   self.output.put('n1',self.nrcv)
   self.output.put('n2',self.nsrc)
   self.output.put('n3',self.nfreq)
   self.output.put('n4',self.niter)
   self.output.put('d1',self.drcv)
   self.output.put('d2',self.dsrc)
   self.output.put('d3',self.dfreq)
   self.output.put('d4',self.diter)
   self.output.put('o1',self.orcv)
   self.output.put('o2',self.osrc)
   self.output.put('o3',self.ofreq)
   self.output.put('o4',self.diter)
Esempio n. 5
0
File: mctd.py Progetto: rienkt/rnpy
 def write_header(self, output=None, f=None):
     if output is None:
         output = rsf.Output(f)
     output.put('n1', self.nrcv)
     output.put('n2', self.nc)
     output.put('n3', self.nt)
     output.put('n4', self.nsrc)
     output.put('d1', self.drcv)
     output.put('d2', self.dc)
     output.put('d3', self.dt)
     output.put('d4', self.dsrc)
     output.put('o1', self.orcv)
     output.put('o2', self.oc)
     output.put('o3', self.ot)
     output.put('o4', self.osrc)
Esempio n. 6
0
    def write(self, output=None, f=None):
        #print('w1', f)
        if output is None:
            output = rsf.Output(f)

        #print('w2')
        output.put('n1', self.n1)
        output.put('n2', self.n2)
        output.put('n3', self.n3)
        output.put('d1', self.d1)
        output.put('d2', self.d2)
        output.put('d3', self.d3)
        output.put('o1', self.o1)
        output.put('o2', self.o2)
        output.put('o3', self.o3)
        #print('w3')
        output.write(self.d.astype(np.float32))
        output.close()
Esempio n. 7
0
File: mctd.py Progetto: rienkt/rnpy
 def write_rsf(self, foutput):
     try:
         output = rsf.Output(foutput)
     except:
         output = foutput
     output.put('n1', self.nt)
     output.put('n2', self.nc)
     output.put('n3', self.nrcv)
     output.put('n4', self.nsrc)
     output.put('d1', self.dt)
     output.put('d2', self.dc)
     output.put('d3', self.drcv)
     output.put('d4', self.dsrc)
     output.put('o1', self.ot)
     output.put('o2', self.oc)
     output.put('o3', self.orcv)
     output.put('o4', self.osrc)
     output.write(np.float32(self.d))
     output.close()
Esempio n. 8
0
lt = Fopr.string("label1")
ut = Fopr.string("unit1")

nn = Fopr.size(1)*Fopr.size(2)*Fopr.size(3) # number of traces

opr = np.zeros(nt,'f') # allocate opr array

# ------------------------------------------------------------
# setup output 
if adj==1:
    Fcor = rsf.Input()         # input cor

    nc = Fcor.int("n1")
    ncor = (nc-1)/2

    Fwfl = rsf.Output()        # output wfl
    Fwfl.put("n1",nt)
    Fwfl.put("o1",ot)
    Fwfl.put('d1',dt)
    Fwfl.put('label1',lt)
    Fwfl.put('unit1',ut)
    
else:
    Fwfl = rsf.Input()         #  input wfl

    ncor = par.int("ncor",100)
    nc=2*ncor+1 # number of correlation lags 
    
    Fcor = rsf.Output()        # output cor
    Fcor.put("n1",2*ncor+1)
    Fcor.put("o1", -ncor*dt)
Esempio n. 9
0
oz = par.float("oz")
dz = par.float("dz")

vel = par.float("vel", 1.0)
cx = par.float("cx", 1.0)
cy = par.float("cy", 1.0)
cz = par.float("cz", 1.0)

if verb:
    print >> sys.stderr, 't', nt, ot, dt, vel
    print >> sys.stderr, 'x', nx, ox, dx, cx
    print >> sys.stderr, 'y', ny, oy, dy, cy
    print >> sys.stderr, 'z', nz, oz, dz, cz

# ------------------------------------------------------------
Fdat = rsf.Output()
Fdat.put("n1", nt)
Fdat.put("o1", ot)
Fdat.put('d1', dt)
Fdat.put("n2", nx)
Fdat.put("o2", ox)
Fdat.put('d2', dx)
Fdat.put("n3", ny)
Fdat.put("o3", oy)
Fdat.put('d3', dy)
Fdat.put("n4", nz)
Fdat.put("o4", oz)
Fdat.put('d4', dz)

dat = np.zeros(nt, 'f')
Esempio n. 10
0
try:
    import rsf.api as rsf
    import numpy
    import scipy
except Exception, e:
    print \
'''ERROR: NEED PYTHON API, NUMPY, SCIPY '''
    sys.exit(1)

# Initialize RSF command line parser
par = rsf.Par()
# Read command line variables

# Declare input and outputs
fin = rsf.Input()  # no argument means stdin
fout = rsf.Output()  # no argument means stdout

# Declare optional inputs/outputs
vectors = par.bool("vectors", False)  # Output singular vectors?
if vectors:
    left = par.string("left")  # File to store left singular vectors
    if not left:
        sys.stderr.write('Need left=\n')
        sys.exit(2)
    right = par.string("right")  # File to store right singular vectors
    if not right:
        sys.stderr.write('Need right=\n')
        sys.exit(2)
    lout = rsf.Output(left)  # left singular vectors
    rout = rsf.Output(right)  # right singular vectors
Esempio n. 11
0
def dip_lop(n1, n2, p0, c, iter, eta):
	p=p0
	for it in range(iter):
		for i2 in range(n2):
			for i1 in range(n1):
				rr=polyval(c[:,i2,i1],p[i2,i1])
				dd=polyval(polyder(c[:,i2,i1]),p[i2,i1])
				na=(rr*rr+dd*dd)*eta*sign(dd)
#				na=(abs(rr)+abs(dd))*eta*sign(dd)
				dp=rr/(dd+na)
				p[i2,i1]=p[i2,i1]-0.5*dp
	return p

par=rsf.Par()
input=rsf.Input()
dip=rsf.Output()
coef=rsf.Output("coef")
pf=rsf.Output("pf")

nf=par.int("nf",1)
iter=par.int("iter",5)
eta=par.float("eta",0.05)
n1=input.int("n1")
n2=input.int("n2")

n3=2*nf+1
pf.put("n3",2*nf+1)
dip.put("n3",2*nf)
dip.put("n2",n2-1)
coef.put("n3",n3)
coef.put("n2",n2-1)
Esempio n. 12
0
ldepth = log1a.int("n1")
dlt = logrefa.float("d1")

olt = logrefa.float("o1")

logref = np.zeros(sdepth, 'f')
log1 = np.zeros(ldepth, 'f')

logrefa.read(logref)
log1a.read(log1)

minsamp = 0

maxs = sdepth - 1

if (logref[0] == 0):
    for i in range(maxs):
        if ((logref[i] != 0) & (logref[i + 1] != 0)):
            break
        if ((logref[i] == 0) & (logref[i + 1] != 0)):
            minsamp = i + 1
            break

log1_co = rsf.Output()

if (minsamp != 0):
    log1_co.put('o1', minsamp * dlt + olt)

log1_co.put('n1', ldepth)
log1_co.write(np.array(log1))
Esempio n. 13
0
import numpy as np
import rsf.api as rsf
import string
import math as mt

par = rsf.Par()
loga = rsf.Input()  # Input 1D dataset

assert 'float' == loga.type
sdepth = loga.int("n1")

log = np.zeros(sdepth, 'f')
loga.read(log)

loc = par.int("loc")  # Location of value used to replace
assert loc
num = par.int("num")  # Number of values to replace at beginning of dataset
assert num

log_eo = rsf.Output()  # Output 1D dataset

log_e = np.empty(sdepth)

for i in range(sdepth):
    if (i < num):
        log_e[i] = log[loc]
    else:
        log_e[i] = log[i]

log_eo.write(np.array(log_e))
Esempio n. 14
0
##   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

from __future__ import print_function
import sys
try:
    from numpy import *
    import rsf.api as rsf
except Exception as e:
    print('ERROR : need numpy')
    sys.exit(1)

par = rsf.Par()
pi = rsf.Input()
pi2 = rsf.Input("pi2")

po = rsf.Output()
po2 = rsf.Output("po2")

nn = pi.shape()
nd = len(nn)

axis = par.int("axis", 2)
if axis > nd:
    sys.stderr.write('axis=%d greater than nd=%d' % (axis, nd))
#n2=nn[-axis]
seed = par.int("seed")
#inv=par.bool("inv", False)

n1 = pi.int("n1")
n2 = pi.int("n2")
#n3 = pi.int("n3")
Esempio n. 15
0
logref_c = np.zeros(maxsamp - minsamp + 1)
depth_c = np.zeros(maxsamp - minsamp + 1)
log1_c = np.zeros(maxsamp - minsamp + 1)
log2_c = np.zeros(maxsamp - minsamp + 1)
log3_c = np.zeros(maxsamp - minsamp + 1)
log4_c = np.zeros(maxsamp - minsamp + 1)

for i in range(maxsamp - minsamp + 1):
    logref_c[i] = logref[minsamp + i]
    depth_c[i] = depth[minsamp + i]
    log1_c[i] = log1[minsamp + i]
    log2_c[i] = log2[minsamp + i]
    log3_c[i] = log3[minsamp + i]
    log4_c[i] = log4[minsamp + i]

logref_co = rsf.Output()  # Output reference well log
depth_co = rsf.Output('depth_c')  # Output depth information
log1_co = rsf.Output('log1_c')  # Output clipped well log 1
log2_co = rsf.Output('log2_c')  # Output clipped well log 2
log3_co = rsf.Output('log3_c')  # Output clipped well log 3
log4_co = rsf.Output('log4_c')  # Output clipped well log 4

logref_co.put('n1', maxsamp - minsamp + 1)
depth_co.put('n1', maxsamp - minsamp + 1)
log1_co.put('n1', maxsamp - minsamp + 1)
log2_co.put('n1', maxsamp - minsamp + 1)
log3_co.put('n1', maxsamp - minsamp + 1)
log4_co.put('n1', maxsamp - minsamp + 1)

logref_co.write(np.array(logref_c))
depth_co.write(np.array(depth_c))
Esempio n. 16
0
if not da == db:
  print('input files must have the same sampling interval', file=sys.stderr)
  sys.exit(1)
  
# ------------------------------------------------------------

# command line params
norm = par.bool("norm",False) # normalize output
nc = par.int("nc",100)    # number of correlation lags 
if nc > na or nc > nb: nc = min(na-1,nb-1) 

# ------------------------------------------------------------
  
# output file
Fc = rsf.Output()
Fc.put("n1", nc*2+1)
Fc.put("o1",-nc*da)
Fc.put('d1',    da)

# ------------------------------------------------------------

# center sample of the correlation
center = (na+nb-1)/2 - (na-nb)*0.5
l1 = center-nc
l2 = center+nc+1

# ------------------------------------------------------------

n2 = Fa.size(1) # number of traces of input file
for i2 in range(n2):
Esempio n. 17
0
import numpy as np
import rsf.api as rsf
import string
import math as mt

par = rsf.Par()
loga = rsf.Input()  # Input well log

assert 'float' == loga.type
sdepth = loga.int("n1")
olog = loga.float("o1")

log = np.zeros(sdepth, 'f')
loga.read(log)

log_eo = rsf.Output()  # Output well log

switch = par.int(
    "switch"
)  # (0 = Two-sided axis extension by first and last non-zero sample in dataset); (2 = Two-sided axis reduction); (3 = Matches starting value and number of samples between input and reference well log); (else = pad data to dataset size by first and last nonzero sample); (4 = Testing)

if ((switch == 0) | (switch == 2) | (switch == 4)):
    num = par.int("val")  # Sample manipulation (switch=0/2)
    assert num

if (switch == 3):
    reflog = par.string('reflog')  # Reference log (switch=3)
    refa = rsf.Input(reflog)
    assert 'float' == refa.type
    oref = refa.float("o1")
    nref = refa.int("n1")
Esempio n. 18
0
#  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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

import rsf.api as sf
import numpy as np

try:  # Give precedence to local version
    from hegilles import jitter
except:  # Use distributed version
    from rsf.user.hegilles import jitter

par = sf.Par()

input = sf.Input()
output = sf.Output()

n1 = input.int("n1")
n2 = input.int("n2")
ni = input.size(2)
assert ni == 1, "sfjitter needs 2D input"

perc = par.float("perc", .75)  # percentage of traces to remove
assert (perc > 0 and perc < 1), "perc should be between 0 and 1"

jit = par.float("jit", 1 / (1 - perc))  # maximum gap factor

seed = par.int("seed", np.random.randn())  # seed for random number generator

output.put("n1", n2)
output.put("n2", 1)
Esempio n. 19
0
        "W2": 0.1 * randn(units),
        "b2": np.zeros(shape=1)
    }
    return params


# Get input parameters and 'source' files. These are RSF objects that works as
# pointers to the actual data/file.
par_obj = rsf.Par()
x_train_obj = rsf.Input() # first input as default
y_train_obj = rsf.Input('ytrain')
x_val_obj = rsf.Input('xval')
y_val_obj = rsf.Input('yval')

# Assign output 'target' files.
loss_train_obj = rsf.Output() # first output as default
loss_val_obj = rsf.Output('lossval')

# Parse parameter values from input object.
num_epochs = par_obj.int('nepochs')
learning_rate = par_obj.float('lr')
hidden_units = par_obj.int('hidden') # number of hidden units

# Get size of the input arrays and load them. (Initialize + Read)
# Initialize numpy arrays for training data.
n1 = x_train_obj.int('n1') # for x_train, n1==data sample length
n2 = x_train_obj.int('n2') # for x_train, n2==number of features
x_train = np.zeros((n2,n1), np.single) # shape==(nfeature x ndata)
y_train = np.zeros((1,n1), np.single) # shape==(1 x ndata)
# Similar for val data.
n1 = x_val_obj.int('n1')
Esempio n. 20
0
u3 = zeros((n2, n3), 'f')
wt1.read(u3)
u3 = numpy.transpose(u3, (1, 0))
u3.astype('float64')
u4 = zeros((n3), 'f')
bs1.read(u4)
u4.astype('float64')

u5 = zeros((n3), 'f')
wt2.read(u5)
u5.astype('float64')
u6 = zeros((1), 'f')
bs2.read(u6)
u6.astype('float64')

loss = rsf.Output()
wt1out = rsf.Output("weight1out")
wt2out = rsf.Output("weight2out")
bs1out = rsf.Output("bias1out")
bs2out = rsf.Output("bias2out")
valloss = rsf.Output("valloss")

data = list(zip(u1, u2))
data_val = list(zip(u1val, u2val))

loss_history, loss_val_history = [], []

vw1 = numpy.zeros_like(u3)
vb1 = numpy.zeros_like(u4)
vw2 = numpy.zeros_like(u5)
vb2 = numpy.zeros_like(u6)
Esempio n. 21
0
from __future__ import print_function
import rsf.api as rsf
import numpy as np
import sys

par = rsf.Par()

verb = par.bool('verb', False)  # verbosity flag

Fin = rsf.Input()  # input file
n1 = Fin.int("n1")
nn = Fin.size(1)
# number of traces
din = np.zeros(n1, 'f')

Fou = rsf.Output()  # output file
Fou.put("n1", 1)
Fou.put("o1", 0)
Fou.put('d1', 1)
Fou.put("n2", 1)
Fou.put("n3", 1)
Fou.put("n4", 1)

dou = np.zeros(1, 'f')

mymax = 0
for i in range(nn):
    Fin.read(din)

    for i1 in range(n1):
        if abs(din[i1]) > abs(mymax):
Esempio n. 22
0
Fwfl.read(wfl)              #     read wfl array

# ------------------------------------------------------------

ntlag = par.int("ntlag",100)
nxlag = par.int("nxlag",0)
nylag = par.int("nylag",0)
nzlag = par.int("nzlag",0)

nct=2*ntlag+1; oct=-ntlag*dt; dct=dt
ncx=2*nxlag+1; ocx=-nxlag*dx; dcx=dx
ncy=2*nylag+1; ocy=-nylag*dy; dcy=dy
ncz=2*nzlag+1; ocz=-nzlag*dx; dcz=dz

# ------------------------------------------------------------
Fcor = rsf.Output()        # output oriented cor

Fcor.put("n1",nct); Fcor.put("o1",oct); Fcor.put('d1',dct)
Fcor.put("n2",ncx); Fcor.put("o2",ocx); Fcor.put('d2',dcx)
Fcor.put("n3",ncy); Fcor.put("o3",ocy); Fcor.put('d3',dcy)    
Fcor.put("n4",ncz); Fcor.put("o4",ocz); Fcor.put('d4',dcz)    

cor = np.zeros(2*nt-1,'f')
       
# ------------------------------------------------------------

for icz in range(-nzlag,+nzlag+1): 
    for icy in range(-nylag,+nylag+1):
        for icx in range(-nxlag,+nxlag+1):
        
            cor = np.correlate(wfl[izmid-icz,iymid-icy,izmid-icz,:],
Esempio n. 23
0
par = rsf.Par()
logrefa = rsf.Input()  # Input 1D data

assert 'float' == logrefa.type

sdepth = logrefa.int("n1")
sd = logrefa.float("d1")
so = logrefa.float("o1")

logref = np.zeros(sdepth, 'f')
logrefa.read(logref)

num = par.float("value")  # Location of hard constraint

window = par.int("wind")  # Number of samples of hard constraint
assert window

out = np.zeros(sdepth)

loc = (num - so) / sd

if ((loc < sdepth - window) & (loc > (window - 1))):
    for i in range(window):
        out[loc - i] = 1
        out[loc + i] = 1

logref_co = rsf.Output()

logref_co.write(np.array(out))
# Output 1D data
Esempio n. 24
0
logrefa = rsf.Input()  # Input 1D dataset

assert 'float' == logrefa.type
sdepth = logrefa.int("n1")

logref = np.zeros(sdepth, 'f')
logrefa.read(logref)

min = 0
max = 0

out = np.zeros(sdepth)
for i in range(sdepth):
    out[i] = logref[i]

for i in range(sdepth):
    if (out[i] == 0):
        min = i - 1
        for j in range(sdepth - 1 - i):
            if (logref[i + j] != 0):
                max = i + j
                break
        for k in range(max - min):
            out[min + k] = logref[min] + (logref[max] -
                                          logref[min]) * k / (max - min)

logref_co = rsf.Output()  # Output 1D dataset

logref_co.write(np.array(out))
Esempio n. 25
0
##   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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

try:
    from numpy import *
    import rsf.api as rsf
except Exception, e:
    import sys
    print('ERROR : need numpy')
    sys.exit(1)

par = rsf.Par()
output = rsf.Output()

n1 = par.int("n1", 500)
o1 = par.float("o1", -250)
d1 = par.float("d1", 1)
n2 = par.int("n2", 500)
o2 = par.float("o2", -250)
d2 = par.float("d2", 1)
f = par.float("f", 0.05)
# frequency (circles per sampling interval)
df = par.float("df", 0.0)
# chirp frequceny shift
a = par.float("a", 0.0)
# amplitude attenuation

output.put("n1", n1)
Esempio n. 26
0
#!/usr/bin/env python2
# coding:utf-8
"""
Generate a spike file
according backgroud density/velocity model
"""

import numpy as np
import rsf.api as rsf

par = rsf.Par()

inp = rsf.Input()  # backgroud density/velocity model
spk = rsf.Input("spk")  # coordinates of spikes
out = rsf.Output()  # Output spikes model

assert inp.type == 'float', "Need float input!"

n1 = inp.int("n1")
n2 = inp.size(1)

delta = par.float("delta")  # perturbation of backgroud
assert delta, "Need delta="

den = np.zeros((n2, n1), dtype=np.float32)
inp.read(den)  # read in backgroud density file

spikes = np.zeros_like(den)

spk.read(spikes)
Esempio n. 27
0
try:
    import numpy as np
except Exception, e:
    print 'ERROR : need numpy'
    sys.exit(1)

try:
    from pylab import *
    from matplotlib.colors import LogNorm
except Exception, e:
    print 'ERROR : need numpy'
    sys.exit(1)

pi = rsf.Input()
po = rsf.Output()
par = rsf.Par()

dim = pi.shape()

n1 = pi.int("n1")
o1 = pi.float("o1")
d1 = pi.float("d1")
n2 = pi.int("n2")
o2 = pi.float("o2")
d2 = pi.float("d2")

# x label
label1 = par.string("label1")
if label1 == None:
    label1 = pi.string("label1")
Esempio n. 28
0
 def write(self, output=None, f=None):
     if output is None:
         output = rsf.Output(f)
     self.write_header(output)
     output.write(np.float32(self.d))
     output.close()
Esempio n. 29
0
import math as mt

# Inputs
par = rsf.Par()
slowness_name = par.string('slowness') # Slowness from Logs
rhob_name = par.string('density') # Density from Logs

depth = rsf.Input() # Depth from Logs
slow = rsf.Input(slowness_name)
rhob = rsf.Input(rhob_name)

ratio = par.float("ratio") # Percent of dom wavelength
peak_f = par.float("peak_f") # Dom wavelength
depthsample = par.float("depthsample") # Depth Sampling

depth_bkn = rsf.Output() # Output depth sampling
vel_bkn = rsf.Output('vel_bk') # Backus Avg. velocity
slow_bkn = rsf.Output('slow_bk') # Backus Avg. slowness
rhob_bkn = rsf.Output('rhob_bk') # Averaged density

assert 'float' == depth.type
assert 'float' == slow.type
assert 'float' == rhob.type

sdepth = depth.int("n1")
sslow = slow.int("n1")
srhob = rhob.int("n1")

assert sdepth == sslow
assert sdepth == srhob
assert sslow == srhob
Esempio n. 30
0
File: Mmqrbf.py Progetto: ymustc/src
import numpy as np
import rsf.api as rsf
import string
import math as mt

# Inputs
par = rsf.Par()
cubea = rsf.Input()  # Seismic Cube (Used for size of output)

assert 'float' == cubea.type

t_dim = cubea.int("n1")
xl_dim = cubea.int("n2")
il_dim = cubea.int("n3")

rbf_out = rsf.Output()  # Output RBF cube

cube = cubea.read()

xl_pos = par.int("xl")  # n2 location of source
il_pos = par.int("il")  # n3 location of source
eps = par.float("eps")  # Scalar factor

bound = par.int("boundary")  # Scalar factor
if (bound == 1):
    otherdata = par.string('other')  # Boundary map
    othera = rsf.Input(otherdata)
    assert 'float' == othera.type

    other = othera.read()