equinor / vds-slice

Web API for fast access of arbitrary seismic slices from VDS data
GNU Affero General Public License v3.0
3 stars 8 forks source link

Set stepsize to 1 when one sample #262

Closed yngve793 closed 6 months ago

yngve793 commented 7 months ago

When the input vds file only contains a single iline or xline the stepsize was calculated to "nan".

The problem occurred when this notebook was recreated. 1410_Phase/phase_and_hilbert_transform.ipynb

Following python code can be used for testing: import numpy as np import matplotlib.pyplot as plt from oneseismic import OneseismicClient

# The oneseismic server
server = "http://127.0.0.1:8080"

# Url and sas token to a vds stored somewhere in Azure
vds = "https://onevdstest.blob.core.windows.net/testdata/phase_data/penobscot_xl1155_test"
sas = "?SAS"

cube = OneseismicClient(server, vds, sas)
metadata = cube.metadata()
print(metadata)

data, metadata = cube.slice('crossline', 1155)
vrng = max(abs(np.min(data)), np.max(data))
data_t = np.transpose(data)[500:750, :]

plt.figure(figsize=(12,6))
plt.imshow(data_t, vmin=-vrng/5, vmax=vrng/5, cmap='seismic', aspect='auto')
_=plt.title(f"Penobscot - partial xline 1155 ({500*4}ms, {750*4}ms)")
yngve793 commented 6 months ago

Due to minimum requirement for the number of values in each dimension this is no longer relevant.