You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to convert amoco velocity model to numpy array but I am getting error :
Traceback (most recent call last):
File "model.py", line 4, in
inp = m8r.Input("vel.rsf")
File "/home/atom/rsf2.0/lib/python2.7/dist-packages/m8r.py", line 715, in init
self.__create_variable_dictionary(self.header)
File "/home/atom/rsf2.0/lib/python2.7/dist-packages/m8r.py", line 791, in __create_variable_dictionary
if rhs[0] in (squot, dquot):
IndexError: string index out of range
when I am running the following code
import m8r
import numpy as np
import matplotlib.pyplot as plt
inp = m8r.Input("vel.rsf")
n1 = inp.int("n1")
n2 = inp.int("n2")
data =inp.read(shape=(n2,n1))
data = data.transpose() # Example of numpy in action
print("SHAPE OF ARRAY : ", data.shape)
print("MAX VEL : ", np.max(data))
print("MIN VEL : ", np.min(data))
#print("UNIQUE VELS : ", np.unique(data))
np.save('pvel.npy', data)
plt.imshow(data)
plt.show()
@zhichenggeng I updated m8r.py as you have mentioned but now I am geeting this error :
Traceback (most recent call last):
File "model.py", line 4, in
inp = m8r.Input("/home/atom/work/github/mdg/madagascar/2D_modeling/amoco/vel.rsf")
File "/home/atom/rsf2.0/lib/python2.7/dist-packages/m8r.py", line 720, in init
self.f = open(self.filename,'r')
FileNotFoundError: [Errno 2] No such file or directory: '"/var/tmp/madagascar/2D_modeling/amoco/vel.rsf@"'
I am trying to convert amoco velocity model to numpy array but I am getting error :
when I am running the following code
Here is my code for the SConstruct file
The text was updated successfully, but these errors were encountered: