Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python API, 'xdr_float' file reading problem. SWIG problem? #173

Open
pplotn opened this issue Dec 11, 2019 · 1 comment
Open

Python API, 'xdr_float' file reading problem. SWIG problem? #173

pplotn opened this issue Dec 11, 2019 · 1 comment

Comments

@pplotn
Copy link

pplotn commented Dec 11, 2019

Hello, all.
I have problems reading marmousi model:
File "/home/plotnips/Madagascar/lib/python2.7/dist-packages/m8r.py", line 765, in init
sys.stderr.write('filename=%s.\n',self.filename)
TypeError: write() takes exactly one argument (2 given)

I think this is related to swig installation or Python2/Python3 compatibility. Can you help with this problem? Or maybe there are some related issues, but I have not found anyone.
I installed swig of version 3.0.12. It was detected in config.py file:
SWIG = u'/usr/bin/swig'

marmvel.hh:
in="stdin"
esize=4 type=float form=xdr
n1=751 d1=4 o1=0 label1="meters"
n2=2301 d2=4 o2=0 label2="meters"
n3=1 d3=1 o3=0 label3=""
n4=1 d4=1 o4=0 label4=""
1728051 elements 6912204 bytes

CODE:
import numpy
import m8r as sf
model_input="marmvel.hh"
model_orig = sf.Input(model_input)
vel = model_orig.read()

/home/plotnips/anaconda3/envs/tensorflow_env/bin/python /home/plotnips/Dropbox/Log_extrapolation/scripts/deeplogs-master/data/test2.py
error reading from input file.
data_format=xdr_float
error reading from input file.
data_format is not defined
Traceback (most recent call last):
File "/home/plotnips/Madagascar/lib/python2.7/dist-packages/m8r.py", line 757, in init
sys.stderr.write('filename=%s.\n',self.filename)
TypeError: write() takes exactly one argument (2 given)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/plotnips/Dropbox/Log_extrapolation/scripts/deeplogs-master/data/test2.py", line 4, in
model_orig = sf.Input(model_input)
File "/home/plotnips/Madagascar/lib/python2.7/dist-packages/m8r.py", line 765, in init
sys.stderr.write('filename=%s.\n',self.filename)
TypeError: write() takes exactly one argument (2 given)

Process finished with exit code 1

@pplotn
Copy link
Author

pplotn commented Dec 11, 2019

I get also error below. Can somebody explain how fix issue below?
https://sourceforge.net/p/rsf/mailman/message/29512163/

libdrsf.so: cannot open shared object file: No such file or directory
On , Sergey Fomel <sergey.fomel@...> wrote:

Junwei,
It looks like Python cannot find the blas library. You may want to check
the LD_LIBRARY_PATH environmental variable and to set it to include the
path to libblas.
Junwei,

It looks like Python cannot find the blas library. You may want to check
the LD_LIBRARY_PATH environmental variable and to set it to include the
path to libblas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant