-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Non-standard headers loading #6
Conversation
Co-authored-by: Alexander Kuvaev <[email protected]>
Co-authored-by: Alexander Kuvaev <[email protected]>
Co-authored-by: Alexander Kuvaev <[email protected]>
Co-authored-by: Alexander Kuvaev <[email protected]>
Co-authored-by: Alexander Kuvaev <[email protected]>
Co-authored-by: Alexander Kuvaev <[email protected]>
Co-authored-by: Alexander Kuvaev <[email protected]>
Co-authored-by: Alexander Kuvaev <[email protected]>
Co-authored-by: Alexander Kuvaev <[email protected]>
Co-authored-by: Alexander Kuvaev <[email protected]>
segfast/loader.py
Outdated
@@ -5,7 +5,7 @@ | |||
|
|||
|
|||
def Loader(path, engine='memmap', endian='big', strict=False, ignore_geometry=True): | |||
""" !!. """ | |||
""" SEG-Y loader. """ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Selector class for loading SEG-Y with either segyio-based loader or memmap-based one.
Make class references links, so they would be cool (and useful) in the doc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will be the next PR (see docs branch here https://github.com/AlexeyKozhevin/segfast/tree/docs)
elif unused_len < 0: | ||
raise ValueError(f'{header.name} header overlap') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, does not violates anything (the loading of overlapping headers should still work just fine), but we probably don't want to even give the option
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to make overlaped headers, we will have to rewrite all the part with 'unused_*'
in dtype. I don't see any reasons to do it.
segfast/utils.py
Outdated
@@ -35,6 +37,112 @@ def update(self, n=1): | |||
notifier = Notifier | |||
|
|||
|
|||
class TraceHeaderSpec: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, add to_tuple
/ to_dict
method: motivation is to keep track of actually used headers in, for example, Geometry
class of seismiqb
.
In the same vain, I would think about returning list of TraceHeaderSpec
instances out of Loader.load_headers
methods, so that you have a detailed info on what was actually loaded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a make_headers_specs
method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The returned specs may differ from those returned by make_headers_specs
, I'll add such an option in my PR later today
load_headers
loads non-standard header by its start byte position and dtype.'>f4'
)TraceHeaderSpec
classExample: