-
Notifications
You must be signed in to change notification settings - Fork 15
Add Seismic3DStreamerFieldRecords template
#675
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
Merged
Merged
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
e7a1a3d
Add template for efficient storage of pre-stack data.
markspec 810ad68
Resolve linting issues in seismic_prestack.py
markspec a114ba4
Add test to cover prestack template.
markspec 65f4562
Linting update.
markspec 0dbd334
Fix docsting for SeismicPreStackTemplate.
markspec 9bb161d
Adjust PreStackGathers3DTime template
dmitriyrepin b9a36c7
touch
dmitriyrepin 4373330
Precomit
dmitriyrepin 6d88a2b
Fix unit tests
dmitriyrepin 85af57e
Fix import
BrianMichell c10f6ad
Update attribute name
BrianMichell f89de1d
Rename source files
BrianMichell c6b9936
Rename template name
BrianMichell a6a67b0
Update todo message
BrianMichell 70ee9b2
Alignment with current unit testing standards
BrianMichell a7803f7
Use more correct template name
BrianMichell 7b3eb5e
pre-commit
BrianMichell fe02c38
Update doc string
BrianMichell 28ee56b
rename streamer field data template
tasansal adcd7c9
fix broken template tests
tasansal 893f5d2
fix broken test
tasansal 5e5bd5a
update docstring
tasansal 690e41e
add whole survey to docstring
tasansal b28aafd
modify for new dim names
tasansal 8a4787d
fix geometry calculation by adding the new `shot_index` field
tasansal e4790dd
lint
tasansal 233afef
update `shot_index` dtype to uint32 and add `calculated_dims` property
tasansal dd99f20
exclude `calculated_dimension_names` from `horizontal_coordinates`
tasansal 8e3a1c9
update test cases and geometry calculation to reflect changes in cabl…
tasansal e9bcf40
header -> grid
tasansal 0d77df4
fix shot index calculation
tasansal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
104 changes: 104 additions & 0 deletions
104
src/mdio/builder/templates/seismic_3d_streamer_field.py
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,104 @@ | ||
| """Seismic3DStreamerFieldRecordsTemplate MDIO v1 dataset templates.""" | ||
|
|
||
| from typing import Any | ||
|
|
||
| from mdio.builder.schemas.dtype import ScalarType | ||
| from mdio.builder.schemas.v1.variable import CoordinateMetadata | ||
| from mdio.builder.templates.base import AbstractDatasetTemplate | ||
| from mdio.builder.templates.types import SeismicDataDomain | ||
|
|
||
|
|
||
| class Seismic3DStreamerFieldRecordsTemplate(AbstractDatasetTemplate): | ||
| """Seismic 3D streamer shot field records template. | ||
| A generalized template for streamer field records that are optimized for: | ||
| - Common-shot access | ||
| - Common-channel access | ||
| It can also store all the shot-lines of a survey in one MDIO if needed. | ||
| Args: | ||
| data_domain: The domain of the dataset. | ||
| """ | ||
|
|
||
| def __init__(self, data_domain: SeismicDataDomain = "time"): | ||
| super().__init__(data_domain=data_domain) | ||
|
|
||
| self._spatial_dim_names = ("sail_line", "gun", "shot_index", "cable", "channel") | ||
| self._calculated_dims = ("shot_index",) | ||
| self._dim_names = (*self._spatial_dim_names, self._data_domain) | ||
| self._physical_coord_names = ("source_coord_x", "source_coord_y", "group_coord_x", "group_coord_y") | ||
| self._logical_coord_names = ("shot_point", "orig_field_record_num") # ffid | ||
| self._var_chunk_shape = (1, 1, 16, 1, 32, 1024) | ||
|
|
||
| @property | ||
| def _name(self) -> str: | ||
| return "StreamerFieldRecords3D" | ||
|
|
||
| def _load_dataset_attributes(self) -> dict[str, Any]: | ||
| return {"surveyDimensionality": "3D", "ensembleType": "common_source_by_gun"} | ||
|
|
||
| def _add_coordinates(self) -> None: | ||
| # Add dimension coordinates | ||
| # EXCLUDE: `shot_index` since its 0-N | ||
| self._builder.add_coordinate( | ||
| "sail_line", | ||
| dimensions=("sail_line",), | ||
| data_type=ScalarType.UINT32, | ||
tasansal marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ) | ||
| self._builder.add_coordinate( | ||
| "gun", | ||
| dimensions=("gun",), | ||
| data_type=ScalarType.UINT8, | ||
| ) | ||
| self._builder.add_coordinate( | ||
| "cable", | ||
| dimensions=("cable",), | ||
| data_type=ScalarType.UINT8, | ||
| ) | ||
| self._builder.add_coordinate( | ||
| "channel", | ||
| dimensions=("channel",), | ||
| data_type=ScalarType.UINT16, | ||
| ) | ||
| self._builder.add_coordinate( | ||
| self._data_domain, | ||
| dimensions=(self._data_domain,), | ||
| data_type=ScalarType.INT32, | ||
| ) | ||
|
|
||
| # Add non-dimension coordinates | ||
| self._builder.add_coordinate( | ||
| "orig_field_record_num", | ||
| dimensions=("sail_line", "gun", "shot_index"), | ||
| data_type=ScalarType.UINT32, | ||
| ) | ||
| self._builder.add_coordinate( | ||
| "shot_point", | ||
| dimensions=("sail_line", "gun", "shot_index"), | ||
| data_type=ScalarType.UINT32, | ||
| ) | ||
| self._builder.add_coordinate( | ||
| "source_coord_x", | ||
| dimensions=("sail_line", "gun", "shot_index"), | ||
| data_type=ScalarType.FLOAT64, | ||
| metadata=CoordinateMetadata(units_v1=self.get_unit_by_key("source_coord_x")), | ||
| ) | ||
| self._builder.add_coordinate( | ||
| "source_coord_y", | ||
| dimensions=("sail_line", "gun", "shot_index"), | ||
| data_type=ScalarType.FLOAT64, | ||
| metadata=CoordinateMetadata(units_v1=self.get_unit_by_key("source_coord_y")), | ||
| ) | ||
| self._builder.add_coordinate( | ||
| "group_coord_x", | ||
| dimensions=("sail_line", "gun", "shot_index", "cable", "channel"), | ||
| data_type=ScalarType.FLOAT64, | ||
| metadata=CoordinateMetadata(units_v1=self.get_unit_by_key("group_coord_x")), | ||
| ) | ||
| self._builder.add_coordinate( | ||
| "group_coord_y", | ||
| dimensions=("sail_line", "gun", "shot_index", "cable", "channel"), | ||
| data_type=ScalarType.FLOAT64, | ||
| metadata=CoordinateMetadata(units_v1=self.get_unit_by_key("group_coord_y")), | ||
| ) | ||
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.