run_id = int(str(sys.argv[1]))
else:
    run_id = 0

logging = os.environ["DEVITO_LOGGING"]
num_threads = int(os.environ["OMP_NUM_THREADS"])
rootpath = os.environ["AZ_BATCH_NODE_SHARED_DIR"]

container = os.environ["BLOB_CONTAINER"]  # overthrust
space_order = int(os.environ["SPACE_ORDER"])
batchsize = int(os.environ["BATCHSIZE"])

#########################################################################################

# Read models
rho = read_h5_model(rootpath + '/overthrust/models/rho_with_salt.h5')
epsilon = read_h5_model(rootpath + '/overthrust/models/epsilon_with_salt.h5')
delta = read_h5_model(rootpath + '/overthrust/models/delta_with_salt.h5')
theta = read_h5_model(rootpath + '/overthrust/models/theta_with_salt.h5')
phi = read_h5_model(rootpath + '/overthrust/models/phi_with_salt.h5')
m0 = read_h5_model(rootpath + '/overthrust/models/migration_velocity.h5')
dm = read_h5_model(rootpath + '/overthrust/models/perturbation.h5')
dm[:, :, 0:29] = 0.0  # Extend water column
delta[delta >= epsilon] = .9 * epsilon[delta >=
                                       epsilon]  # fix thomsen parameters

# Read geometry
source_indices = np.load(rootpath + '/overthrust/geometry/source_indices.npy',
                         allow_pickle=True)
idx = source_indices[run_id]
print('Process source no. ', idx, ' out of ', batchsize)
Exemple #2
0
import matplotlib.pyplot as plt
from model import Model
from sources import RickerSource, TimeAxis, Receiver
from tti_propagators import TTIPropagators
import segyio as so
from scipy import interpolate, ndimage
from AzureUtilities import read_h5_model, butter_bandpass_filter, butter_lowpass_filter, resample, process_summaries, read_coordinates, restrict_model_to_receiver_grid
from scipy import interpolate, ndimage

#########################################################################################

# Shot number (get from batch)
shot_no = 0

# Read models
rho = read_h5_model('../data/models/rho_with_salt.h5')
epsilon = read_h5_model('../data/models/epsilon_with_salt.h5')
delta = read_h5_model('../data/models/delta_with_salt.h5')
theta = read_h5_model('../data/models/theta_with_salt.h5')
phi = read_h5_model('../data/models/phi_with_salt.h5')
m0 = read_h5_model('../data/models/migration_velocity.h5')
dm = read_h5_model('../data/models/perturbation.h5')
delta[delta >= epsilon] = .5 * epsilon[delta >= epsilon]

shape = (801, 801, 267)
origin_full = (0.0, 0.0, 0.0)
spacing = (12.5, 12.5, 12.5)
so = 8

# Read coordinates
file_idx = '../data/geometry/source_indices.npy'
Exemple #3
0
from tti_propagators import *
from model import *
from sources import *
import numpy as np
from devito import norm
from scipy import ndimage
import matplotlib.pyplot as plt
from AzureUtilities import read_h5_model
# Shot number (get from batch)
shot_no = 0
pathfile = '/app/model_phhil/'
# Read models
rho = read_h5_model(pathfile+'rho_with_salt_2D.h5')
epsilon = read_h5_model(pathfile+'epsilon_with_salt_2D.h5')
delta = read_h5_model(pathfile+'delta_with_salt_2D.h5')
theta = read_h5_model(pathfile+'theta_with_salt_2D.h5')
m0 = read_h5_model(pathfile+'migration_velocity_2D.h5')
dm = read_h5_model(pathfile+'perturbation_2D.h5')


n = (801, 267)
o = (0., 0.)
d = (12.5, 12.5)
so = 8
dt_full = .64

model = Model(shape=n, origin=o, spacing=d, vp=np.sqrt(1./m0), space_order=so,
              epsilon=epsilon, delta=delta, theta=theta, nbpml=40,
              dm=dm, rho=rho, dt=dt_full)

# Time axis
# Get inputs
shot_id = args.shot_id
recloc = args.recloc
modelloc = args.modelloc
geomloc = args.geomloc
freesurf = args.freesurf

# Some parameters
space_order = 12
nbpml = 40
timer(t0, 'Args process')
t0 = time.time()

""
# Read models
rho = read_h5_model(modelloc + 'rho_with_salt.h5')
epsilon = read_h5_model(modelloc + 'epsilon_with_salt.h5')
delta = read_h5_model(modelloc + 'delta_with_salt.h5')
theta = read_h5_model(modelloc + 'theta_with_salt.h5')
phi = read_h5_model(modelloc + 'phi_with_salt.h5')
vp = read_h5_model(modelloc + 'vp_fine_with_salt.h5')
shape = (801, 801, 267)
origin = (0.0, 0.0, 0.0)
spacing = (12.5, 12.5, 12.5)
model = Model(shape=shape,
              origin=origin,
              spacing=spacing,
              vp=vp,
              space_order=space_order,
              epsilon=epsilon,
              delta=delta,