Okay, here it goes. My first professional swing at VB (the compiled version). SEG-Y summary is a real application that reads in SEG-Y files, gives you info from the binary header and some (here's the some) -> It give you the first/last min/max info. I couldn't find any other free application which gives you min/max info which I could find. It's cheap & free and here. Enjoy. Careful of 3D files, it's a memory hog. I might be working on a quicker way to load the files - but more of that later.
Here's how to use it:
Load the file you want look at
Select the header you want to summarize
Real tough.
Wednesday, September 28, 2011
Saturday, September 24, 2011
Leave My Files Alone!
A big thumbs up for the SEG-Y Viewer brought to you by IHS. I think you have to pay for it now. It lets you view SEG-Y files without locking them up. Unlike SeiSee, you get to see the full amplitudes. For whatever reason, SeiSee only lets you look at 3 decimals to the right. SEG-Y Viewer lets you look at the whole shebang. And SegY Detective lets you as well - but it locks up the file.
Yes, I know that you need to keep the file open to look at it, but after everything's loaded into memory - let go of it. Are people afraid of someone else in the network will change the file you're working on? Nunno.
Locking files up can be disastrous for people trying to view seismic files in multiple application. Yes, you might have worked long and hard on your software, but it doesn't do everything.
My two cents.
Yes, I know that you need to keep the file open to look at it, but after everything's loaded into memory - let go of it. Are people afraid of someone else in the network will change the file you're working on? Nunno.
Locking files up can be disastrous for people trying to view seismic files in multiple application. Yes, you might have worked long and hard on your software, but it doesn't do everything.
My two cents.
Thursday, September 22, 2011
The SEG-Y Structure, Part 1
Okay. I've been analysing 2D SEG-Y files all day today - on the binary level. There may be a more in-depth analysis of it - but here's my shot.
SEG-Y Structure
We all know SEG-Y files are structured as
File Header
3200 byte EBCDIC/ASCII header
400 byte binary header
Trace Info
240 byte trace header
Sample Info
.....
wash, rinse, repeat with the trace header info - sample info
DWord/Word
After looking over the binary header & header info, I know we have the 2 byte integer type and the 4 byte integer types. There seems to be more to it than that if you want to be able to translate things to the normal/rational world.
Here's my first example:
If you look at things on the binary level of this file you'll see:
Now, You have the -1000 number represented as FC18. Remember it's a 16 bit WORD. After you bring it into the real world it'll become a -1000.
Hex DWORD: FFFFFC18 = -1000
Hex WORD: FC10 = -1000
Look at byte location 73-76 and you're going to expect to find -293373438. Okay, since it's a DWORD Int we're looking for:
Hex DWORD: EE837A02 = and suddenly you get -293373438. Whala!
If you worked for the SEG-Y subcommitee or commitee you probably already understand this. I just figured it out in my lowly-mentality-self.
SEG-Y Structure
We all know SEG-Y files are structured as
File Header
3200 byte EBCDIC/ASCII header
400 byte binary header
Trace Info
240 byte trace header
Sample Info
.....
wash, rinse, repeat with the trace header info - sample info
DWord/Word
After looking over the binary header & header info, I know we have the 2 byte integer type and the 4 byte integer types. There seems to be more to it than that if you want to be able to translate things to the normal/rational world.
Here's my first example:
If you look at things on the binary level of this file you'll see:
Now, You have the -1000 number represented as FC18. Remember it's a 16 bit WORD. After you bring it into the real world it'll become a -1000.
Hex DWORD: FFFFFC18 = -1000
Hex WORD: FC10 = -1000
Look at byte location 73-76 and you're going to expect to find -293373438. Okay, since it's a DWORD Int we're looking for:
Hex DWORD: EE837A02 = and suddenly you get -293373438. Whala!
If you worked for the SEG-Y subcommitee or commitee you probably already understand this. I just figured it out in my lowly-mentality-self.
Saturday, September 17, 2011
Decimal 2 Degrees
Okay, my next venture - I downloaded my free copy of visual basic because I figured out that visual basic scripting didn't cut it for what I was after. Here's a really really cheep program that converts decimal coordinates into degrees, minutes, seconds. I could probably convert them back . . . which I'll figure out on a later date. (Yes I know how to do the math, it's just how to do both in the same application).
Sunday, September 11, 2011
Nav2KML File
Okay, I've come to understand that the navigation world does not like GoogleEarth. After scouring all over the web I couldn't find anything that would suit what I wanted it to do - create a kml file from a navigation file. Multiple lines with different linenames. And, yes, I have more than 3 points in my path. Let's say 800! I sat down a few days ago and figured out GoogleEarth scripting and came up with this really cheesy vbs file.
Here it is:
infilename = inputbox("Enter the input file name")
outfilename = inputbox("Enter the output file name")
fname = inputbox("Enter the survey name: ")
Const ForReading = 1
Dim strFileIn, objFSO, objTextRead
strFileIn = infilename
'strFileIn = "C:\Users\Cremer\Documents\SEG-Y\San Francisco Bay\Navigation\" & infilename ' use this if you want absolute pathname
Set objFSO = CreateObject("Scripting.FileSystemObject") ' File system object
Set objTextRead = objFSO.OpenTextFile(strFileIn, ForReading) ' Open text file
strFileOut = outfilename
'strFileOut = "C:\Users\Cremer\Documents\SEG-Y\San Francisco Bay\Navigation\" & outfilename ' use this if you want absolute pathname
Set filestreamOUT = CreateObject("Scripting.FileSystemObject").OpenTextFile(strFileOut,2,true)
Dim arrKML()
n = 0
Do Until objTextRead.AtEndOfStream
Dim strSearchString
Dim currentID
strSearchString = objTextRead.ReadLine
ReDim Preserve arrKML(3,n) ' Initialize array 4 characters, at n entry
arrKML(0,n) = n ' add number
arrKML(1,n) = CDbl(trim(mid(strSearchString,1,11))) ' add long
arrKML(2,n) = CDbl(trim(mid(strSearchString,12,11))) ' add lat
arrKML(3,n) = (trim(mid(strSearchString,23,11))) ' add line number
n = n + 1 ' next iteration
Loop
objTextRead.Close
' ***********************************************************************
' msgbox "Number of elements in array: " & Ubound(arrKML,2)
dim currentLineName
currentLineName = arrKML(3,0)
filestreamOUT.WriteLine("<?xml version=" & chr(&H22) & "1.0" & chr(&H22) & " encoding=" & chr(&H22) & "UTF-8" & chr(&H22) & "?>")
filestreamOUT.WriteLine("<kml xmlns=" & chr(&H22) & "http://www.opengis.net/kml/2.2" & chr(&H22) & " xmlns:gx=" & chr(&H22) & "http://www.google.com/kml/ext/2.2" & chr(&H22) & " xmlns:kml=" & chr(&H22) & "http://www.opengis.net/kml/2.2" & chr(&H22) & " xmlns:atom=" & chr(&H22) & "http://www.w3.org/2005/Atom" & chr(&H22) & ">")
filestreamOUT.WriteLine("<Document id=" & chr(&H22) & "Phil Cremer's Cheesy nav2kml script" & chr(&H22) & ">")
filestreamOUT.WriteLine(vbtab & "<name>" & fname & "</name>")
filestreamOUT.WriteLine(vbtab & vbtab & "<Placemark id=" & chr(&H22) & currentLineName & chr(&H22) & ">")
filestreamOUT.WriteLine(vbtab & vbtab & vbtab & "<name>" & currentLineName & "</name>")
filestreamOUT.WriteLine(vbtab & vbtab & vbtab & "<LineString id=" & chr(&H22) & currentLineName & chr(&H22) & ">")
filestreamOUT.WriteLine(vbtab & vbtab & vbtab & vbtab & "<coordinates>")
for i = 0 to Ubound(arrKML,2)
dim lineName
lineName = arrKML(3,i)
if lineName <> currentLineName then ' if it's different put a marker in it.
filestreamOUT.WriteLine(vbtab & vbtab & vbtab & vbtab & "</coordinates>")
filestreamOUT.WriteLine(vbtab & vbtab & vbtab & "</LineString>")
filestreamOUT.WriteLine(vbtab & vbtab & vbtab & "</Placemark>")
filestreamOUT.WriteLine(vbtab & vbtab & "<Placemark id=" & chr(&H22) & lineName & chr(&H22) & ">")
filestreamOUT.WriteLine(vbtab & vbtab & vbtab & "<name>" & lineName & "</name>")
filestreamOUT.WriteLine(vbtab & vbtab & vbtab & "<LineString id=" & chr(&H22) & lineName & chr(&H22) & ">")
filestreamOUT.WriteLine(vbtab & vbtab & vbtab & vbtab & "<coordinates>")
currentLineName = lineName
else ' if it's the same put the coordiantes
filestreamOUT.WriteLine(vbtab & vbtab & vbtab & vbtab & vbtab & arrKML(1,i) & "," & arrKML(2,i) & ",0 ")
end if
next
filestreamOUT.WriteLine(vbtab & vbtab & vbtab & vbtab & "</coordinates>")
filestreamOUT.WriteLine(vbtab & vbtab & vbtab & "</LineString>")
filestreamOUT.WriteLine(vbtab & vbtab & "</Placemark>")
filestreamOUT.WriteLine("</Document>")
filestreamOUT.WriteLine("</kml>")
'for z = LBound(arrKML,2) to UBound(arrKML,2)
' filestreamOUT.WriteLine(arrKML(3,z))
'Next
'
filestreamOUT.Close()
Set filestreamOUT = Nothing
msgbox "Done!"
Like mentioned is really cheesy and really easy to write. You can probably do better job. If you can fix my sloppy code! All you have to do is safe what's in green to a text file and name it nav2kml.vbs in the directory of the navigation file. Your navigation file should be a follows.
-122.19785 37.5686 101A
-122.19785 37.56863 101A
-122.19785 37.56865 101A
My suggestion is to put your nav into an Excel spreadsheet and export it to a .prn file where the column width is set to 11. Long Lat Linename. If you need to modify stuff, it's pretty easy to figure out what needs to be changed to suit your needs. All the lines will be white written as one place. Write the output file as a *.kml. Import into GoogleEarth and whalla you get stuff like this!
Here it is:
infilename = inputbox("Enter the input file name")
outfilename = inputbox("Enter the output file name")
fname = inputbox("Enter the survey name: ")
Const ForReading = 1
Dim strFileIn, objFSO, objTextRead
strFileIn = infilename
'strFileIn = "C:\Users\Cremer\Documents\SEG-Y\San Francisco Bay\Navigation\" & infilename ' use this if you want absolute pathname
Set objFSO = CreateObject("Scripting.FileSystemObject") ' File system object
Set objTextRead = objFSO.OpenTextFile(strFileIn, ForReading) ' Open text file
strFileOut = outfilename
'strFileOut = "C:\Users\Cremer\Documents\SEG-Y\San Francisco Bay\Navigation\" & outfilename ' use this if you want absolute pathname
Set filestreamOUT = CreateObject("Scripting.FileSystemObject").OpenTextFile(strFileOut,2,true)
Dim arrKML()
n = 0
Do Until objTextRead.AtEndOfStream
Dim strSearchString
Dim currentID
strSearchString = objTextRead.ReadLine
ReDim Preserve arrKML(3,n) ' Initialize array 4 characters, at n entry
arrKML(0,n) = n ' add number
arrKML(1,n) = CDbl(trim(mid(strSearchString,1,11))) ' add long
arrKML(2,n) = CDbl(trim(mid(strSearchString,12,11))) ' add lat
arrKML(3,n) = (trim(mid(strSearchString,23,11))) ' add line number
n = n + 1 ' next iteration
Loop
objTextRead.Close
' ***********************************************************************
' msgbox "Number of elements in array: " & Ubound(arrKML,2)
dim currentLineName
currentLineName = arrKML(3,0)
filestreamOUT.WriteLine("<?xml version=" & chr(&H22) & "1.0" & chr(&H22) & " encoding=" & chr(&H22) & "UTF-8" & chr(&H22) & "?>")
filestreamOUT.WriteLine("<kml xmlns=" & chr(&H22) & "http://www.opengis.net/kml/2.2" & chr(&H22) & " xmlns:gx=" & chr(&H22) & "http://www.google.com/kml/ext/2.2" & chr(&H22) & " xmlns:kml=" & chr(&H22) & "http://www.opengis.net/kml/2.2" & chr(&H22) & " xmlns:atom=" & chr(&H22) & "http://www.w3.org/2005/Atom" & chr(&H22) & ">")
filestreamOUT.WriteLine("<Document id=" & chr(&H22) & "Phil Cremer's Cheesy nav2kml script" & chr(&H22) & ">")
filestreamOUT.WriteLine(vbtab & "<name>" & fname & "</name>")
filestreamOUT.WriteLine(vbtab & vbtab & "<Placemark id=" & chr(&H22) & currentLineName & chr(&H22) & ">")
filestreamOUT.WriteLine(vbtab & vbtab & vbtab & "<name>" & currentLineName & "</name>")
filestreamOUT.WriteLine(vbtab & vbtab & vbtab & "<LineString id=" & chr(&H22) & currentLineName & chr(&H22) & ">")
filestreamOUT.WriteLine(vbtab & vbtab & vbtab & vbtab & "<coordinates>")
for i = 0 to Ubound(arrKML,2)
dim lineName
lineName = arrKML(3,i)
if lineName <> currentLineName then ' if it's different put a marker in it.
filestreamOUT.WriteLine(vbtab & vbtab & vbtab & vbtab & "</coordinates>")
filestreamOUT.WriteLine(vbtab & vbtab & vbtab & "</LineString>")
filestreamOUT.WriteLine(vbtab & vbtab & vbtab & "</Placemark>")
filestreamOUT.WriteLine(vbtab & vbtab & "<Placemark id=" & chr(&H22) & lineName & chr(&H22) & ">")
filestreamOUT.WriteLine(vbtab & vbtab & vbtab & "<name>" & lineName & "</name>")
filestreamOUT.WriteLine(vbtab & vbtab & vbtab & "<LineString id=" & chr(&H22) & lineName & chr(&H22) & ">")
filestreamOUT.WriteLine(vbtab & vbtab & vbtab & vbtab & "<coordinates>")
currentLineName = lineName
else ' if it's the same put the coordiantes
filestreamOUT.WriteLine(vbtab & vbtab & vbtab & vbtab & vbtab & arrKML(1,i) & "," & arrKML(2,i) & ",0 ")
end if
next
filestreamOUT.WriteLine(vbtab & vbtab & vbtab & vbtab & "</coordinates>")
filestreamOUT.WriteLine(vbtab & vbtab & vbtab & "</LineString>")
filestreamOUT.WriteLine(vbtab & vbtab & "</Placemark>")
filestreamOUT.WriteLine("</Document>")
filestreamOUT.WriteLine("</kml>")
'for z = LBound(arrKML,2) to UBound(arrKML,2)
' filestreamOUT.WriteLine(arrKML(3,z))
'Next
'
filestreamOUT.Close()
Set filestreamOUT = Nothing
msgbox "Done!"
Like mentioned is really cheesy and really easy to write. You can probably do better job. If you can fix my sloppy code! All you have to do is safe what's in green to a text file and name it nav2kml.vbs in the directory of the navigation file. Your navigation file should be a follows.
-122.19785 37.5686 101A
-122.19785 37.56863 101A
-122.19785 37.56865 101A
My suggestion is to put your nav into an Excel spreadsheet and export it to a .prn file where the column width is set to 11. Long Lat Linename. If you need to modify stuff, it's pretty easy to figure out what needs to be changed to suit your needs. All the lines will be white written as one place. Write the output file as a *.kml. Import into GoogleEarth and whalla you get stuff like this!
![]() |
| Data from the San Francisco Bay. Brought in from some navigation file. |
Tuesday, September 6, 2011
The Other Side Under The Golden Gate Bridge
Okay... I got the whole kml thing down now it's a bit of a routine. Here's the other side of the San Francisco Bay survey. Why isn't there anything that GoogleEarth in all their FREE wisdom can put out where you can dump values from Excel or whereever and create these things. Sure, I can tire my brain out by creating scripts to do ONE thing.. but instead of making GoogleDoodles for Freddie Mercury's bday they can.. oh never mind .. here you go.
Ho hum. I got started on the other 1/4 of the data, over wrote the data. You get the picture. The SMT looks really ugly. For whatever reason, there's not an option to limit the number of "ticks" or shotpoints noted on the SEG-Y. Every 10th would at least be nice.
![]() |
| from the nav -> kml |
![]() |
| Imported SEG-Y from into SMT. Sorry about that pesky SnagIt |
Ho hum. I got started on the other 1/4 of the data, over wrote the data. You get the picture. The SMT looks really ugly. For whatever reason, there's not an option to limit the number of "ticks" or shotpoints noted on the SEG-Y. Every 10th would at least be nice.
Sunday, September 4, 2011
Mapping San Francisco Bay via GoogleEarth
Okay this is all new to me. Google Earth is a whole new to me. The thing to know is "KML" and "KMZ". Now, here's the big secret -> A KMZ is only a zipped KML file (there's probably more to it than that but that's it for now). Unfortunately, I have not found anything (yet) that can convert a navigation file to anything GoogleEarth can understand.
From the GoogleEarth perspective, you have to create paths. Of course, now these paths are the 2d lines but these lines are where the boat was floating around.
I was fiddling around with a VBScript to put everything in an array to automatically create a kml file but it seemed easier to do it by hand. See below
It all looks okay. And I remembered I only had 4 more days left on my SMT license... so I went and fixed all the EBCDIC headers on it and loaded it into SMT. It looks like it matches up. :)
Looks like everything's there. I'd be nice if I could go between the two but oh well. SMT looks terrible for 2d IMHO. There's probably a way around it but nothing stuck out in the viewing options. Is there ANY way to view the seismic apart from the navigation data. The nav data is great but the seismic (for whatever reason) has to display each shotpoint regardless of where you're viewing.
More later...
From the GoogleEarth perspective, you have to create paths. Of course, now these paths are the 2d lines but these lines are where the boat was floating around.
I was fiddling around with a VBScript to put everything in an array to automatically create a kml file but it seemed easier to do it by hand. See below
It all looks okay. And I remembered I only had 4 more days left on my SMT license... so I went and fixed all the EBCDIC headers on it and loaded it into SMT. It looks like it matches up. :)
Looks like everything's there. I'd be nice if I could go between the two but oh well. SMT looks terrible for 2d IMHO. There's probably a way around it but nothing stuck out in the viewing options. Is there ANY way to view the seismic apart from the navigation data. The nav data is great but the seismic (for whatever reason) has to display each shotpoint regardless of where you're viewing.
More later...
Subscribe to:
Posts (Atom)






