oceanstream 0.0.3.dev0__tar.gz → 0.0.6.dev0__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.
Files changed (67) hide show
  1. oceanstream-0.0.6.dev0/.flake8 +29 -0
  2. oceanstream-0.0.6.dev0/.gitignore +178 -0
  3. oceanstream-0.0.6.dev0/CODE_OF_CONDUCT.md +128 -0
  4. {oceanstream-0.0.3.dev0 → oceanstream-0.0.6.dev0}/MANIFEST.in +1 -1
  5. {oceanstream-0.0.3.dev0/oceanstream.egg-info → oceanstream-0.0.6.dev0}/PKG-INFO +6 -26
  6. oceanstream-0.0.6.dev0/notebooks/README.md +1 -0
  7. oceanstream-0.0.6.dev0/oceanstream/__init__.py +3 -0
  8. oceanstream-0.0.6.dev0/oceanstream/core.py +146 -0
  9. oceanstream-0.0.6.dev0/oceanstream/settings/defaults.config.json +120 -0
  10. {oceanstream-0.0.3.dev0 → oceanstream-0.0.6.dev0/oceanstream.egg-info}/PKG-INFO +6 -26
  11. {oceanstream-0.0.3.dev0 → oceanstream-0.0.6.dev0}/oceanstream.egg-info/SOURCES.txt +8 -2
  12. oceanstream-0.0.6.dev0/oceanstream.egg-info/dependency_links.txt +1 -0
  13. {oceanstream-0.0.3.dev0 → oceanstream-0.0.6.dev0}/oceanstream.egg-info/requires.txt +3 -7
  14. oceanstream-0.0.6.dev0/pyproject.toml +55 -0
  15. oceanstream-0.0.6.dev0/requirements-local.txt +4 -0
  16. {oceanstream-0.0.3.dev0 → oceanstream-0.0.6.dev0}/setup.cfg +9 -2
  17. oceanstream-0.0.6.dev0/setup.py +19 -0
  18. oceanstream-0.0.3.dev0/config.json +0 -17
  19. oceanstream-0.0.3.dev0/oceanstream.egg-info/dependency_links.txt +0 -1
  20. oceanstream-0.0.3.dev0/pyproject.toml +0 -46
  21. oceanstream-0.0.3.dev0/requirements-local.txt +0 -4
  22. oceanstream-0.0.3.dev0/setup.py +0 -72
  23. /oceanstream-0.0.3.dev0/oceanstream/__init__.py → /oceanstream-0.0.6.dev0/.gitattributes +0 -0
  24. {oceanstream-0.0.3.dev0 → oceanstream-0.0.6.dev0}/LICENSE +0 -0
  25. {oceanstream-0.0.3.dev0 → oceanstream-0.0.6.dev0}/README.md +0 -0
  26. {oceanstream-0.0.3.dev0 → oceanstream-0.0.6.dev0}/oceanstream/cli/__init__.py +0 -0
  27. {oceanstream-0.0.3.dev0 → oceanstream-0.0.6.dev0}/oceanstream/cli/main.py +0 -0
  28. {oceanstream-0.0.3.dev0 → oceanstream-0.0.6.dev0}/oceanstream/denoise/__init__.py +0 -0
  29. {oceanstream-0.0.3.dev0 → oceanstream-0.0.6.dev0}/oceanstream/denoise/apply_masks.py +0 -0
  30. {oceanstream-0.0.3.dev0 → oceanstream-0.0.6.dev0}/oceanstream/denoise/applying_masks_handler.py +0 -0
  31. {oceanstream-0.0.3.dev0 → oceanstream-0.0.6.dev0}/oceanstream/denoise/background_noise_remover.py +0 -0
  32. {oceanstream-0.0.3.dev0 → oceanstream-0.0.6.dev0}/oceanstream/denoise/create_masks.py +0 -0
  33. {oceanstream-0.0.3.dev0 → oceanstream-0.0.6.dev0}/oceanstream/denoise/noise_masks.py +0 -0
  34. {oceanstream-0.0.3.dev0 → oceanstream-0.0.6.dev0}/oceanstream/denoise/types.py +0 -0
  35. {oceanstream-0.0.3.dev0 → oceanstream-0.0.6.dev0}/oceanstream/echodata/__init__.py +0 -0
  36. {oceanstream-0.0.3.dev0 → oceanstream-0.0.6.dev0}/oceanstream/echodata/ensure_time_continuity.py +0 -0
  37. {oceanstream-0.0.3.dev0 → oceanstream-0.0.6.dev0}/oceanstream/echodata/mvbs_computation.py +0 -0
  38. {oceanstream-0.0.3.dev0 → oceanstream-0.0.6.dev0}/oceanstream/echodata/raw_handler.py +0 -0
  39. {oceanstream-0.0.3.dev0 → oceanstream-0.0.6.dev0}/oceanstream/echodata/sv_computation.py +0 -0
  40. {oceanstream-0.0.3.dev0 → oceanstream-0.0.6.dev0}/oceanstream/echodata/sv_dataset_extension.py +0 -0
  41. {oceanstream-0.0.3.dev0 → oceanstream-0.0.6.dev0}/oceanstream/echodata/sv_interpolation.py +0 -0
  42. {oceanstream-0.0.3.dev0 → oceanstream-0.0.6.dev0}/oceanstream/echodata/target_strength_computation.py +0 -0
  43. {oceanstream-0.0.3.dev0 → oceanstream-0.0.6.dev0}/oceanstream/exports/__init__.py +0 -0
  44. {oceanstream-0.0.3.dev0 → oceanstream-0.0.6.dev0}/oceanstream/exports/csv/csv_export_from_Sv.py +0 -0
  45. {oceanstream-0.0.3.dev0 → oceanstream-0.0.6.dev0}/oceanstream/exports/csv/csv_export_from_raw.py +0 -0
  46. {oceanstream-0.0.3.dev0 → oceanstream-0.0.6.dev0}/oceanstream/exports/csv/csv_export_nasc.py +0 -0
  47. {oceanstream-0.0.3.dev0 → oceanstream-0.0.6.dev0}/oceanstream/exports/frequency_differencing_handler.py +0 -0
  48. {oceanstream-0.0.3.dev0 → oceanstream-0.0.6.dev0}/oceanstream/exports/nasc.py +0 -0
  49. {oceanstream-0.0.3.dev0 → oceanstream-0.0.6.dev0}/oceanstream/exports/nasc_computation.py +0 -0
  50. {oceanstream-0.0.3.dev0 → oceanstream-0.0.6.dev0}/oceanstream/exports/shoals/shoal_detection_handler.py +0 -0
  51. {oceanstream-0.0.3.dev0 → oceanstream-0.0.6.dev0}/oceanstream/exports/shoals/shoal_process.py +0 -0
  52. {oceanstream-0.0.3.dev0 → oceanstream-0.0.6.dev0}/oceanstream/exports/shoals/shoals_handler.py +0 -0
  53. {oceanstream-0.0.3.dev0 → oceanstream-0.0.6.dev0}/oceanstream/plot/__init__.py +0 -0
  54. {oceanstream-0.0.3.dev0 → oceanstream-0.0.6.dev0}/oceanstream/plot/echogram.py +0 -0
  55. {oceanstream-0.0.3.dev0 → oceanstream-0.0.6.dev0}/oceanstream/process/__init__.py +0 -0
  56. {oceanstream-0.0.3.dev0 → oceanstream-0.0.6.dev0}/oceanstream/process/combine_zarr.py +0 -0
  57. {oceanstream-0.0.3.dev0 → oceanstream-0.0.6.dev0}/oceanstream/process/file_processor.py +0 -0
  58. {oceanstream-0.0.3.dev0 → oceanstream-0.0.6.dev0}/oceanstream/process/folder_processor.py +0 -0
  59. {oceanstream-0.0.3.dev0 → oceanstream-0.0.6.dev0}/oceanstream/process/process.py +0 -0
  60. {oceanstream-0.0.3.dev0 → oceanstream-0.0.6.dev0}/oceanstream/process/processed_data_io.py +0 -0
  61. {oceanstream-0.0.3.dev0 → oceanstream-0.0.6.dev0}/oceanstream/settings/__init__.py +0 -0
  62. {oceanstream-0.0.3.dev0 → oceanstream-0.0.6.dev0}/oceanstream/settings/config.py +0 -0
  63. {oceanstream-0.0.3.dev0 → oceanstream-0.0.6.dev0}/oceanstream/utils.py +0 -0
  64. {oceanstream-0.0.3.dev0 → oceanstream-0.0.6.dev0}/oceanstream.egg-info/entry_points.txt +0 -0
  65. {oceanstream-0.0.3.dev0 → oceanstream-0.0.6.dev0}/oceanstream.egg-info/top_level.txt +0 -0
  66. {oceanstream-0.0.3.dev0 → oceanstream-0.0.6.dev0}/requirements-dev.txt +0 -0
  67. {oceanstream-0.0.3.dev0 → oceanstream-0.0.6.dev0}/requirements.txt +0 -0
