├── .gitignore ├── LICENSE ├── README.md └── segy_visualization.ipynb /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Amir Abbas Babasafari 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------------------------------------------------------------- 2 | # Seismic Data Interactive Visualization 3 | 4 | 2D/3D post-stack seismic amplitude/reservoir property in sgy/segy format 5 | 6 | -------------------------------------------------------------------------------------------------------------------------------------- 7 | # Script files: 8 | 9 | segy_visualization.ipynb: Jupyter notebook 10 | 11 | -------------------------------------------------------------------------------------------------------------------------------------- 12 | Author: Amir Abbas Babasafari (AB) 13 | 14 | Date: March 2024 15 | 16 | Email: a.babasafari@yahoo.com 17 | 18 | -------------------------------------------------------------------------------------------------------------------------------------- 19 | # Installation Requirements: 20 | 21 | Python 3.9 22 | 23 | Libraries: numpy, segyio, matplotlib, tkinter, ipywidgets 24 | 25 | IDE: Jupyter Notebook 26 | 27 | -------------------------------------------------------------------------------------------------------------------------------------- 28 | # Run the application: 29 | 30 | Download the code from GitHub or clone the repository to your machine 31 | 32 | Install the required dependencies using pip install 'library name' 33 | 34 | Run the code on Jupyter notebook IDE 35 | 36 | -------------------------------------------------------------------------------------------------------------------------------------- 37 | Notes: 38 | 39 | *Please make sure that data loaded is 2D or 3D post-stack seismic data, pre-stack is not supported 40 | 41 | *Supported Data Format: 4-byte IBM float and 4-byte IEEE float 42 | 43 | -------------------------------------------------------------------------------------------------------------------------------------- 44 | # More information: 45 | 46 | https://www.linkedin.com/feed/update/urn:li:activity:7173980301373644800/ 47 | 48 | https://www.youtube.com/watch?v=Wnuo09CDXfw 49 | -------------------------------------------------------------------------------- /segy_visualization.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "88003e32-22a7-48e9-bb22-240ac033cd63", 6 | "metadata": {}, 7 | "source": [ 8 | "# Seismic Data Interactive Visualization \n", 9 | "## 2D/3D post-stack seismic amplitude/reservoir property in sgy/segy format \n", 10 | "### Author: Amir Abbas Babasafari (AB) \n", 11 | "### Date: March 2024\n", 12 | "### Email: a.babasafari@yahoo.com\n", 13 | "### IDE: Jupyter Notebook\n", 14 | "### Python version: 3.9" 15 | ] 16 | }, 17 | { 18 | "cell_type": "markdown", 19 | "id": "2fe73b13-c24d-475b-8978-e027faf18910", 20 | "metadata": {}, 21 | "source": [ 22 | "### *Please make sure that data loaded is 2D or 3D post-stack seismic data, pre-stack is not supported\n", 23 | "### *Supported Data Format: 4-byte IBM float and 4-byte IEEE float" 24 | ] 25 | }, 26 | { 27 | "cell_type": "markdown", 28 | "id": "309c74c9-93c6-4702-addd-4a6d543f6e86", 29 | "metadata": {}, 30 | "source": [ 31 | "#####" 32 | ] 33 | }, 34 | { 35 | "cell_type": "markdown", 36 | "id": "0c683c3f-4e11-48c2-a49b-a4dcf6a802b9", 37 | "metadata": {}, 38 | "source": [ 39 | "### Import Libraries\n", 40 | "#### Please run the cell below" 41 | ] 42 | }, 43 | { 44 | "cell_type": "code", 45 | "execution_count": 1, 46 | "id": "85b8a474-111b-4a6a-b63d-2446c903b17f", 47 | "metadata": {}, 48 | "outputs": [], 49 | "source": [ 50 | "import os\n", 51 | "import sys\n", 52 | "import numpy as np\n", 53 | "import segyio \n", 54 | "from matplotlib import pyplot as plt\n", 55 | "from tkinter import *\n", 56 | "from tkinter import filedialog\n", 57 | "import ipywidgets as widgets\n", 58 | "from ipywidgets import interact" 59 | ] 60 | }, 61 | { 62 | "cell_type": "markdown", 63 | "id": "6ee062a5-5dd6-4630-ab16-76aedb338cb1", 64 | "metadata": {}, 65 | "source": [ 66 | "### Load a sgy/segy file" 67 | ] 68 | }, 69 | { 70 | "cell_type": "markdown", 71 | "id": "189ad28e-6203-4ca5-80de-7be3b584430a", 72 | "metadata": {}, 73 | "source": [ 74 | "#### Please run the cell below, click on 'open a file' button on pop-up window to select your seismic data in segy/sgy format, followed by clicking on the 'close the window' button." 75 | ] 76 | }, 77 | { 78 | "cell_type": "code", 79 | "execution_count": 2, 80 | "id": "d7f38c47-f296-4e47-8426-c550b06da65a", 81 | "metadata": {}, 82 | "outputs": [ 83 | { 84 | "name": "stdout", 85 | "output_type": "stream", 86 | "text": [ 87 | "File_path: E:/AB_2023/BRI/segy_test/DGB/F3_Demo_Netherlands.segy\n" 88 | ] 89 | } 90 | ], 91 | "source": [ 92 | "def load_segy_file():\n", 93 | " '''\n", 94 | " Function to load a segy file\n", 95 | " \n", 96 | " Return file path of loaded segy file\n", 97 | " '''\n", 98 | " \n", 99 | " global filepath\n", 100 | " \n", 101 | " # Open file name\n", 102 | " file = filedialog.askopenfilename(initialdir = os.getcwd(),\n", 103 | " title = \"Please select 2D/3D post-stack seismic data in segy format\",\n", 104 | " filetypes = [('sgy files','*.sgy'),('segy files','*.segy'),('All files','*.*')])\n", 105 | " filepath = file\n", 106 | " print(\"File_path: {0}\".format(filepath))\n", 107 | " \n", 108 | "# Create root window\n", 109 | "root = Tk()\n", 110 | "root.geometry('300x200') \n", 111 | "root.title('AB')\n", 112 | "\n", 113 | "# Open button to click in a GUI toolkit\n", 114 | "open_button1 = Button(root, text = \"Open a File\", command = load_segy_file)\n", 115 | "open_button2 = Button(root, text = \"Close the Window\", command = root.destroy)\n", 116 | "open_button1.pack()\n", 117 | "open_button2.pack()\n", 118 | "\n", 119 | "# Run the application\n", 120 | "root.mainloop()" 121 | ] 122 | }, 123 | { 124 | "cell_type": "markdown", 125 | "id": "4f4e2dbf-cdd7-4f49-a84a-87c845f01c38", 126 | "metadata": {}, 127 | "source": [ 128 | "### Read 2D/3D post-stack seismic data and identify parameters\n", 129 | "#### Please run the cell below" 130 | ] 131 | }, 132 | { 133 | "cell_type": "code", 134 | "execution_count": 3, 135 | "id": "9c9e41dd-4ad3-499f-8958-fd3003575d62", 136 | "metadata": {}, 137 | "outputs": [ 138 | { 139 | "name": "stdout", 140 | "output_type": "stream", 141 | "text": [ 142 | "Data Type: Post-stack 3D\n", 143 | "Seismic Data Shape (Time sample, crossline number, inline number) : (462, 951, 651)\n" 144 | ] 145 | } 146 | ], 147 | "source": [ 148 | "def identify_seismic_data_parameters(filepath_in): \n", 149 | " \"\"\" \n", 150 | " Function to identify data type as 2D or 3D and Post-Stack or Pre-Stack as well as seismic amplitude traces and geometry-related parameters\n", 151 | " \n", 152 | " Parameter:\n", 153 | " ----------\n", 154 | " filepath_in (str): file path of loaded segy file\n", 155 | " \n", 156 | " Returns:\n", 157 | " --------\n", 158 | " data_display (numpy.ndarray): Seismic amplitude traces to plot\n", 159 | " data_type, seismic_data_shape, cdp_no, sample_rate, twt , inline_number, xline_number, diff_inline, diff_xline \n", 160 | "\n", 161 | " Author: Amir Abbas Babasafari (AB)\n", 162 | " \"\"\"\n", 163 | "\n", 164 | " with segyio.open(filepath_in, ignore_geometry=True) as f:\n", 165 | " data_format = f.format\n", 166 | "\n", 167 | " # Supported inline and crossline byte locations\n", 168 | " inline_xline = [[189,193], [9,13], [9,21], [5,21]]\n", 169 | " state = False\n", 170 | " \n", 171 | " # Read segy data with the specified byte location of geometry \n", 172 | " for k, byte_loc in enumerate(inline_xline):\n", 173 | "\n", 174 | " try:\n", 175 | " with segyio.open(filepath_in, iline = byte_loc[0], xline = byte_loc[1], ignore_geometry=False) as f:\n", 176 | " # Get the attributes\n", 177 | " seismic_data = segyio.tools.cube(f)\n", 178 | " n_traces = f.tracecount \n", 179 | " # data = f.trace.raw[:].T \n", 180 | " # tr = f.bin[segyio.BinField.Traces]\n", 181 | " tr = f.attributes(segyio.TraceField.TraceNumber)[-1]\n", 182 | " if not isinstance(tr, int):\n", 183 | " tr = f.attributes(segyio.TraceField.TraceNumber)[-2] + 1\n", 184 | " tr = int(tr[0])\n", 185 | " spec = segyio.spec()\n", 186 | " spec.sorting = f.sorting\n", 187 | " data_sorting = spec.sorting == segyio.TraceSortingFormat.INLINE_SORTING\n", 188 | " twt = f.samples\n", 189 | " sample_rate = segyio.tools.dt(f) / 1000\n", 190 | " n_samples = f.samples.size\n", 191 | " \n", 192 | " # TRACE_SEQUENCE_FILE _ byte location:5\n", 193 | " TraceSequenceFile = []\n", 194 | " # FieldRecord _ byte location:9\n", 195 | " Field_Record = []\n", 196 | " # Trace_Field _ byte location:13\n", 197 | " Trace_Field = []\n", 198 | " # CDP _ byte location:21\n", 199 | " CDP = []\n", 200 | " # INLINE_3D _ byte location:189\n", 201 | " Inline_3D = []\n", 202 | " # CROSSLINE_3D _ byte location:193\n", 203 | " Crossline_3D = []\n", 204 | "\n", 205 | " for i in range(n_traces):\n", 206 | " trace_no = f.attributes(segyio.TraceField.TRACE_SEQUENCE_FILE)[i]; TraceSequenceFile.append(trace_no)\n", 207 | " field_record = f.attributes(segyio.TraceField.FieldRecord)[i]; Field_Record.append(field_record)\n", 208 | " trace_field = f.attributes(segyio.TraceField.TraceNumber)[i]; Trace_Field.append(trace_field)\n", 209 | " cdp = f.attributes(segyio.TraceField.CDP)[i]; CDP.append(cdp)\n", 210 | " inline = f.attributes(segyio.TraceField.INLINE_3D)[i]; Inline_3D.append(inline)\n", 211 | " xline = f.attributes(segyio.TraceField.CROSSLINE_3D)[i]; Crossline_3D.append(xline)\n", 212 | "\n", 213 | " inline3d = np.unique(Inline_3D)\n", 214 | " crossline3d = np.unique(Crossline_3D)\n", 215 | " fieldrecord = np.unique(Field_Record)\n", 216 | " tracefield = np.unique(Trace_Field)\n", 217 | " tracesequence = np.unique(TraceSequenceFile)\n", 218 | " cdpnumber = np.unique(CDP)\n", 219 | "\n", 220 | " state = True\n", 221 | "\n", 222 | " except:\n", 223 | " pass\n", 224 | "\n", 225 | " if state:\n", 226 | " \n", 227 | " # Identify data as 2D/3D and Post-stack/Pre-stack\n", 228 | " if len(seismic_data.shape) == 3:\n", 229 | " if seismic_data.shape[0] != 1:\n", 230 | " data_type = 'Post-stack 3D'\n", 231 | " else:\n", 232 | " if n_traces > tr > 1: \n", 233 | " data_type = 'Post-stack 3D'\n", 234 | " else:\n", 235 | " data_type = 'Post-stack 2D'\n", 236 | " \n", 237 | " else: \n", 238 | " if len(f.offsets) > 1:\n", 239 | " if seismic_data.shape[0] == 1:\n", 240 | " data_type = 'Pre-Stack 2D'\n", 241 | " else:\n", 242 | " data_type = 'Pre-Stack 3D' \n", 243 | " else:\n", 244 | " print('Error, Please check inline and crossline byte locations')\n", 245 | "\n", 246 | " # create geometry-related parameters\n", 247 | " if k==0:\n", 248 | " inline_number = inline3d \n", 249 | " xline_number = crossline3d\n", 250 | " elif k==1:\n", 251 | " inline_number = fieldrecord \n", 252 | " xline_number = tracefield\n", 253 | " elif k==2:\n", 254 | " inline_number = fieldrecord \n", 255 | " xline_number = cdpnumber\n", 256 | " elif k==3:\n", 257 | " inline_number = tracesequence \n", 258 | " xline_number = cdpnumber\n", 259 | "\n", 260 | " if data_type == 'Post-stack 3D':\n", 261 | " if len(inline_number) == 1 or len(xline_number) == 1:\n", 262 | " pass\n", 263 | " else:\n", 264 | " break\n", 265 | " else:\n", 266 | " break\n", 267 | "\n", 268 | " \n", 269 | " # reshape seismic data to the corresponding format based on data type\n", 270 | " try:\n", 271 | " inline, cdp, samples = seismic_data.shape\n", 272 | " except:\n", 273 | " print(\"Error, data was not loaded successfully, this could happen due to unsupported data format: {0}.\".format(data_format)) \n", 274 | " print(\"In addition, please check inline and crossline byte locations, that might not be supported in this script.\") \n", 275 | " print(\"Data format 4-byte IBM float and 4-byte IEEE float are supported.\")\n", 276 | "\n", 277 | " \n", 278 | " if data_type == 'Post-stack 2D':\n", 279 | " data_display = seismic_data.reshape(cdp, samples).T\n", 280 | " cdp_no = np.arange(n_traces) \n", 281 | "\n", 282 | " diff_inline = 1\n", 283 | " diff_xline = 1\n", 284 | "\n", 285 | " print('Data Type: {0}'.format(data_type))\n", 286 | " print('Seismic Data Shape (Time sample, CDP number) : {0}'.format(data_display.shape))\n", 287 | "\n", 288 | " elif data_type == 'Post-stack 3D':\n", 289 | " if inline == 1 and tr > 1 and n_traces % tr == 0: \n", 290 | " inline_no = n_traces / tr\n", 291 | " data_display = seismic_data.reshape(int(inline_no), int(tr), int(samples)).T\n", 292 | " xline_number = np.arange(tr)\n", 293 | " inline_number = np.arange(inline_no)\n", 294 | " cdp_no = xline_number\n", 295 | "\n", 296 | " else: \n", 297 | " data_display = seismic_data.reshape(inline, cdp, samples).T\n", 298 | " cdp_no = np.arange(cdp)\n", 299 | " \n", 300 | " diff_inline = np.diff(inline_number)[0]\n", 301 | " diff_xline = np.diff(xline_number)[0]\n", 302 | "\n", 303 | " print('Data Type: {0}'.format(data_type))\n", 304 | " print('Seismic Data Shape (Time sample, crossline number, inline number) : {0}'.format(data_display.shape))\n", 305 | "\n", 306 | " return data_display, data_type, data_display.shape, cdp_no, sample_rate, twt, inline_number, xline_number, diff_inline, diff_xline\n", 307 | "\n", 308 | "data_display, data_type, seismic_data_shape, cdp_no, sample_rate, twt , inline_number, xline_number, diff_inline, diff_xline= identify_seismic_data_parameters(filepath)" 309 | ] 310 | }, 311 | { 312 | "cell_type": "markdown", 313 | "id": "813113af-0a50-42a2-9265-7cd62b635eef", 314 | "metadata": {}, 315 | "source": [ 316 | "### Plot seismic amplitude traces\n", 317 | "#### Please run the cell below" 318 | ] 319 | }, 320 | { 321 | "cell_type": "code", 322 | "execution_count": 4, 323 | "id": "b1254e77-3d71-409e-ac75-43ec601f322e", 324 | "metadata": {}, 325 | "outputs": [], 326 | "source": [ 327 | "def plot(seismic_data, direction = None, segy = 'seismic'):\n", 328 | "\n", 329 | " '''\n", 330 | " Function to plot seismic amplitude traces\n", 331 | " '''\n", 332 | "\n", 333 | " if segy == 'seismic':\n", 334 | " color = plt.cm.seismic\n", 335 | " elif segy == 'property':\n", 336 | " color = plt.cm.jet\n", 337 | "\n", 338 | " # Plot seismic data \n", 339 | " if direction == 'inline':\n", 340 | " extent = (np.min(xline_number), np.max(xline_number), np.max(twt), np.min(twt))\n", 341 | " plt.xlabel(\"Crossline No.\")\n", 342 | " plt.ylabel(\"Time (ms)\")\n", 343 | " label = 'Interactive In-line Visualization'\n", 344 | " \n", 345 | " elif direction == 'xline':\n", 346 | " extent = (np.min(inline_number), np.max(inline_number), np.max(twt), np.min(twt))\n", 347 | " plt.xlabel(\"Inline No.\")\n", 348 | " plt.ylabel(\"Time (ms)\")\n", 349 | " label = 'Interactive Cross-line Visualization'\n", 350 | "\n", 351 | " elif direction == 'time-slice':\n", 352 | " extent = (np.min(inline_number), np.max(inline_number), np.max(xline_number), np.min(xline_number))\n", 353 | " plt.xlabel(\"Inline No.\")\n", 354 | " plt.ylabel(\"Crossline No.\")\n", 355 | " label = 'Interactive Time-Slice Visualization'\n", 356 | "\n", 357 | " elif direction == '2D Line':\n", 358 | " extent = (np.min(xline_number), np.max(xline_number), np.max(twt), np.min(twt))\n", 359 | " plt.xlabel(\"CDP No.\")\n", 360 | " plt.ylabel(\"Time (ms)\")\n", 361 | " label = '2D Line Visualization'\n", 362 | "\n", 363 | " # plt.figure(figsize=(10,10))\n", 364 | " plt.imshow(seismic_data, interpolation = 'nearest', cmap = color, aspect = 'auto', \n", 365 | " vmin = -np.max(seismic_data), vmax = np.max(seismic_data), extent = extent)\n", 366 | " plt.title(\"{0} \\n Seismic file name: {1}\".format(label, os.path.splitext(os.path.basename(filepath))[0]))\n", 367 | " plt.grid(True)\n", 368 | " plt.colorbar()\n", 369 | " plt.show()" 370 | ] 371 | }, 372 | { 373 | "cell_type": "markdown", 374 | "id": "9d138244-cff8-402b-b86b-068e04e0cf8a", 375 | "metadata": {}, 376 | "source": [ 377 | "#### If segy file is a seismic amplitude data, please run the cell below.\n", 378 | "#### If segy file is a elastic/reservoir property data, please comment 'seismic_amplitude' and uncomment 'property' then run the cell below." 379 | ] 380 | }, 381 | { 382 | "cell_type": "code", 383 | "execution_count": 5, 384 | "id": "4d3c0a46-d596-457c-89ba-e7b5d563c518", 385 | "metadata": {}, 386 | "outputs": [], 387 | "source": [ 388 | "sgy_file = 'seismic_amplitude' # default\n", 389 | "# sgy_file = 'property'\n", 390 | "\n", 391 | "if sgy_file == 'seismic_amplitude':\n", 392 | " cmp = 'seismic'\n", 393 | "else:\n", 394 | " cmp = 'property'" 395 | ] 396 | }, 397 | { 398 | "cell_type": "markdown", 399 | "id": "efe7dd6f-3d57-4296-8bca-71fc544df5cd", 400 | "metadata": {}, 401 | "source": [ 402 | "#### If data_type which was identified earlier is 'Post-stack 2D', please run the cell below to plot your segy file." 403 | ] 404 | }, 405 | { 406 | "cell_type": "code", 407 | "execution_count": 6, 408 | "id": "e1ce13e0-d090-4b6a-97e3-10930a9746d2", 409 | "metadata": {}, 410 | "outputs": [], 411 | "source": [ 412 | "if data_type == 'Post-stack 2D':\n", 413 | " plot(data_display, direction='2D Line', segy = cmp)" 414 | ] 415 | }, 416 | { 417 | "cell_type": "markdown", 418 | "id": "2624cd18-ed2e-4c44-b485-7c8c5d47c2d6", 419 | "metadata": {}, 420 | "source": [ 421 | "#### If data_type which was identified earlier is 'Post-stack 3D', please run the cells below to plot your segy file in 3 directions." 422 | ] 423 | }, 424 | { 425 | "cell_type": "markdown", 426 | "id": "363eeb92-c75a-4123-9cc3-8315c590fca2", 427 | "metadata": {}, 428 | "source": [ 429 | "### Interactive In-line Visualization\n", 430 | "#### Please run the cell below" 431 | ] 432 | }, 433 | { 434 | "cell_type": "code", 435 | "execution_count": 7, 436 | "id": "8784a2d8-df61-497c-8b8f-b9cd392eb508", 437 | "metadata": {}, 438 | "outputs": [ 439 | { 440 | "data": { 441 | "application/vnd.jupyter.widget-view+json": { 442 | "model_id": "1e26ba3f68fc4816a8ebf2c75302a6a6", 443 | "version_major": 2, 444 | "version_minor": 0 445 | }, 446 | "text/plain": [ 447 | "interactive(children=(IntSlider(value=425, description='Inline', max=750, min=100), Output()), _dom_classes=('…" 448 | ] 449 | }, 450 | "metadata": {}, 451 | "output_type": "display_data" 452 | } 453 | ], 454 | "source": [ 455 | "if data_type == 'Post-stack 3D':\n", 456 | "\n", 457 | " mid = len(inline_number)//2\n", 458 | " @interact(Inline=widgets.IntSlider(min=inline_number[0], max=inline_number[-1], step=diff_inline, value=inline_number[mid]))\n", 459 | " \n", 460 | " def display_seismic_data(Inline): \n", 461 | " Iline = int((Inline - inline_number[0])/diff_inline)\n", 462 | " seismic_data = data_display[:,:,Iline]\n", 463 | " plot(seismic_data, direction='inline', segy = cmp)\n", 464 | " " 465 | ] 466 | }, 467 | { 468 | "cell_type": "markdown", 469 | "id": "01af0fdc-0f9c-4841-a76e-f35b311d5267", 470 | "metadata": {}, 471 | "source": [ 472 | "### Interactive Cross-line Visualization\n", 473 | "#### Please run the cell below" 474 | ] 475 | }, 476 | { 477 | "cell_type": "code", 478 | "execution_count": 8, 479 | "id": "01979453-c286-447f-b45e-bdae8a770788", 480 | "metadata": {}, 481 | "outputs": [ 482 | { 483 | "data": { 484 | "application/vnd.jupyter.widget-view+json": { 485 | "model_id": "2f84a6afbcf54bb092b3f81c6e97b744", 486 | "version_major": 2, 487 | "version_minor": 0 488 | }, 489 | "text/plain": [ 490 | "interactive(children=(IntSlider(value=775, description='Crossline', max=1250, min=300), Output()), _dom_classe…" 491 | ] 492 | }, 493 | "metadata": {}, 494 | "output_type": "display_data" 495 | } 496 | ], 497 | "source": [ 498 | "if data_type == 'Post-stack 3D':\n", 499 | "\n", 500 | " mid = len(xline_number)//2\n", 501 | " @interact(Crossline=widgets.IntSlider(min=xline_number[0], max=xline_number[-1], step=diff_xline, value=xline_number[mid]))\n", 502 | "\n", 503 | " def display_seismic_data(Crossline): \n", 504 | " Xline = int((Crossline - xline_number[0])/diff_xline)\n", 505 | " seismic_data = data_display[:,Xline,:]\n", 506 | " plot(seismic_data, direction='xline', segy = cmp)\n", 507 | " " 508 | ] 509 | }, 510 | { 511 | "cell_type": "markdown", 512 | "id": "7e111429-1b65-4141-8d38-f37313862d8a", 513 | "metadata": {}, 514 | "source": [ 515 | "### Interactive Time-Slice Visualization\n", 516 | "#### Please run the cell below" 517 | ] 518 | }, 519 | { 520 | "cell_type": "code", 521 | "execution_count": 9, 522 | "id": "bd173459-8c44-487e-888b-f04c199335c4", 523 | "metadata": {}, 524 | "outputs": [ 525 | { 526 | "data": { 527 | "application/vnd.jupyter.widget-view+json": { 528 | "model_id": "33eef6ed80a64959b7da06023a7ef27c", 529 | "version_major": 2, 530 | "version_minor": 0 531 | }, 532 | "text/plain": [ 533 | "interactive(children=(IntSlider(value=928, description='TWT', max=1848, min=4, step=4), Output()), _dom_classe…" 534 | ] 535 | }, 536 | "metadata": {}, 537 | "output_type": "display_data" 538 | } 539 | ], 540 | "source": [ 541 | "if data_type == 'Post-stack 3D':\n", 542 | "\n", 543 | " mid = len(twt)//2\n", 544 | " @interact(TWT=widgets.IntSlider(min=twt[0], max=twt[-1], step=sample_rate, value=twt[mid]))\n", 545 | "\n", 546 | " def display_seismic_data(TWT): \n", 547 | " Time_ms = int((TWT - twt[0])/sample_rate)\n", 548 | " seismic_data = data_display[Time_ms,:,:]\n", 549 | " plot(seismic_data, direction='time-slice', segy = cmp)\n", 550 | " " 551 | ] 552 | }, 553 | { 554 | "cell_type": "markdown", 555 | "id": "2cd086b9-744f-448e-9232-521e46ffaefb", 556 | "metadata": {}, 557 | "source": [ 558 | "### Thank you for your attention" 559 | ] 560 | }, 561 | { 562 | "cell_type": "markdown", 563 | "id": "ce91a743-2e66-4965-9d0b-e315440d940d", 564 | "metadata": {}, 565 | "source": [ 566 | "##### AB" 567 | ] 568 | } 569 | ], 570 | "metadata": { 571 | "kernelspec": { 572 | "display_name": "Python 3 (ipykernel)", 573 | "language": "python", 574 | "name": "python3" 575 | }, 576 | "language_info": { 577 | "codemirror_mode": { 578 | "name": "ipython", 579 | "version": 3 580 | }, 581 | "file_extension": ".py", 582 | "mimetype": "text/x-python", 583 | "name": "python", 584 | "nbconvert_exporter": "python", 585 | "pygments_lexer": "ipython3", 586 | "version": "3.9.1" 587 | } 588 | }, 589 | "nbformat": 4, 590 | "nbformat_minor": 5 591 | } 592 | --------------------------------------------------------------------------------