cultpenguin / segypy

Read and write SEGY formatted files using Python
Other
24 stars 15 forks source link

cannot read segy file #1

Open ring0o0o opened 6 years ago

ring0o0o commented 6 years ago

I was trying to use the testsegy.py to read segy file.But got an TypeError below. read segy: SegyPY 0.2 : readSegy : Trying to read GTZ_p14_p19.sgy 812417984 SegyPY 0.2 : getSegyHeader : succesfully read GTZ_p14_p19.sgy

TypeError Traceback (most recent call last) F:\convLstm\fft.py in () 8 start = time.time() 9 print(' read segy: ') ---> 10 Data, SH, STH = segypy.readSegy('GTZ_p14_p19.sgy') 11 print(time.time()-start) 12 start = time.time()

F:\convLstm\segypy.py in readSegy(filename) 531 532 printverbose("readSegy : Trying to read "+filename,0) --> 533 534 data = open(filename,'rb').read() 535

F:\convLstm\segypy.py in getAllSegyTraceHeaders(SH, data) 488 # AND THE TRACE NUMBER KEY FIELD 489 THpos=STH_def[THN]["pos"] --> 490 THformat=STH_def[THN]["type"] 491 ntraces=SH["ntraces"] 492

F:\convLstm\segypy.py in getSegyTraceHeader(SH, THN, data) 461 for itrace in range(1,int(ntraces+1),1): 462 i=itrace --> 463 464 pos=THpos+3600+(SH["ns"]bps+240)(itrace-1); 465

TypeError: 'float' object cannot be interpreted as an integer

marscfeng commented 6 years ago

You should choose a python2 env for segypy.

cultpenguin commented 6 years ago

Also. check out the new version 0.57.. It may have the 'float' error. Otherwise if you can share the sgy file, I can have a look.