segypy
segypy copied to clipboard
value=STH[key][itrace] KeyError: 'Inline3D'
Hi, I encountered a strange KeyError when writing back the sucsessfully read Data: IDLE 2.7.3 Module numpy-1.13.3. Every time when I call STH[key][itrace] in any variation (as STH ['Inline3D'] [1] or whatever) i get this error. ... line 804, in writeSegyStructure print STH ['Inline3D'] [1] KeyError: 'Inline3D' I wonder, when all the data is read successfuly the writing shouldn't be a problem... Maybe you have an idea about this error? The sgy-file coud be provided when needed. Thanks a lot! Andreas
The testsegy.py-file is:
#!/usr/bin/env python
#
# testsegy.py
#
import struct
import segypy52017 as segypy
filename="POTDG9408_MIGRATION.sgy"
# Set verbose level
segypy.verbose=1;
# Read Segy File
Data,SH,STH=segypy.readSegy(filename);
print ("Data: ",len(Data))
print ("SH: ",len(SH))
print ("STH: ",len(STH))
filename_out='testout.segy';
SH['DataSampleFormat']=1;
SH['SegyFormatRevisionNumber']=0;
segypy.writeSegyStructure(filename_out,Data,SH,STH);
#segypy.wiggle(Data,SH,2,.1,.1)
print ("----------------Ende-----------------------")
exit
('SegyPY0.3.1: ', 'readSegy : Trying to read POTDG9408_MIGRATION.sgy') ('SegyPY0.3.1: ', 'getSegyHeader : succesfully read POTDG9408_MIGRATION.sgy') ('SegyPY0.3.1: ', 'bps= 4') ('SegyPY0.3.1: ', 'nd=1583224') ('SegyPY0.3.1: ', 'readSegyData : Reading segy data') ('SegyPY0.3.1: ', 'readSegyData : SEG-Y revision = 1') ('SegyPY0.3.1: ', 'readSegyData : DataSampleFormat=1(IBM Float)') ('SegyPY0.3.1: ', 'readSegyData : Finished reading segy data') ('Data: ', 2651) ('SH: ', 33) ('STH: ', 1) ('SegyPY0.3.1: ', 'writeSegyStructure : Trying to write testout.segy') ('SegyPY0.3.1: ', 'writeSegyStructure : SEG-Y revision = 0') ('SegyPY0.3.1: ', 'writeSegyStructure : DataSampleFormat=1(IBM Float)')
Traceback (most recent call last):
File "D:\Andi\ownCloud\LBGR\image2segy\testsegy52017.py", line 27, in
HI. Sorry I did not see your issue before. If you can provide access to the SGY file it would be great I do not get the error when I try. There might be a problem wiring DataSampleFormat 1