-
Notifications
You must be signed in to change notification settings - Fork 3
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
Interpret SEG-Y revision in binary header #190
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Introduced a new `SegyRevisionTransform` class to interpret the SEG-Y revision field in the binary header. This transform has been added to the `transform_map` and applied in the SEG-Y file processing pipeline. The code raises a `NotImplementedError` for SEG-Y revisions 2 and above.
Add a check to exit the transform method early if the SEGY revision is zero. This avoids unnecessary processing and potential errors when the revision is not set or is invalid.
Updated the transform method to check for the presence of the 'segy_revision' field in the data's dtype. This ensures compatibility with data structures that may not contain the 'segy_revision' key.
This change eliminates the exception raised for SEGY revision 2 or higher, allowing the code to continue without interruption. The revision interpretation for Rev2+ will need to be handled appropriately in the future.
Revised the `transform` method to enhance parsing of SEG-Y revisions from the binary header. Added detailed handling for SEG-Y Rev1 and simplified processing for Rev2 to ensure accurate interpretation based on the binary format.
Updated the calculation of the SEGY revision to specify that the division by 256.0 is based on hexadecimal representation. This enhances code readability and helps avoid potential confusion for future maintainers.
Standardize the logic for setting SEGY revisions and include minor version information for revisions above REV1. This ensures proper version encoding and enhances compatibility with higher SEGY standards.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #190 +/- ##
==========================================
+ Coverage 95.18% 95.25% +0.06%
==========================================
Files 47 48 +1
Lines 2140 2191 +51
Branches 251 261 +10
==========================================
+ Hits 2037 2087 +50
Misses 79 79
- Partials 24 25 +1 ☔ View full report in Codecov by Sentry. |
Refactored how SEG-Y revisions are parsed and applied within the transform pipelines. Introduced better handling for integer-based Rev1 and separated handling for major and minor revisions in Rev2. Added comprehensive tests for different endianness and revision versions to ensure reliability.
Refactored the segy_revision property to ensure a default value of SegyStandard.REV0 when the segy_standard is None. Removed redundant checks in the create_textual_header method and cleaned up type-ignore comments in the test cases. This improves readability and robustness of the SEG-Y factory code.
Updated the SegyFactoryTestConfig class to allow segy_standard to be None. This change expands the test configurations to include cases where segy_standard is not specified.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Introduced a new
SegyRevisionTransform
class to interpret the SEG-Y revision field in the binary header. This transform has been added to thetransform_map
and applied in the SEG-Y file processing pipeline. The code raises aNotImplementedError
for SEG-Y revisions 2 and above.