sbpio 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
sbpio-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Ali Mohamed
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
sbpio-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,199 @@
1
+ Metadata-Version: 2.4
2
+ Name: sbpio
3
+ Version: 0.1.0
4
+ Summary: Sub-Bottom Profiler (SBP) seismic data I/O and processing toolkit
5
+ Author-email: Ali Mohamed <aliarafa327@gmail.com>
6
+ License: MIT License
7
+
8
+ Copyright (c) 2024 Ali Mohamed
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Project-URL: Homepage, https://github.com/PG-Ali-E-Mohamed/sbpio
29
+ Project-URL: Repository, https://github.com/PG-Ali-E-Mohamed/sbpio
30
+ Project-URL: Issues, https://github.com/PG-Ali-E-Mohamed/sbpio/issues
31
+ Project-URL: Changelog, https://github.com/PG-Ali-E-Mohamed/sbpio/blob/main/CHANGELOG.md
32
+ Keywords: sub-bottom profiler,SBP,SEG-Y,marine geophysics,seismic processing,oceanography
33
+ Classifier: Development Status :: 3 - Alpha
34
+ Classifier: Intended Audience :: Science/Research
35
+ Classifier: License :: OSI Approved :: MIT License
36
+ Classifier: Programming Language :: Python :: 3
37
+ Classifier: Programming Language :: Python :: 3.8
38
+ Classifier: Programming Language :: Python :: 3.9
39
+ Classifier: Programming Language :: Python :: 3.10
40
+ Classifier: Programming Language :: Python :: 3.11
41
+ Classifier: Programming Language :: Python :: 3.12
42
+ Classifier: Operating System :: OS Independent
43
+ Requires-Python: >=3.8
44
+ Description-Content-Type: text/markdown
45
+ License-File: LICENSE
46
+ Requires-Dist: matplotlib>=3.3
47
+ Requires-Dist: numpy>=1.20
48
+ Requires-Dist: pandas>=1.3
49
+ Requires-Dist: geopandas>=0.10
50
+ Requires-Dist: segyio>=1.9
51
+ Requires-Dist: tqdm>=4.50
52
+ Requires-Dist: scikit-image>=0.2
53
+ Requires-Dist: shapely>=1.8
54
+ Requires-Dist: pyproj>=3.1
55
+ Requires-Dist: scipy>=1.7
56
+ Provides-Extra: dev
57
+ Requires-Dist: pytest>=7.0; extra == "dev"
58
+ Requires-Dist: pytest-cov>=3.0; extra == "dev"
59
+ Requires-Dist: black>=22.0; extra == "dev"
60
+ Requires-Dist: isort>=5.0; extra == "dev"
61
+ Requires-Dist: flake8>=4.0; extra == "dev"
62
+ Requires-Dist: build; extra == "dev"
63
+ Requires-Dist: twine; extra == "dev"
64
+ Dynamic: license-file
65
+
66
+ # sbpio
67
+
68
+ **Sub-Bottom Profiler I/O and Processing Toolkit**
69
+
70
+ A Python library for reading, processing, and writing sub-bottom profiler (SBP) data stored in SEG-Y format.
71
+
72
+ ---
73
+
74
+ ## Features
75
+
76
+ - Load SEG-Y SBP files
77
+ - Apply duplicate-trace removal
78
+ - Apply time-varying gain (TVG) with built-in or custom functions
79
+ - Recording-delay time correction
80
+ - Water-column and multiple muting
81
+ - Shot-point navigation extraction, reprojection, and shapefile export
82
+ - Cropping in specific time and traces ranges or within ROI polygon
83
+ - Coordinate reprojection (e.g., from arc seconds to UTM)
84
+ - One-shot `write_processed()` pipeline for batch export
85
+
86
+ ---
87
+
88
+ ## Installation
89
+
90
+ ### From PyPI
91
+
92
+ ```bash
93
+ pip install sbpio
94
+ ```
95
+
96
+ ### From GitHub
97
+
98
+ ```bash
99
+ pip install git+https://github.com/PG-Ali-E-Mohamed/sbpio.git
100
+ ```
101
+
102
+ ## Quick Start
103
+
104
+ ```python
105
+ from sbpio import sbp
106
+
107
+ # Open a SEG-Y file
108
+ data = sbp("profile.segy")
109
+
110
+ # Display the envelope attribute
111
+ data.show()
112
+
113
+ # One-shot processing pipeline
114
+ data.write_processed(
115
+ "output.segy",
116
+ correct_delay=True,
117
+ tvg={"method": 3, "kwargs": {"n": 0.2}},
118
+ recoverable_penetration=200,
119
+ out_projection="EPSG:32618",
120
+ )
121
+ ```
122
+
123
+ ---
124
+
125
+ ## API Overview
126
+
127
+ ### `sbp` class
128
+
129
+ The main entry point.
130
+
131
+ | Method | Description |
132
+ |---|---|
133
+ | `sbp(fname)` | Open a SEG-Y file |
134
+ | `.load()` | Load traces and optionally compute envelope |
135
+ | `.show()` | Display the profile |
136
+ | `.tvg_gain()` | Apply time-varying gain |
137
+ | `.correct_delay()` | Correct recording delay |
138
+ | `.clean_water_column()` | Mute the water column |
139
+ | `.clean_below_seafloor()` | Mute below seafloor + offset |
140
+ | `.crop()` | Define a time/trace crop window |
141
+ | `.write()` | Write to SEG-Y |
142
+ | `.write_processed()` | Full pipeline in one call |
143
+
144
+ ### `nav` class
145
+
146
+ Accessed via `data.navs`.
147
+
148
+ | Method | Description |
149
+ |---|---|
150
+ | `.shot_points()` | Extract navigation from headers |
151
+ | `.coords_2_utm()` | Reproject coordinates to UTM |
152
+ | `.to_shp(outfile)` | Export to shapefile (line or points) |
153
+
154
+ ### TVG methods
155
+
156
+ Three built-in gain functions are available via `tvg_gain(method=N)`:
157
+
158
+ | Key | Function | Formula |
159
+ |---|---|---|
160
+ | `1` | `power_gain_1` | `(a·t + b)^n` |
161
+ | `2` | `power_gain_2` | `t^n` |
162
+ | `3` | `power_gain_3` | `(t/dt)^n` |
163
+
164
+ The default is `tv_gamma` — a time-varying gamma correction that progressively brightens sub-seafloor reflections.
165
+
166
+ Pass a custom callable with signature `f(t, traces, **kwargs)` for full control.
167
+
168
+ ---
169
+
170
+ ## SEG-Y Conventions
171
+
172
+ sbpio follows standard SEG-Y Rev 1 trace header fields:
173
+
174
+ | Field | Byte location |
175
+ |---|---|
176
+ | Source X | 73 |
177
+ | Source Y | 77 |
178
+ | SourceGroupScalar | 69 |
179
+ | CoordinateUnits | 89 |
180
+ | DelayRecordingTime | 109 |
181
+ | SourceWaterDepth | 61 |
182
+ | EnergySourcePoint | 17 |
183
+
184
+ ---
185
+
186
+ ## Dependencies
187
+
188
+ | Package | Purpose |
189
+ |---|---|
190
+ | `segyio` | SEG-Y read/write |
191
+ | `numpy` | Array operations |
192
+ | `pandas` | Tabular data (navigation) |
193
+ | `geopandas` | Shapefile I/O |
194
+ | `shapely` | Geometry operations |
195
+ | `pyproj` | Coordinate reprojection |
196
+ | `matplotlib` | Plotting |
197
+ | `scikit-image` | Image enhancement and resize |
198
+ | `tqdm` | Progress bars |
199
+ | `scipy` | Interpolation/ Envelope calculation |
sbpio-0.1.0/README.md ADDED
@@ -0,0 +1,134 @@
1
+ # sbpio
2
+
3
+ **Sub-Bottom Profiler I/O and Processing Toolkit**
4
+
5
+ A Python library for reading, processing, and writing sub-bottom profiler (SBP) data stored in SEG-Y format.
6
+
7
+ ---
8
+
9
+ ## Features
10
+
11
+ - Load SEG-Y SBP files
12
+ - Apply duplicate-trace removal
13
+ - Apply time-varying gain (TVG) with built-in or custom functions
14
+ - Recording-delay time correction
15
+ - Water-column and multiple muting
16
+ - Shot-point navigation extraction, reprojection, and shapefile export
17
+ - Cropping in specific time and traces ranges or within ROI polygon
18
+ - Coordinate reprojection (e.g., from arc seconds to UTM)
19
+ - One-shot `write_processed()` pipeline for batch export
20
+
21
+ ---
22
+
23
+ ## Installation
24
+
25
+ ### From PyPI
26
+
27
+ ```bash
28
+ pip install sbpio
29
+ ```
30
+
31
+ ### From GitHub
32
+
33
+ ```bash
34
+ pip install git+https://github.com/PG-Ali-E-Mohamed/sbpio.git
35
+ ```
36
+
37
+ ## Quick Start
38
+
39
+ ```python
40
+ from sbpio import sbp
41
+
42
+ # Open a SEG-Y file
43
+ data = sbp("profile.segy")
44
+
45
+ # Display the envelope attribute
46
+ data.show()
47
+
48
+ # One-shot processing pipeline
49
+ data.write_processed(
50
+ "output.segy",
51
+ correct_delay=True,
52
+ tvg={"method": 3, "kwargs": {"n": 0.2}},
53
+ recoverable_penetration=200,
54
+ out_projection="EPSG:32618",
55
+ )
56
+ ```
57
+
58
+ ---
59
+
60
+ ## API Overview
61
+
62
+ ### `sbp` class
63
+
64
+ The main entry point.
65
+
66
+ | Method | Description |
67
+ |---|---|
68
+ | `sbp(fname)` | Open a SEG-Y file |
69
+ | `.load()` | Load traces and optionally compute envelope |
70
+ | `.show()` | Display the profile |
71
+ | `.tvg_gain()` | Apply time-varying gain |
72
+ | `.correct_delay()` | Correct recording delay |
73
+ | `.clean_water_column()` | Mute the water column |
74
+ | `.clean_below_seafloor()` | Mute below seafloor + offset |
75
+ | `.crop()` | Define a time/trace crop window |
76
+ | `.write()` | Write to SEG-Y |
77
+ | `.write_processed()` | Full pipeline in one call |
78
+
79
+ ### `nav` class
80
+
81
+ Accessed via `data.navs`.
82
+
83
+ | Method | Description |
84
+ |---|---|
85
+ | `.shot_points()` | Extract navigation from headers |
86
+ | `.coords_2_utm()` | Reproject coordinates to UTM |
87
+ | `.to_shp(outfile)` | Export to shapefile (line or points) |
88
+
89
+ ### TVG methods
90
+
91
+ Three built-in gain functions are available via `tvg_gain(method=N)`:
92
+
93
+ | Key | Function | Formula |
94
+ |---|---|---|
95
+ | `1` | `power_gain_1` | `(a·t + b)^n` |
96
+ | `2` | `power_gain_2` | `t^n` |
97
+ | `3` | `power_gain_3` | `(t/dt)^n` |
98
+
99
+ The default is `tv_gamma` — a time-varying gamma correction that progressively brightens sub-seafloor reflections.
100
+
101
+ Pass a custom callable with signature `f(t, traces, **kwargs)` for full control.
102
+
103
+ ---
104
+
105
+ ## SEG-Y Conventions
106
+
107
+ sbpio follows standard SEG-Y Rev 1 trace header fields:
108
+
109
+ | Field | Byte location |
110
+ |---|---|
111
+ | Source X | 73 |
112
+ | Source Y | 77 |
113
+ | SourceGroupScalar | 69 |
114
+ | CoordinateUnits | 89 |
115
+ | DelayRecordingTime | 109 |
116
+ | SourceWaterDepth | 61 |
117
+ | EnergySourcePoint | 17 |
118
+
119
+ ---
120
+
121
+ ## Dependencies
122
+
123
+ | Package | Purpose |
124
+ |---|---|
125
+ | `segyio` | SEG-Y read/write |
126
+ | `numpy` | Array operations |
127
+ | `pandas` | Tabular data (navigation) |
128
+ | `geopandas` | Shapefile I/O |
129
+ | `shapely` | Geometry operations |
130
+ | `pyproj` | Coordinate reprojection |
131
+ | `matplotlib` | Plotting |
132
+ | `scikit-image` | Image enhancement and resize |
133
+ | `tqdm` | Progress bars |
134
+ | `scipy` | Interpolation/ Envelope calculation |
@@ -0,0 +1,103 @@
1
+ [build-system]
2
+ requires = ["setuptools>=64", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ # ---------------------------------------------------------------------------
6
+ # Project metadata (PEP 621)
7
+ # ---------------------------------------------------------------------------
8
+
9
+ [project]
10
+ name = "sbpio"
11
+ version = "0.1.0"
12
+ description = "Sub-Bottom Profiler (SBP) seismic data I/O and processing toolkit"
13
+ readme = "README.md"
14
+ license = { file = "LICENSE" }
15
+ requires-python = ">=3.8"
16
+ authors = [
17
+ { name = "Ali Mohamed", email = "aliarafa327@gmail.com" },
18
+ ]
19
+ keywords = [
20
+ "sub-bottom profiler",
21
+ "SBP",
22
+ "SEG-Y",
23
+ "marine geophysics",
24
+ "seismic processing",
25
+ "oceanography",
26
+ ]
27
+ classifiers = [
28
+ "Development Status :: 3 - Alpha",
29
+ "Intended Audience :: Science/Research",
30
+ "License :: OSI Approved :: MIT License",
31
+ "Programming Language :: Python :: 3",
32
+ "Programming Language :: Python :: 3.8",
33
+ "Programming Language :: Python :: 3.9",
34
+ "Programming Language :: Python :: 3.10",
35
+ "Programming Language :: Python :: 3.11",
36
+ "Programming Language :: Python :: 3.12",
37
+ "Operating System :: OS Independent",
38
+ ]
39
+
40
+ # ---------------------------------------------------------------------------
41
+ # Runtime dependencies
42
+ # ---------------------------------------------------------------------------
43
+
44
+ dependencies = [
45
+ "matplotlib>=3.3",
46
+ "numpy>=1.20",
47
+ "pandas>=1.3",
48
+ "geopandas>=0.10",
49
+ "segyio>=1.9",
50
+ "tqdm>=4.50",
51
+ "scikit-image>=0.2",
52
+ "shapely>=1.8",
53
+ "pyproj>=3.1",
54
+ "scipy>=1.7",
55
+ ]
56
+
57
+ # ---------------------------------------------------------------------------
58
+ # Optional / development dependencies
59
+ # ---------------------------------------------------------------------------
60
+
61
+ [project.optional-dependencies]
62
+ dev = [
63
+ "pytest>=7.0",
64
+ "pytest-cov>=3.0",
65
+ "black>=22.0",
66
+ "isort>=5.0",
67
+ "flake8>=4.0",
68
+ "build",
69
+ "twine",
70
+ ]
71
+
72
+ # ---------------------------------------------------------------------------
73
+ # URLs shown on PyPI
74
+ # ---------------------------------------------------------------------------
75
+
76
+ [project.urls]
77
+ Homepage = "https://github.com/PG-Ali-E-Mohamed/sbpio"
78
+ Repository = "https://github.com/PG-Ali-E-Mohamed/sbpio"
79
+ Issues = "https://github.com/PG-Ali-E-Mohamed/sbpio/issues"
80
+ Changelog = "https://github.com/PG-Ali-E-Mohamed/sbpio/blob/main/CHANGELOG.md"
81
+
82
+ # ---------------------------------------------------------------------------
83
+ # Package discovery
84
+ # ---------------------------------------------------------------------------
85
+
86
+ [tool.setuptools.packages.find]
87
+ include = ["sbpio*"]
88
+
89
+ # ---------------------------------------------------------------------------
90
+ # Tool configuration
91
+ # ---------------------------------------------------------------------------
92
+
93
+ [tool.black]
94
+ line-length = 88
95
+ target-version = ["py38", "py39", "py310", "py311"]
96
+
97
+ [tool.isort]
98
+ profile = "black"
99
+
100
+ [tool.pytest.ini_options]
101
+ testpaths = ["tests"]
102
+ addopts = "-v --tb=short"
103
+ filterwarnings = ["ignore::DeprecationWarning"]
@@ -0,0 +1,87 @@
1
+ """
2
+ sbpio — Sub-Bottom Profiler I/O and Processing Toolkit
3
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4
+
5
+ Read, process, and write sub-bottom profiler (SBP) seismic data
6
+ in SEG-Y format.
7
+
8
+ Quick start::
9
+
10
+ from sbpio import sbp
11
+
12
+ data = sbp("profile.segy")
13
+ data.show()
14
+
15
+ data.write_processed(
16
+ "output.segy",
17
+ correct_delay=True,
18
+ tvg={"method": 3, "kwargs": {"n": 0.2}},
19
+ recoverable_penetration=200,
20
+ out_projection="EPSG:32618",
21
+ )
22
+ """
23
+ import warnings
24
+ # This suppresses all warnings
25
+ warnings.filterwarnings("ignore")
26
+
27
+ from .core import nav, sbp
28
+ from .utils import (
29
+ apply_tvg,
30
+ clear_multiples,
31
+ clear_water,
32
+ decode_nav,
33
+ degrees_minutes_seconds_to_decimal_degrees,
34
+ enhance,
35
+ extract_seafloor,
36
+ find_line_polygon_intersection_indices,
37
+ get_delay_recording_time,
38
+ get_water_depth,
39
+ mfv_fltr,
40
+ non_duplicates,
41
+ plot_sec,
42
+ power_gain_1,
43
+ power_gain_2,
44
+ power_gain_3,
45
+ samples_after_delay,
46
+ scale_to_range,
47
+ tv_gamma,
48
+ utm_to_decimal_degrees,
49
+ water_depth_to_time,
50
+ )
51
+
52
+ __version__ = "0.1.0"
53
+ __author__ = "Ali Mohamed"
54
+ __license__ = "MIT"
55
+
56
+ __all__ = [
57
+ # Classes
58
+ "sbp",
59
+ "nav",
60
+ # Visualisation
61
+ "enhance",
62
+ "plot_sec",
63
+ # Navigation
64
+ "decode_nav",
65
+ "degrees_minutes_seconds_to_decimal_degrees",
66
+ "utm_to_decimal_degrees",
67
+ "find_line_polygon_intersection_indices",
68
+ # SEG-Y helpers
69
+ "samples_after_delay",
70
+ "get_delay_recording_time",
71
+ "get_water_depth",
72
+ "non_duplicates",
73
+ # Time / depth
74
+ "water_depth_to_time",
75
+ # Gain functions
76
+ "apply_tvg",
77
+ "tv_gamma",
78
+ "power_gain_1",
79
+ "power_gain_2",
80
+ "power_gain_3",
81
+ # Masking
82
+ "clear_water",
83
+ "clear_multiples",
84
+ # Filters
85
+ "mfv_fltr",
86
+ "scale_to_range",
87
+ ]