Comments (12)
The error message at the bottom tells you what the problem is. The ensemble fold attribute in your SEG-Y binary reel header has a value of 51614, whereas the SEG-Y specification only allows for values in the range 0 to 32767.
From the SEG-Y revision 1 spec, page 3:
"All values in the Binary File Header and the Trace Header are two's complement integers, either two bytes or four bytes long."
At the bottom of page 6 you will see that Ensemble fold is a two-byte value occupying the one-based file offsets 3227 and 3228.
Signed (i.e. two's complement), two-byte integers can only represent positive values in the range 0-32767.
In other words, your SEG-Y data doesn't comply with the SEG-Y specification.
You can work around this with Segpy by providing a custom binary_reel_header_format
specification to create_reader()
. The easiest way to do that is to subclass segpy.binary_reel_header.BinaryReelHeader
to override the definition of ensemble_fold
, giving it a different type.
from segpy.
Dear Sir,
Thank you so much. Can you guide me how and where to write the line in the script? as I am very new in Python. and if you can guide what exactly I should write.?
from segpy.
what I understood from you is that
inline_number = field(
Int32, offset=189, default=0, documentation=
"""In-line number for 3-D poststack data. If one in-line per SEG Y file is
being recorded, this value should be the same for all traces in the
file and the same value will be recorded in bytes 3205-3208 of the
Binary File Header.""" # TODO: replace bytes with field name
)
here I can override..?? Please if you can guide me.. how and what?
from segpy.
The error you reported mentions nothing about inline_number
being a problem. It is the ensemble_fold
attribute in your binary reel header which is out of range. The custom_header.py example shows how to override a custom header definition. You should be able to apply the ideas from this to your own code.
from segpy.
Nice.. should I just put this file there? or replace with header.py?
The inline ranges form 400-3900
and xline 7100-5200
from segpy.
Neither. You need to read it, understand it, and then apply the same ideas to your own program.
If you need help to actually write your own software which uses Segpy, my consulting company Sixty North can help with that. I'm afraid I don't have the time to provide you with consulting for free through this channel.
from segpy.
from segpy.
By default, Segpy reads in big-endian, the same as the SEG-Y revision 1 standard.
You can override this to force little-endian behaviour by passing the argument endian='<'
to the call to create_reader()
.
Segpy does not yet support SEG-Y revision 2. See #52.
from segpy.
from segpy.
I'm sorry. I'm very busy and I really don't have time to help you for free. I've pointed you at examples which use custom headers. The README.rst file shows how to set the endianness.
Please contact my consulting company Sixty North if you or your employer need further assistance and are in a position to pay for it, or to fund improved documentation.
In the meantime, if you need to improve your understanding of Python in general, I recommend taking some courses such as those from Pluralsight.
from segpy.
Respected sir/Madam
I am getting the following error while trying to make 'create_reader' using segpy.reader.Please help me out in this regards
ValueError Traceback (most recent call last)
in ()
1 filename='/content/Seismic_data.sgy'
2 with open(filename,'rb') as segy:
----> 3 segy_reader=segpy.reader.create_reader(segy, )
4 data=np.zeros((segy_reader.num_inlines(),segy_reader.num_trace_samples(1),segy_reader.num_xlines()))
5 for inline_num,xline_num in segy_reader.inline_xline_numbers():
/usr/local/lib/python3.7/dist-packages/segpy/reader.py in create_reader(fh, encoding, binary_reel_header_format, trace_header_format, endian, progress, cache_directory, dimensionality)
126 "SEG Y file {!r} of {} bytes is too short".format(
127 filename_from_handle(fh),
--> 128 num_file_bytes))
129
130 if endian not in {'<', '>'}:
ValueError: SEG Y file '/content/Seismic_data.sgy' of 2220 bytes is too short
from segpy.
@576dhunu SEG-Y files should have a 3600 byte header before the trace data (3200 text header + 400 byte binary header). The file you're providing is apparently only 2220 bytes long, so isn't longer enough to contain the header, hence: "SEG Y file '/content/Seismic_data.sgy' of 2220 bytes is too short"
from segpy.
Related Issues (20)
- Fix invalid license change in `segpy-lite` HOT 4
- `_cdp_catalog` can be `None` in `SegYReader2D.cdp_numbers`. HOT 5
- `header()` strategy produces unusable binary reel headers HOT 11
- Investigate using AFL to generate SEG-Y files for testing
- Sporadic health-check failures for `test_regular_mapping` HOT 1
- Small error in segpy-numpy
- Confusion about dimensionality detection heuristic HOT 3
- Python <= 3.4 compatibility
- Use plugins and named extensions for trace headers HOT 3
- Use our exit-codes modules for exit codes
- how to get data HOT 3
- How to read latitude/longitude or xcoordinate/ycoordinate information?? HOT 17
- Unable to read shot_gather.sgy file with error: ValueError: Assigned value 43690 for num_samples HOT 1
- How to process the massive data? HOT 1
- How to read minimum and maximum values of time (ms) from .sgy files using segpy or any other seismic reader library?
- Read illegal trace lengths? HOT 5
- cannot get the trace header HOT 1
- Mapping, Sequence and Iterable are not referenced
- TraceHeaderRev0 is not compatible with CatalogSubFormat
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from segpy.