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

Shot Ingestion Flexibility #180

Merged
merged 5 commits into from
Mar 4, 2023
Merged

Shot Ingestion Flexibility #180

merged 5 commits into from
Mar 4, 2023

Conversation

tasansal
Copy link
Collaborator

@tasansal tasansal commented Feb 17, 2023

Intro

Raw seismic exploration datasets are called shots, and they're typically stored in SEG-Y files.

The below concept represents the geometry of a 3D shot with a lot fewer streamers (aka. cables) and receivers (aka. channels) than an actual survey:

Cable 1 ->        / 1------------------20
Cable 2 ->       / 1------------------20
.               / 1------------------20
.          ⛴ ☆ - 1------------------20
.               \ 1------------------20
Cable 6 ->       \ 1------------------20
Cable 7 ->        \ 1------------------20

The represent an airgun array (aka. source or shot), and the - represents a channel on a streamer. In this example, we have a shot with 7 streamers, each with 20 receivers.

Problem

SEG-Y Revision 2.0 came out in 2017 with standards describing 3D offshore seismic surveys. However, any SEG-Y file made before that has no standard, and vendors may not provide all the necessary information in the headers.

We typically see 3D offshore shot datasets with the following pathologies:

Type Streamer ID Receiver ID Wrapped
A
B
C

Type A

This is the case that is showcased at the beginning. The SEG-Y file has the following

Cable:   1 1 ...  1  1 | 2 2 ...  2  2 | 3 3 ...  3  3 | ...... | ...  7  7 
Channel: 1 2 ... 19 20 | 1 2 ... 19 20 | 1 2 ... 19 20 | ...... | ... 19 20

Type B trace headers show:

Cable 1 ->        / 1------------------20
Cable 2 ->       / 21-----------------40
.               / 41-----------------60
.          ⛴ ☆ - 61-----------------80
.               \ 81----------------100
Cable 6 ->       \ 101---------------120
Cable 7 ->        \ 121---------------140

The SEG-Y file trace headers are like below:

Cable:   1 1 ...  1  1 |  2  2 ...  2  2 |  3  3 ...  3  3 | ...... | ...   7   7 
Channel: 1 2 ... 19 20 | 21 22 ... 39 40 | 41 42 ... 59 60 | ...... | ... 139 140

The translation here is simple: chan = (chan - 1) % N + 1 where N is the "channels per cable" which must be known.

Type C trace headers show:

Cable ? ->        / 1------------------20
Cable ? ->       / 21-----------------40
.               / 41-----------------60
.          ⛴ ☆ - 61-----------------80
.               \ 81----------------100
Cable ? ->       \ 101---------------120
Cable ? ->        \ 121---------------140

Cable translation: cable = floor((chan - 1) / N) + 1 where N is the "channels per cable" which must be known.
and we do the channels after this with the same formula as Type B.

Solution

To be able to ingest these legacy files to the correct geometry, we need to do some grid
manipulations. This PR addresses that.

We can specify options to:

  • Calculate the streamer numbers (from the original unwrapped channel and by knowing receivers per streamer)
  • Calculate the wrapped receiver numbers (from the original unwrapped channel and by knowing receivers per streamer)

Example (proposed) usages

Type A

Simplest, natural geometry of the file with cable numbers and wrapped channels.

segy_to_mdio(
    segy_path="prefix/shot_file.segy",
    mdio_path_or_buffer="s3://bucket/shot_file.mdio",
    index_bytes=(17, 137, 13),
    index_lengths=(4, 2, 4),
    index_names=("shot", "cable", "channel"),
    chunksize=(8, 2, 128, 1024),
)

Type B

Cable numbers exist, but channels numbers are unwrapped.
Note the addition of grid_overrides and the keywords ChannelWrap and ChannelsPerCable.

segy_to_mdio(
    segy_path="prefix/shot_file.segy",
    mdio_path_or_buffer="s3://bucket/shot_file.mdio",
    index_bytes=(17, 137, 13),
    index_lengths=(4, 2, 4),
    index_names=("shot", "cable", "channel"),
    chunksize=(8, 2, 128, 1024),
    grid_overrides={"ChannelWrap": True, "ChannelsPerCable": 800},
)

Type C

No cable numbers were provided, and unwrapped channels.
Note the modification of grid_overrides with an additional keyword: CalculateCable.
Also note that the "channel" header index bytes and lengths are set to None.

segy_to_mdio(
    segy_path="prefix/shot_file.segy",
    mdio_path_or_buffer="s3://bucket/shot_file.mdio",
    index_bytes=(17, None, 13),
    index_lengths=(4, None, 4),
    index_names=("shot", "cable", "channel"),
    chunksize=(8, 2, 128, 1024),
    grid_overrides={"ChannelWrap": True, "ChannelsPerCable": 800, "CalculateCable": True},
)

@tasansal tasansal added the enhancement New feature or request label Feb 17, 2023
@tasansal tasansal self-assigned this Feb 17, 2023
@tasansal tasansal marked this pull request as ready for review March 4, 2023 13:48
@codecov-commenter
Copy link

Codecov Report

Merging #180 (0824783) into main (c507dee) will decrease coverage by 1.02%.
The diff coverage is 4.34%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##             main     #180      +/-   ##
==========================================
- Coverage   81.62%   80.60%   -1.02%     
==========================================
  Files          43       43              
  Lines        1654     1676      +22     
  Branches      179      189      +10     
==========================================
+ Hits         1350     1351       +1     
- Misses        267      285      +18     
- Partials       37       40       +3     
Impacted Files Coverage Δ
src/mdio/converters/segy.py 75.36% <ø> (ø)
src/mdio/segy/_workers.py 20.89% <0.00%> (-2.06%) ⬇️
src/mdio/segy/utilities.py 60.78% <6.25%> (-24.93%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@tasansal tasansal merged commit af5995e into main Mar 4, 2023
@tasansal tasansal deleted the feature/shot_wrapping branch March 4, 2023 13:55
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.

2 participants