Skip to content
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 13 commits into from
Sep 18, 2024
Merged

Interpret SEG-Y revision in binary header #190

merged 13 commits into from
Sep 18, 2024

Conversation

tasansal
Copy link
Contributor

@tasansal tasansal commented Sep 12, 2024

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 forward transform (read).
  • Add backward transform (factory).
  • Add unit tests.

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.
@tasansal tasansal self-assigned this Sep 12, 2024
@tasansal tasansal added the enhancement New feature or request label Sep 12, 2024
Altay Sansal added 7 commits September 12, 2024 17:20
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.
Copy link

codecov bot commented Sep 12, 2024

Codecov Report

Attention: Patch coverage is 98.27586% with 1 line in your changes missing coverage. Please review.

Project coverage is 95.25%. Comparing base (acd94db) to head (40fcc65).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
tests/test_transforms.py 96.77% 0 Missing and 1 partial ⚠️
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.
📢 Have feedback on the report? Share it here.

Altay Sansal added 5 commits September 18, 2024 13:31
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.
@tasansal tasansal merged commit a363570 into main Sep 18, 2024
30 checks passed
@tasansal tasansal deleted the interpret-revision branch September 18, 2024 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant