5/9/2022
Seismic Analysis Using
Python
By:
Mahmoud Badawy
(Lecturer of Geophysics, Geology Department,
Faculty of Science, Alexandria University, Egypt)
1
“Data Analysis and
Interpretation in Earth
Science”
Dr. Mahmoud Badawy
Dr. Mahmoud Badawy 2
5/9/2022
$?
Dr. Mahmoud Badawy 3
5/9/2022
$?
What happened!
Open what?
Using what?
Dr. Mahmoud Badawy 4
Numerous step-by-step code
examples in the field of Earth Sciences.
Allows proficient use of Python in
visualizing, analyzing, and modelling
geological data.
Specifically minded for teaching
Python to geologists.
5/9/2022
It’s how you make software (Using Software)??????
What do you want to [code, build, debug, deploy, collaborate
on, analyze, learn] today?
Code faster
Work smarter
Data Analyst?
Data Science?
Machine Learning?
Artificial Intelligent?
Computer Science
Students!!!!!!
Type less, code more
IntelliCode is a powerful set of
automatic code completion tools
that understand your code context:
variable names, functions, and the
type of code you’re writing.
This makes IntelliCode able to
complete up to a whole line at once,
helping you code more accurately
and confidently.
Dr. Mahmoud Badawy 6
5/9/2022
Stop problems before they’re problems
Integrated debugging is a core part of every Visual
Studio product.
You can step through your code and look at the values
stored in variables, set watches on variables to see when
values change, examine the execution path of your code,
and just about anything else you need to check out under
the hood.
Dr. Mahmoud Badawy 7
5/9/2022
Dr. Mahmoud Badawy 8
Language Time!
5/9/2022
5/9/2022 Dr. Mahmoud Badawy 9
5/9/2022 Dr. Mahmoud Badawy 10
5/9/2022 Dr. Mahmoud Badawy 11
5/9/2022 Dr. Mahmoud Badawy 12
5/9/2022 Dr. Mahmoud Badawy 13
5/9/2022 Dr. Mahmoud Badawy 14
5/9/2022 Dr. Mahmoud Badawy 15
5/9/2022 Dr. Mahmoud Badawy 16
Dr. Mahmoud Badawy 17
5/9/2022
Dr. Mahmoud Badawy 18
Which prompt you will use
Cmd
Anaconda
Powershell
?
Library
Packages
Modules
Anaconda prompt:
pip install numpy
pip install matplotlib
pip install obspy
pip install segyio
Pip install petrel
pip install seismic_canvas
pip install seismic-attributes
5/9/2022
Python Language to handle with seismic specific libraries:
Dr. Mahmoud Badawy 19
stream = _read_segy('C:/Users/M.M.Badawy/Desktop/Name of Data Folder/X-Line 1.segy', headonly = True)
import numpy as np
import matplotlib.pyplot as plt
from obspy.io.segy.segy import _read_segy
plt.imshow(data.T, cmap="RdBu", min=-100, max=100, aspect='auto')
import numpy as np
import matplotlib.pyplot as plt
from obspy.io.segy.segy import _read_segy
one_trace = steam.traces[3]
data = np.stack(t.data for t in steam.traces)
data.shape
stream = _read_segy('C:/Users/M.M.Badawy/Desktop/SEGY/X-Line 5.segy', headonly = True)
plt.imshow(data.T, cmap="RdBu", vmin=-100, vmax=100, aspect='auto')
5/9/2022
Dr. Mahmoud Badawy 20
5/9/2022
Dr. Mahmoud Badawy 21
5/9/2022
5/9/2022 Dr. Mahmoud Badawy 22
>>>print (“Thanks”)
Thanks

Python Programing Language in GeoScience-Notes.pdf

  • 1.
    5/9/2022 Seismic Analysis Using Python By: MahmoudBadawy (Lecturer of Geophysics, Geology Department, Faculty of Science, Alexandria University, Egypt) 1 “Data Analysis and Interpretation in Earth Science” Dr. Mahmoud Badawy
  • 2.
    Dr. Mahmoud Badawy2 5/9/2022 $?
  • 3.
    Dr. Mahmoud Badawy3 5/9/2022 $?
  • 4.
    What happened! Open what? Usingwhat? Dr. Mahmoud Badawy 4 Numerous step-by-step code examples in the field of Earth Sciences. Allows proficient use of Python in visualizing, analyzing, and modelling geological data. Specifically minded for teaching Python to geologists. 5/9/2022
  • 5.
    It’s how youmake software (Using Software)?????? What do you want to [code, build, debug, deploy, collaborate on, analyze, learn] today? Code faster Work smarter Data Analyst? Data Science? Machine Learning? Artificial Intelligent? Computer Science Students!!!!!!
  • 6.
    Type less, codemore IntelliCode is a powerful set of automatic code completion tools that understand your code context: variable names, functions, and the type of code you’re writing. This makes IntelliCode able to complete up to a whole line at once, helping you code more accurately and confidently. Dr. Mahmoud Badawy 6 5/9/2022
  • 7.
    Stop problems beforethey’re problems Integrated debugging is a core part of every Visual Studio product. You can step through your code and look at the values stored in variables, set watches on variables to see when values change, examine the execution path of your code, and just about anything else you need to check out under the hood. Dr. Mahmoud Badawy 7 5/9/2022
  • 8.
    Dr. Mahmoud Badawy8 Language Time! 5/9/2022
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
    Dr. Mahmoud Badawy17 5/9/2022
  • 18.
    Dr. Mahmoud Badawy18 Which prompt you will use Cmd Anaconda Powershell ? Library Packages Modules Anaconda prompt: pip install numpy pip install matplotlib pip install obspy pip install segyio Pip install petrel pip install seismic_canvas pip install seismic-attributes 5/9/2022
  • 19.
    Python Language tohandle with seismic specific libraries: Dr. Mahmoud Badawy 19 stream = _read_segy('C:/Users/M.M.Badawy/Desktop/Name of Data Folder/X-Line 1.segy', headonly = True) import numpy as np import matplotlib.pyplot as plt from obspy.io.segy.segy import _read_segy plt.imshow(data.T, cmap="RdBu", min=-100, max=100, aspect='auto') import numpy as np import matplotlib.pyplot as plt from obspy.io.segy.segy import _read_segy one_trace = steam.traces[3] data = np.stack(t.data for t in steam.traces) data.shape stream = _read_segy('C:/Users/M.M.Badawy/Desktop/SEGY/X-Line 5.segy', headonly = True) plt.imshow(data.T, cmap="RdBu", vmin=-100, vmax=100, aspect='auto') 5/9/2022
  • 20.
    Dr. Mahmoud Badawy20 5/9/2022
  • 21.
    Dr. Mahmoud Badawy21 5/9/2022
  • 22.
    5/9/2022 Dr. MahmoudBadawy 22 >>>print (“Thanks”) Thanks