# Read SEGY data in Mathematica?

Posted 3 years ago
7653 Views
|
13 Replies
|
10 Total Likes
|
 Please I need code/software to read SEGY data in order to input to Mathematica
13 Replies
Sort By:
Posted 3 years ago
 I don't know if this is helpful, but there is an R package called Rquakehttps://cran.r-project.org/web/packages/Rquake/Rquake.pdfthat looks like it is built to to read in seg-y data. Mathematica has a good interface with the R Language via RLink:http://reference.wolfram.com/language/RLink/tutorial/UsingRLink.htmlSo, although it may not be a trivial exercise to add in this package to R and then to interface with Mathematica using RLink, it may be simpler than trying to write some kind of seg-y parsing code in regular Mathematica.
Posted 3 years ago
 If you mean the SEGY seismic data format I can recomend to use this project https://github.com/KirillBelovTest/CustomImportExport This package allows you to import and export seismic data into the Mathematica, to work with the trace headers and text headers. It supports both the data format floating-point and integer data. You can dowload repository and find some examples. The comments are on Russian but a think you can understand the code easily. If you would like to improve this project, can you tell us about your wishes and to participate in development.
Posted 3 years ago
 Thank you Anton for sharing these codes with me. This is exactly what I need, to be able to read SEGY data into the Mathematica. However, I will appreciate if you could help with English version of step-by-step guide to use it. I am a new user of Mathematica. Thank you once again
Posted 3 years ago
 Thank you for sharing this interesting body of work. I installed the package as per the instructions and am exploring the examples. As it happens the first one I tried, from the file "ExampleOfUse.md" has a minor issue. The code: Get["CustomImportExport"]; SetDirectory[\$CustomImportExportDirectory]; file = FileNameJoin[{"CustomImportExport", "Resources", "MarmousiModel.segy"}]; data = CustomImport[file, "SEGY"]; traces = data["Traces"];Head[traces] (* check the form of traces *) SEGYElementSo the following ArrayPlot fails unless we take the second part of "traces", and now it works very nicely. ArrayPlot[Transpose[traces[[2]]], AspectRatio -> 0.5, ImageSize -> Large, PlotLegends -> Automatic, FrameTicks -> Automatic, PlotLabel -> "?????? Marmousi \n ?????? ????????? ?????????? ????"] 
Posted 3 years ago
 Hi Christopher! I am new to Mathematical, kindly highlight the steps to follow in order to read SEGY file into Mathematical.Thank you
Posted 3 years ago
 First of all you need - download repository. Second - open and evaluate Installer.nb notebook. Third -you can create your own new notebook for working and evaluate Get["CustomImportExport"] For import file evaluate next dataIn = CustomImport["YourFileName.sgy", "SEGY"] You can see and analyze headers of traces dataIn["TraceHeaders", 1;;-1, {"gx", "gy"}] in this string we can see coordinates of geophones. In this package SeismicUnix notation of headers is used. In next string you can get the values of first trace dataIn["Traces", 1] You can plot data (Seismic section or Gathers) by the way Christopher showed. If you have questions - please write!
Posted 3 years ago
 Thanks for finding the bug! I fixed this. In fact, there is a small inaccuracy in the documentation. Now you can use the function ArrayPlot like this: data = CustomImport["path/to/file.segy", "SGY"] ArrayPlot[data] ArrayPlot[data["Traces"]] More examples in the file CustomImportExport.nb
Posted 3 years ago
 Thank you Anton, I have been able to do that successfully.
Posted 3 years ago
 Thank you Anton. I was able to load the data successfully but the ArrayPlot did not work. Kindly highlight to me how to do the plotting after loading the SEGY data.
Posted 3 years ago
 It was a small mistake in the documentation. Try this: data = CustomImport["path/to/file.segy", "SGY"] ArrayPlot[data] ArrayPlot[data["Traces"][]] (* data["Traces"][] - returns array of numbers *) Or you can download latest version of the package (I updated this several days ago) and code from the ExampleOfUse will be work.
Posted 3 years ago
 Please see advanced dedicated post @Kirill Belov kindly contributed:Working with SEGY file format for storing geophysical data http://community.wolfram.com/groups/-/m/t/1283198