Closed BosungLim closed 5 years ago
how did you install devito ?
how did you install devito ?
As the instruction says, I did conda+pip and just pip, but not docker yet.
have you installed all dependencies with pip install -e .
and activated the environment with source activate devito
?
have you installed all dependencies with
pip install -e .
and activated the environment withsource activate devito
?
Yep!
can you paste the piece of code you're trying to run, please
can you paste the piece of code you're trying to run, please
I was wondering if it can generate data with and without multiples by putting air layers on top if absorbing BC is applied all 4 boundaries. To do so, I have modified example code as following:
import numpy as np import matplotlib.pyplot as plt import skimage.transform as trans from scipy.misc import imresize from scipy import signal from devito import TimeFunction from devito import Eq, solve from devito import Operator from examples.seismic import Model, plot_velocity from examples.seismic import Receiver from examples.seismic import RickerSource from examples.seismic import TimeAxis from examples.seismic import plot_shotrecord
##############################################
##############################################
Vel = np.load('/home/bslim/Documents/Machine_Learning_BSLim/UNet/2D_Modeling/Marmousi2_Vp.npy')/1000 Vp = np.zeros((int(len(Vel[:, 0])/10), int(len(Vel[0, :])/10)), dtype=float) shape = np.shape(Vp)
model_resample = 10 for i in range(0, shape[0]): for j in range(0, shape[1]): Vp[i, j] = Vel[imodel_resample, jmodel_resample]
Vp[:, :2] = 0.35
grid_size = 5. spacing = (grid_size, grid_size) origin = (0., 0.)
model = Model(vp=Vp, origin=origin, shape=shape, spacing=spacing, space_order=2, nbpml=10)
plot_velocity(model)
##############################################
##############################################
u = TimeFunction(name="u", grid=model.grid, time_order=2, space_order=2)
pde = model.m u.dt2 - u.laplace + model.damp u.dt
##############################################
############################################## t0 = 0. # Simulation starts a t=0 tn = 1500. # Simulation last 1 second (1000 ms) dt = model.critical_dt # Time step from model grid spacing
time_range = TimeAxis(start=t0, stop=tn, step=dt)
##############################################
############################################## f0 = 0.007 src = RickerSource(name='src', grid=model.grid, f0=f0, npoint=1, time_range=time_range)
##############################################
############################################## No_Rec = 601 Rec_Scale = 1
No_Shot = 200
Offset = No_Rec * (grid_size/Rec_Scale)
shot_gather = np.zeros((No_Shot, int(np.ceil(tn/dt)+1), No_Rec), dtype=float) for i in range(No_Shot): print(i)
source_location = i*grid_size
src.coordinates.data[0, :] = source_location
src.coordinates.data[0, -1] = 40.
# Receiver Location
rec = Receiver(name='rec', grid=model.grid, npoint=No_Rec, time_range=time_range)
rec.coordinates.data[:, 0] = np.linspace(source_location+grid_size, (source_location+grid_size)+Offset, num=No_Rec)
rec.coordinates.data[:, 1] = 40.
# FDM Solving
stencil = Eq(u.forward, solve(pde, u.forward))
# Finally we define the source injection and receiver read function to generate the corresponding code
src_term = src.inject(field=u.forward, expr=src * dt**2 / model.m)
# Create interpolation expression for receivers
rec_term = rec.interpolate(expr=u.forward)
op = Operator([stencil] + src_term + rec_term, subs=model.spacing_map)
#NBVAL_IGNORE_OUTPUT
op(time=time_range.num-1, dt=model.critical_dt)
shot_gather[i, :, :] = rec.data
plot_velocity(model, source=src.coordinates.data, receiver=rec.coordinates.data[::4, :])
plot_shotrecord(shot_gather[0, :, :], model, t0, tn) np.save('/home/bslim/Documents/Machine_Learning_BSLim/UNet/2D_Modeling/shot_gather_with_multiple_small.npy', shot_gather)
for i in range(len(shot_gather[1, :, 1])): for j in range(len(shot_gather[1, 1, :])): r = np.sqrt(((igrid_size)(igrid_size)) + ((jgrid_size)(jgrid_size)))
shot_gather[1, i, j] = shot_gather[1, i, j]*r
tmp = shot_gather[1, 1000:1512, :512]
plt.imshow(tmp) plt.show()
can you please paste the error prompt you're getting?
can you please paste the error prompt you're getting?
The unknown
compiler isn't available on this system
ERROR:Devito:The unknown
compiler isn't available on this system
An exception has occurred, use %tb to see the full traceback.
SystemExit: 1
/home/bslim/anaconda3/envs/devito/lib/python3.6/site-packages/IPython/core/interactiveshell.py:3304: UserWarning: To exit: use 'exit', 'quit', or Ctrl-D. warn("To exit: use 'exit', 'quit', or Ctrl-D.", stacklevel=1)
can you please paste full traceback
are you syncd with latest master?
(try git checkout master
then git pull
from devito's installation path)
Already on 'master' Your branch is up to date with 'origin/master'.
Already up to date.
are you trying to run in from within a jupyter-notebook?
I did on both anaconda spyder and just terminal.
i'm trying to run it here. can you share the file Marmousi2_Vp.npy
or a sample of it?
i'm trying to run it here. can you share the file
Marmousi2_Vp.npy
or a sample of it?
How can I share it? I am not familiar with git yet and do not know how to put an attachment. Anyway, following is how I created the '*.npy" file.
import numpy as np import matplotlib.pyplot as plt from obspy.io.segy.segy import _read_segy
No_Trace = 13601 No_Sample = 2801 DT_Sample = 1250
stream = _read_segy('/home/bslim/Documents/Machine_Learning_BSLim/Marmousi2_Model/MODEL_P-WAVE_VELOCITY_1.25m.segy', headonly=True) Vp = np.zeros((No_Trace, No_Sample), dtype=np.float32)
for i in range(No_Trace): Vp[i, :] = stream.traces[i].data
np.save('/home/bslim/Documents/Machine_Learning_BSLim/UNet/2D_Modeling/Marmousi2_Vp.npy', Vp)
Vel = np.load('/home/bslim/Documents/Machine_Learning_BSLim/UNet/2D_Modeling/Marmousi2_Vp.npy') Vel = Vel.transpose()
plt.imshow(Vel) plt.show
i'm trying to run it here. can you share the file
Marmousi2_Vp.npy
or a sample of it?
If you do not mind, I will send an email with code and input.
find the text Attach files by dragging & dropping, selecting or pasting them.
on the response field
anyway, you could join slack and share it through there. please get yourself an invitation link at https://opesci-slackin.now.sh/ we may use the #questions channels
I am in!
it should have now been fixed via #797 . Closing this issue but feel free to reopen if I'm wrong
Hi everyone!
Trying to run FDM on Devito but get a message as following. "The
unknown
compiler isn't available on this system"The code is running good on the other machine.
I am using Ubuntu 18.3 with Python3.6. In fact I had exactly the same errors on Windows 10 and have just moved to Ubuntu.
Anyone knows what to do?