Esempio n. 1
0
shot[101] = 1112
shot[112] = 1115
shot[113] = 1116
shot[124] = 1117
shot = np.sort(shot)
idx = shot[node_idx]

#idx = random.randint(1, num_shots)  # fix to certain bsize for constant?
print("Process shot no.: ", idx)
dorig, sx, sz, gx, gz, tn, dt, nt = segy_get(bucket, data_path,
                                             data_name + str(idx) + '.segy')

# Restrict models to receiver area + buffer (default is 500 m)
m0, shape, origin = restrict_model_to_receiver_grid(sx,
                                                    gx,
                                                    vp,
                                                    spacing,
                                                    origin_full,
                                                    buffer_size=5000)
water = restrict_model_to_receiver_grid(sx,
                                        gx,
                                        water,
                                        spacing,
                                        origin_full,
                                        buffer_size=5000)[0]

print("Original shape: ", shape_full)
print("New shape: ", shape)

# Load previous iterations
if iteration == 1:
    x = np.zeros(shape=shape, dtype='float32')
Esempio n. 2
0
# Fetch models from S3
m0, origin_full, spacing = model_get(bucket, model_path + velocity_name)
water = model_get(bucket, model_path + water_name)[0]
shape_full = m0.shape
ndims = len(spacing)

# Fetch observed data
idx = 800   #random.randint(1, num_shots)  # fix to certain bsize for constant?
print("Process shot no.: ", idx)
dorig, sx, sz, gx, gz, tn, dt, nt = segy_get(bucket, data_path, data_name + str(idx) + '.segy')

# Restrict models to receiver area + buffer (default is 500 m)
buffer_size = 9352  # -> use half the model
if multi_socket == 'RESTRICT':
    m0, shape, origin = restrict_model_to_receiver_grid(sx, gx, m0, spacing, origin_full, buffer_size=buffer_size)
    water = restrict_model_to_receiver_grid(sx, gx, water, spacing, origin_full, buffer_size=buffer_size)[0]
else:
    origin = origin_full
    shape = shape_full

print("Original shape: ", shape_full)
print("New shape: ", shape)

# Load previous iterations
if iteration == 1:
    x = np.zeros(shape=shape, dtype='float32')
else:
    x = array_get(bucket, variable_path + 'chunk_1/' + variable_name + str(iteration-1))
    if num_chunks > 1:
        for chunk in range(1,num_chunks):