@@ -0,0 +1,29 @@
1
+ [flake8]
2
+ # It's okay to have lines up to 88 characters long to match Black's default
3
+ max-line-length = 100
4
+
5
+ # W503 and W504 are conflicting rules related to line breaks before or after binary operators.
6
+ # Black (the formatter) has chosen to put line breaks before binary operators, so we ignore W503.
7
+ ignore =
8
+ # ignored because it warns about whitespace around the colon, which black enforces.
9
+ E203,
10
+ # line break before binary operator
11
+ W503,
12
+ # line too long (handled by Black anyway)
13
+ E501
14
+
15
+ # Exclude directories/files that shouldn't be checked
16
+ exclude =
17
+ .git,
18
+ __pycache__,
19
+ build,
20
+ dist,
21
+ venv,
22
+ *.egg-info
23
+
24
+ # Set the complexity threshold. This checks the McCabe complexity of your code.
25
+ max-complexity = 20
26
+
27
+ # Ignore F401 for __init__.py files
28
+ per-file-ignores =
29
+ __init__.py: F401
@@ -0,0 +1,178 @@
1
+ # macOS .DS_Store files
2
+ .DS_Store
3
+
4
+ # Byte-compiled / optimized / DLL files
5
+ __pycache__/
6
+ *.py[cod]
7
+ *$py.class
8
+
9
+ # C extensions
10
+ *.so
11
+
12
+ # Distribution / packaging
13
+ .Python
14
+ build/
15
+ develop-eggs/
16
+ dist/
17
+ downloads/
18
+ eggs/
19
+ .eggs/
20
+ lib/
21
+ lib64/
22
+ parts/
23
+ sdist/
24
+ var/
25
+ wheels/
26
+ share/python-wheels/
27
+ *.egg-info/
28
+ notebooks
29
+ .installed.cfg
30
+ *.egg
31
+ MANIFEST
32
+
33
+ # PyInstaller
34
+ # Usually these files are written by a python script from a template
35
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
36
+ *.manifest
37
+ *.spec
38
+
39
+ # Installer logs
40
+ pip-log.txt
41
+ pip-delete-this-directory.txt
42
+
43
+ # Unit test / coverage reports
44
+ htmlcov/
45
+ .tox/
46
+ .nox/
47
+ .coverage
48
+ .coverage.*
49
+ .cache
50
+ nosetests.xml
51
+ coverage.xml
52
+ *.cover
53
+ *.py,cover
54
+ .hypothesis/
55
+ .pytest_cache/
56
+ cover/
57
+
58
+ # Translations
59
+ *.mo
60
+ *.pot
61
+
62
+ # Django stuff:
63
+ *.log
64
+ local_settings.py
65
+ db.sqlite3
66
+ db.sqlite3-journal
67
+
68
+ # Flask stuff:
69
+ instance/
70
+ .webassets-cache
71
+
72
+ # Scrapy stuff:
73
+ .scrapy
74
+
75
+ # Sphinx documentation
76
+ docs/_build/
77
+ docs/build/
78
+
79
+ # PyBuilder
80
+ .pybuilder/
81
+ target/
82
+
83
+ # Jupyter Notebook
84
+ .ipynb_checkpoints
85
+ *.ipynb
86
+
87
+ # IPython
88
+ profile_default/
89
+ ipython_config.py
90
+
91
+ # pyenv
92
+ # For a library or package, you might want to ignore these files since the code is
93
+ # intended to run in multiple environments; otherwise, check them in:
94
+ # .python-version
95
+
96
+ # pipenv
97
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
98
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
99
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
100
+ # install all needed dependencies.
101
+ #Pipfile.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ #poetry.lock
109
+
110
+ # pdm
111
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
112
+ #pdm.lock
113
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
114
+ # in version control.
115
+ # https://pdm.fming.dev/#use-with-ide
116
+ .pdm.toml
117
+
118
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
119
+ __pypackages__/
120
+
121
+ # Celery stuff
122
+ celerybeat-schedule
123
+ celerybeat.pid
124
+
125
+ # SageMath parsed files
126
+ *.sage.py
127
+
128
+ # Environments
129
+ .env
130
+ .venv
131
+ env/
132
+ venv/
133
+ ENV/
134
+ env.bak/
135
+ venv.bak/
136
+
137
+ # Spyder project settings
138
+ .spyderproject
139
+ .spyproject
140
+
141
+ # Rope project settings
142
+ .ropeproject
143
+
144
+ # mkdocs documentation
145
+ /site
146
+
147
+ # mypy
148
+ .mypy_cache/
149
+ .dmypy.json
150
+ dmypy.json
151
+
152
+ # Pyre type checker
153
+ .pyre/
154
+
155
+ # pytype static type analyzer
156
+ .pytype/
157
+
158
+ # Cython debug symbols
159
+ cython_debug/
160
+
161
+ # PyCharm
162
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
163
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
164
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
165
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
166
+ .idea/
167
+ # Data files
168
+ tests/test_data/
169
+ *.raw
170
+ *.nc
171
+ *.zarr
172
+ # For MAC stuff
173
+ .DS_Store
174
+ oceanstream/.DS_Store
175
+ # VS code
176
+ .vs/
177
+ requirements-local.txt
178
+
@@ -0,0 +1,128 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, religion, or sexual identity
10
+ and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ * Demonstrating empathy and kindness toward other people
21
+ * Being respectful of differing opinions, viewpoints, and experiences
22
+ * Giving and gracefully accepting constructive feedback
23
+ * Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ * Focusing on what is best not just for us as individuals, but for the
26
+ overall community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ * The use of sexualized language or imagery, and sexual attention or
31
+ advances of any kind
32
+ * Trolling, insulting or derogatory comments, and personal or political attacks
33
+ * Public or private harassment
34
+ * Publishing others' private information, such as a physical or email
35
+ address, without their explicit permission
36
+ * Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
50
+
51
+ ## Scope
52
+
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official e-mail address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the community leaders responsible for enforcement at
63
+ hello@pineview.io.
64
+ All complaints will be reviewed and investigated promptly and fairly.
65
+
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
68
+
69
+ ## Enforcement Guidelines
70
+
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
73
+
74
+ ### 1. Correction
75
+
76
+ **Community Impact**: Use of inappropriate language or other behavior deemed
77
+ unprofessional or unwelcome in the community.
78
+
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behavior was inappropriate. A public apology may be requested.
82
+
83
+ ### 2. Warning
84
+
85
+ **Community Impact**: A violation through a single incident or series
86
+ of actions.
87
+
88
+ **Consequence**: A warning with consequences for continued behavior. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or
93
+ permanent ban.
94
+
95
+ ### 3. Temporary Ban
96
+
97
+ **Community Impact**: A serious violation of community standards, including
98
+ sustained inappropriate behavior.
99
+
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited interaction
103
+ with those enforcing the Code of Conduct, is allowed during this period.
104
+ Violating these terms may lead to a permanent ban.
105
+
106
+ ### 4. Permanent Ban
107
+
108
+ **Community Impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behavior, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
111
+
112
+ **Consequence**: A permanent ban from any sort of public interaction within
113
+ the community.
114
+
115
+ ## Attribution
116
+
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.0, available at
119
+ https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120
+
121
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct
122
+ enforcement ladder](https://github.com/mozilla/diversity).
123
+
124
+ [homepage]: https://www.contributor-covenant.org
125
+
126
+ For answers to common questions about this code of conduct, see the FAQ at
127
+ https://www.contributor-covenant.org/faq. Translations are available at
128
+ https://www.contributor-covenant.org/translations.
@@ -5,5 +5,5 @@ exclude *.ini
5
5
  exclude *.yaml
6
6
  exclude *.yml
7
7
  include *.txt
8
- include settings/*.json
8
+ include oceanstream/settings/*.json
9
9
  prune tests
@@ -1,34 +1,14 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: oceanstream
3
- Version: 0.0.3.dev0
3
+ Version: 0.0.6.dev0
4
4
  Summary: OceanStream: process raw sonar data at scale
5
- Home-page: https://github.com/OceanStreamIO/oceanstream
5
+ Home-page: https://oceanstream.io
6
6
  Author: Pineview Labs
7
- Author-email: Pineview Labs <hello@pineview.io>
8
- License: MIT License
9
-
10
- Copyright (c) 2023 Pine View Software AS
11
-
12
- Permission is hereby granted, free of charge, to any person obtaining a copy
13
- of this software and associated documentation files (the "Software"), to deal
14
- in the Software without restriction, including without limitation the rights
15
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
- copies of the Software, and to permit persons to whom the Software is
17
- furnished to do so, subject to the following conditions:
18
-
19
- The above copyright notice and this permission notice shall be included in all
20
- copies or substantial portions of the Software.
21
-
22
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
- SOFTWARE.
29
-
7
+ Author-email: hello@pineview.io
8
+ Maintainer: Andrei Rusu
9
+ Maintainer-email: hello@pineview.io
10
+ License: MIT
30
11
  Classifier: Programming Language :: Python :: 3
31
- Classifier: Programming Language :: Python :: 3.10
32
12
  Classifier: Programming Language :: Python :: 3.11
33
13
  Classifier: License :: OSI Approved :: MIT License
34
14
  Classifier: Operating System :: OS Independent
@@ -0,0 +1 @@
1
+ # oceanstream
@@ -0,0 +1,3 @@
1
+ from .core import compute_sv, combine, convert, process_raw_file
2
+
3
+ __all__ = ["compute_sv", "combine", "convert", "process_raw_file"]
@@ -0,0 +1,146 @@
1
+ import asyncio
2
+ import os
3
+ import logging
4
+ import sys
5
+
6
+ from pathlib import Path
7
+ from oceanstream.settings import load_config
8
+
9
+ DEFAULT_OUTPUT_FOLDER = "output"
10
+ DEFAULT_SONAR_MODEL = "EK60"
11
+
12
+ logging.basicConfig(level="ERROR", format='%(asctime)s - %(levelname)s - %(message)s')
13
+
14
+
15
+ def initialize(settings, file_path, log_level=None):
16
+ logging.debug(f"Initializing with settings: {settings}, file path: {file_path}, log level: {log_level}")
17
+ config_data = load_config(settings["config"])
18
+ config_data["raw_path"] = file_path
19
+
20
+ if log_level is not None:
21
+ logging.basicConfig(level=log_level, format='%(asctime)s - %(levelname)s - %(message)s', force=True)
22
+ config_data["log_level"] = log_level
23
+
24
+ if 'sonar_model' in settings and settings["sonar_model"] is not None:
25
+ config_data["sonar_model"] = settings["sonar_model"]
26
+
27
+ if settings["output_folder"] is not None:
28
+ config_data["output_folder"] = settings["output_folder"]
29
+
30
+ return config_data
31
+
32
+
33
+ def process_raw_file(source, output=None, sonar_model=None, plot_echogram=False, depth_offset=0.0, waveform_mode="CW",
34
+ config=None, log_level="WARNING", chunks=None):
35
+ logging.debug("Starting process_raw_file function")
36
+ settings = {
37
+ "config": config,
38
+ "sonar_model": sonar_model,
39
+ "output_folder": output or DEFAULT_OUTPUT_FOLDER
40
+ }
41
+
42
+ file_path = Path(source)
43
+ config_data = initialize(settings, file_path, log_level=log_level)
44
+
45
+ if chunks:
46
+ config_data['chunks'] = chunks
47
+
48
+ if file_path.is_file():
49
+ logging.debug(f"Processing raw file: {file_path}")
50
+ from oceanstream.process import process_raw_file_with_progress
51
+ asyncio.run(
52
+ process_raw_file_with_progress(config_data, plot_echogram, waveform_mode=waveform_mode,
53
+ depth_offset=depth_offset)
54
+ )
55
+ else:
56
+ logging.error(f"The provided path '{source}' is not a valid raw file.")
57
+ sys.exit(1)
58
+
59
+
60
+ def convert(source, output=None, workers_count=None, config=None, log_level="WARNING", chunks=None):
61
+ logging.debug("Starting convert function")
62
+ settings = {
63
+ "config": config,
64
+ "output_folder": output or DEFAULT_OUTPUT_FOLDER
65
+ }
66
+
67
+ file_path = Path(source)
68
+ config_data = initialize(settings, file_path, log_level=log_level)
69
+
70
+ if chunks:
71
+ config_data['chunks'] = chunks
72
+
73
+ if file_path.is_file():
74
+ logging.debug(f"Converting raw file: {file_path}")
75
+ from oceanstream.process import convert_raw_file
76
+ convert_raw_file(file_path, config_data)
77
+ logging.info(f"Converted raw file {source} to Zarr and wrote output to: {config_data['output_folder']}")
78
+ elif file_path.is_dir():
79
+ logging.debug(f"Converting raw files in directory: {file_path}")
80
+ from oceanstream.process import convert_raw_files
81
+ convert_raw_files(config_data, workers_count=workers_count)
82
+ else:
83
+ logging.error(f"The provided path '{source}' is not a valid file/folder.")
84
+
85
+
86
+ def combine(source, output=None, config=None, log_level="WARNING", chunks=None):
87
+ logging.debug("Starting combine function")
88
+ settings = {
89
+ "config": config,
90
+ "output_folder": output or DEFAULT_OUTPUT_FOLDER
91
+ }
92
+
93
+ dir_path = Path(source)
94
+ config_data = initialize(settings, dir_path, log_level=log_level)
95
+
96
+ if chunks:
97
+ config_data['chunks'] = chunks
98
+
99
+ if dir_path.is_dir():
100
+ logging.debug(f"Combining Zarr files in directory: {dir_path}")
101
+
102
+ from oceanstream.process import combine_zarr_files
103
+
104
+ file_name = f"{Path(dir_path).stem}-combined.zarr"
105
+ zarr_output_file = os.path.join(config_data['output_folder'], file_name)
106
+ logging.info(
107
+ f"Combining Zarr files to {zarr_output_file}; navigate to http://localhost:8787/status for progress")
108
+
109
+ combine_zarr_files(dir_path, zarr_output_file=zarr_output_file, chunks=chunks)
110
+ logging.info("Zarr files have been combined successfully.")
111
+ else:
112
+ logging.error(f"The provided path '{source}' is not a valid folder.")
113
+
114
+
115
+ def compute_sv(source, output=None, workers_count=None, sonar_model=DEFAULT_SONAR_MODEL, plot_echogram=False,
116
+ depth_offset=0.0, waveform_mode="CW", config=None, log_level="WARNING", chunks=None):
117
+ logging.debug("Starting compute_sv function")
118
+ settings_dict = {
119
+ "config": config,
120
+ "sonar_model": sonar_model,
121
+ "output_folder": output or DEFAULT_OUTPUT_FOLDER
122
+ }
123
+ file_path = Path(source)
124
+ config_data = initialize(settings_dict, file_path, log_level=log_level)
125
+
126
+ if chunks:
127
+ config_data['chunks'] = chunks
128
+
129
+ if file_path.is_dir() and source.endswith(".zarr"):
130
+ logging.debug(f"Computing Sv for Zarr root file: {file_path}")
131
+ from oceanstream.process import compute_single_file
132
+
133
+ compute_single_file(config_data, chunks=chunks, plot_echogram=plot_echogram, waveform_mode=waveform_mode,
134
+ depth_offset=depth_offset)
135
+ elif file_path.is_dir():
136
+ logging.debug(f"Processing Zarr files in directory: {file_path}")
137
+ from oceanstream.process import process_zarr_files
138
+
139
+ process_zarr_files(config_data, workers_count=workers_count, chunks=chunks, plot_echogram=plot_echogram,
140
+ waveform_mode=waveform_mode, depth_offset=depth_offset)
141
+ else:
142
+ logging.error(f"The provided path '{source}' is not a valid Zarr root.")
143
+
144
+
145
+ def export():
146
+ logging.info("Export data...")
@@ -0,0 +1,120 @@
1
+ {
2
+ "impulse": {
3
+ "enabled": true,
4
+ "method": "ryan",
5
+ "parameters": {
6
+ "thr": 10,
7
+ "m": 5,
8
+ "n": 1
9
+ }
10
+ },
11
+ "attenuation": {
12
+ "enabled": true,
13
+ "method": "ryan",
14
+ "parameters": {
15
+ "r0": 180,
16
+ "r1": 280,
17
+ "n": 5,
18
+ "m": null,
19
+ "thr": -5,
20
+ "start": 0,
21
+ "offset": 0,
22
+ "dask_chunking": {
23
+ "ping_time": 100,
24
+ "range_sample": 100
25
+ }
26
+ }
27
+ },
28
+ "transient": {
29
+ "enabled": true,
30
+ "method": "fielding",
31
+ "parameters": {
32
+ "r0": 200,
33
+ "r1": 1000,
34
+ "n": 5,
35
+ "thr": [
36
+ 2,
37
+ 0
38
+ ],
39
+ "roff": 250,
40
+ "jumps": 5,
41
+ "maxts": -35,
42
+ "start": 0,
43
+ "dask_chunking": {
44
+ "ping_time": 100,
45
+ "range_sample": 100
46
+ }
47
+ }
48
+ },
49
+ "false_seabed": {
50
+ "enabled": true,
51
+ "method": "blackwell",
52
+ "parameters": {
53
+ "r0": 10,
54
+ "r1": 1000,
55
+ "tSv": -35,
56
+ "ttheta": 702,
57
+ "tphi": 282,
58
+ "wtheta": 28,
59
+ "wphi": 52
60
+ }
61
+ },
62
+ "seabed": {
63
+ "enabled": true,
64
+ "method": "ariza",
65
+ "parameters": {
66
+ "r0": 10,
67
+ "r1": 1000,
68
+ "roff": 0,
69
+ "thr": [
70
+ -40,
71
+ -40
72
+ ],
73
+ "ec": 1,
74
+ "ek": [
75
+ 3,
76
+ 3
77
+ ],
78
+ "dc": 3,
79
+ "dk": [
80
+ 3,
81
+ 3
82
+ ],
83
+ "maximum_spike": 100
84
+ }
85
+ },
86
+ "remove_background_noise": {
87
+ "enabled": true,
88
+ "parameters": {
89
+ "ping_num": 40,
90
+ "noise_max": -125,
91
+ "SNR_threshold": 3
92
+ }
93
+ },
94
+ "nasc": {
95
+ "enabled": true
96
+ },
97
+ "shoals": {
98
+ "enabled": true,
99
+ "method": "will",
100
+ "parameters": {
101
+ "thr": -55,
102
+ "maxvgap": -5,
103
+ "maxhgap": 0,
104
+ "minvlen": 5,
105
+ "minhlen": 5,
106
+ "dask_chunking": {
107
+ "ping_time": 100,
108
+ "range_sample": 100
109
+ }
110
+ }
111
+ },
112
+ "profile": false,
113
+ "base_chunk_sizes": {
114
+ "ping_time": 50,
115
+ "range_sample": 50
116
+ },
117
+ "sonar_model": null,
118
+ "output_folder": "output",
119
+ "plot_echogram": true
120
+ }
@@ -1,34 +1,14 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: oceanstream
3
- Version: 0.0.3.dev0
3
+ Version: 0.0.6.dev0
4
4
  Summary: OceanStream: process raw sonar data at scale
5
- Home-page: https://github.com/OceanStreamIO/oceanstream
5
+ Home-page: https://oceanstream.io
6
6
  Author: Pineview Labs
7
- Author-email: Pineview Labs <hello@pineview.io>
8
- License: MIT License
9
-
10
- Copyright (c) 2023 Pine View Software AS
11
-
12
- Permission is hereby granted, free of charge, to any person obtaining a copy
13
- of this software and associated documentation files (the "Software"), to deal
14
- in the Software without restriction, including without limitation the rights
15
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
- copies of the Software, and to permit persons to whom the Software is
17
- furnished to do so, subject to the following conditions:
18
-
19
- The above copyright notice and this permission notice shall be included in all
20
- copies or substantial portions of the Software.
21
-
22
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
- SOFTWARE.
29
-
7
+ Author-email: hello@pineview.io
8
+ Maintainer: Andrei Rusu
9
+ Maintainer-email: hello@pineview.io
10
+ License: MIT
30
11
  Classifier: Programming Language :: Python :: 3
31
- Classifier: Programming Language :: Python :: 3.10
32
12
  Classifier: Programming Language :: Python :: 3.11
33
13
  Classifier: License :: OSI Approved :: MIT License
34
14
  Classifier: Operating System :: OS Independent
@@ -1,14 +1,19 @@
1
+ .flake8
2
+ .gitattributes
3
+ .gitignore
4
+ CODE_OF_CONDUCT.md
1
5
  LICENSE
2
6
  MANIFEST.in
3
7
  README.md
4
- config.json
5
8
  pyproject.toml
6
9
  requirements-dev.txt
7
10
  requirements-local.txt
8
11
  requirements.txt
9
12
  setup.cfg
10
13
  setup.py
14
+ notebooks/README.md
11
15
  oceanstream/__init__.py
16
+ oceanstream/core.py
12
17
  oceanstream/utils.py
13
18
  oceanstream.egg-info/PKG-INFO
14
19
  oceanstream.egg-info/SOURCES.txt
@@ -52,4 +57,5 @@ oceanstream/process/folder_processor.py
52
57
  oceanstream/process/process.py
53
58
  oceanstream/process/processed_data_io.py
54
59
  oceanstream/settings/__init__.py
55
- oceanstream/settings/config.py
60
+ oceanstream/settings/config.py
61
+ oceanstream/settings/defaults.config.json
@@ -7,16 +7,11 @@ typer
7
7
  rich
8
8
 
9
9
  [complete]
10
- cli
11
- echodata
12
- process
13
- denoise
14
- plot
15
- exports
16
10
  typer
17
11
  rich
18
- matplotlib
19
12
  pydantic
13
+ matplotlib
14
+ cmocean
20
15
 
21
16
  [denoise]
22
17
 
@@ -27,5 +22,6 @@ pydantic
27
22
 
28
23
  [plot]
29
24
  matplotlib
25
+ cmocean
30
26
 
31
27
  [process]
@@ -0,0 +1,55 @@
1
+ [build-system]
2
+ requires = [
3
+ "setuptools >= 48",
4
+ "setuptools_scm[toml] >= 4, <6",
5
+ "setuptools_scm_git_archive",
6
+ "wheel >= 0.29.0"
7
+ ]
8
+ build-backend = "setuptools.build_meta"
9
+
10
+ #[project]
11
+ #name = "oceanstream"
12
+ #version = "0.0.5-dev"
13
+ #description = "OceanStream: process raw sonar data at scale"
14
+ #readme = "README.md"
15
+ #requires-python = ">=3.11"
16
+ #authors = [
17
+ # { name="Pineview Labs", email="hello@pineview.io" }
18
+ #]
19
+ #license = { file="LICENSE" }
20
+ #classifiers = [
21
+ # "Programming Language :: Python :: 3",
22
+ # "Programming Language :: Python :: 3.10",
23
+ # "Programming Language :: Python :: 3.11",
24
+ # "License :: OSI Approved :: MIT License",
25
+ # "Operating System :: OS Independent"
26
+ #]
27
+ #
28
+ #dependencies = [
29
+ # "git+https://github.com/OceanStreamIO/echopype-dev.git@oceanstream#egg=echopype"
30
+ #]
31
+ #
32
+ #[project.optional-dependencies]
33
+ #cli = [
34
+ # "typer",
35
+ # "rich"
36
+ #]
37
+ #plot = [
38
+ # "matplotlib"
39
+ #]
40
+ #echodata = [
41
+ # "pydantic"
42
+ #]
43
+ #
44
+ #denoise = []
45
+ #exports = []
46
+ #process = []
47
+ #complete = [
48
+ # "typer",
49
+ # "rich",
50
+ # "matplotlib",
51
+ # "pydantic"
52
+ #]
53
+ #
54
+ #[project.scripts]
55
+ #oceanstream = "oceanstream.cli.main:main"
@@ -0,0 +1,4 @@
1
+ dask[array,distributed]
2
+ xarray
3
+ numpy
4
+ -e /Users/andrei/oceanstream/echopype-dev
@@ -1,14 +1,16 @@
1
1
  [metadata]
2
2
  name = oceanstream
3
- version = 0.0.2-dev
3
+ version = 0.0.6-dev
4
4
  description = OceanStream: process raw sonar data at scale
5
5
  long_description = file: README.md
6
6
  long_description_content_type = text/markdown
7
7
  author = Pineview Labs
8
8
  author_email = hello@pineview.io
9
+ maintainer = Andrei Rusu
10
+ maintainer_email = hello@pineview.io
9
11
  license = MIT
10
12
  license_files = LICENSE
11
- url = https://github.com/OceanStreamIO/oceanstream
13
+ url = https://oceanstream.io
12
14
  classifiers =
13
15
  Programming Language :: Python :: 3
14
16
  Programming Language :: Python :: 3.11
@@ -17,7 +19,11 @@ classifiers =
17
19
 
18
20
  [options]
19
21
  packages = find:
22
+ platforms = any
20
23
  python_requires = >=3.11
24
+ include_package_data = True
25
+ setup_requires =
26
+ setuptools_scm
21
27
 
22
28
  [options.extras_require]
23
29
  cli =
@@ -27,6 +33,7 @@ echodata =
27
33
  pydantic
28
34
  plot =
29
35
  matplotlib
36
+ cmocean
30
37
  denoise =
31
38
  process =
32
39
  exports =
@@ -0,0 +1,19 @@
1
+ from setuptools import setup
2
+
3
+
4
+ def read_requirements(file_path):
5
+ with open(file_path) as f:
6
+ lines = f.read().splitlines()
7
+ _requires = []
8
+ _links = []
9
+ for line in lines:
10
+ if line.startswith("git+"):
11
+ _links.append(line)
12
+ else:
13
+ _requires.append(line)
14
+ return _requires, _links
15
+
16
+
17
+ install_requires, dependency_links = read_requirements('requirements.txt')
18
+
19
+ setup(install_requires=install_requires)
@@ -1,17 +0,0 @@
1
- {
2
- "impulse": {
3
- "enabled": false
4
- },
5
- "attenuation": {
6
- "enabled": false
7
- },
8
- "transient": {
9
- "enabled": false
10
- },
11
- "false_seabed": {
12
- "enabled": true
13
- },
14
- "seabed": {
15
- "enabled": true
16
- }
17
- }
@@ -1 +0,0 @@
1
- git+https://github.com/OceanStreamIO/echopype-dev.git@oceanstream#egg=echopype
@@ -1,46 +0,0 @@
1
- [build-system]
2
- requires = ["setuptools>=42", "wheel"]
3
- build-backend = "setuptools.build_meta"
4
-
5
- [project]
6
- name = "oceanstream"
7
- version = "0.0.3-dev"
8
- description = "OceanStream: process raw sonar data at scale"
9
- readme = "README.md"
10
- requires-python = ">=3.11"
11
- authors = [
12
- { name="Pineview Labs", email="hello@pineview.io" }
13
- ]
14
- license = { file="LICENSE" }
15
- classifiers = [
16
- "Programming Language :: Python :: 3",
17
- "Programming Language :: Python :: 3.10",
18
- "Programming Language :: Python :: 3.11",
19
- "License :: OSI Approved :: MIT License",
20
- "Operating System :: OS Independent"
21
- ]
22
-
23
- [project.optional-dependencies]
24
- cli = [
25
- "typer",
26
- "rich"
27
- ]
28
- plot = [
29
- "matplotlib"
30
- ]
31
- echodata = [
32
- "pydantic"
33
- ]
34
-
35
- denoise = []
36
- exports = []
37
- process = []
38
- complete = [
39
- "typer",
40
- "rich",
41
- "matplotlib",
42
- "pydantic"
43
- ]
44
-
45
- [project.scripts]
46
- oceanstream = "oceanstream.cli.main:main"
@@ -1,4 +0,0 @@
1
- dask[array,distributed]
2
- xarray
3
- numpy
4
- -e /Users/andrei/oceanstream/echopype-dev
@@ -1,72 +0,0 @@
1
- from os import path
2
- from setuptools import find_packages, setup
3
-
4
- current_filename = path.dirname(__file__)
5
-
6
-
7
- def read_requirements(file_path):
8
- with open(file_path) as f:
9
- lines = f.read().splitlines()
10
- _requires = []
11
- _links = []
12
- for line in lines:
13
- if line.startswith("git+"):
14
- _links.append(line)
15
- else:
16
- _requires.append(line)
17
- return _requires, _links
18
-
19
-
20
- def read_extra_requirements(module_name):
21
- file_path = path.join(current_filename, 'oceanstream', module_name, 'requirements.txt')
22
- if path.isfile(file_path):
23
- return read_extra_requirements(file_path)
24
- return []
25
-
26
-
27
- install_requires, dependency_links = read_requirements(path.join(current_filename, 'requirements.txt'))
28
-
29
- setup(
30
- name="oceanstream",
31
- version="0.1.3",
32
- description="OceanStream: process raw sonar data at scale",
33
- license="MIT",
34
- long_description=open('README.md').read(),
35
- long_description_content_type='text/markdown',
36
- author="Pineview Labs",
37
- author_email="hello@pineview.io",
38
- url="https://github.com/OceanStreamIO/oceanstream",
39
- packages=find_packages(include=['oceanstream', 'oceanstream.*']),
40
- python_requires=">=3.11",
41
- install_requires=install_requires,
42
- dependency_links=dependency_links,
43
- include_package_data=True,
44
- extras_require={
45
- 'cli': read_extra_requirements('cli'),
46
- 'echodata': read_extra_requirements('echodata'),
47
- 'plot': read_extra_requirements('plot'),
48
- 'denoise': read_extra_requirements('denoise'),
49
- 'process': read_extra_requirements('process'),
50
- 'exports': read_extra_requirements('exports'),
51
- 'complete': [
52
- 'cli',
53
- 'echodata',
54
- 'process',
55
- 'denoise',
56
- 'plot',
57
- 'exports'
58
- ],
59
- },
60
- entry_points={
61
- 'console_scripts': [
62
- 'oceanstream=oceanstream.cli.main:main',
63
- ],
64
- },
65
- classifiers=[
66
- "Programming Language :: Python :: 3",
67
- "Programming Language :: Python :: 3.10",
68
- "Programming Language :: Python :: 3.11",
69
- "License :: OSI Approved :: MIT License",
70
- "Operating System :: OS Independent",
71
- ],
72
- )