water-column-sonar-processing 0.0.6__py3-none-any.whl → 26.1.9__py3-none-any.whl
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.
- water_column_sonar_processing/__init__.py +2 -5
- water_column_sonar_processing/aws/__init__.py +2 -2
- water_column_sonar_processing/aws/dynamodb_manager.py +257 -72
- water_column_sonar_processing/aws/s3_manager.py +184 -112
- water_column_sonar_processing/aws/s3fs_manager.py +29 -33
- water_column_sonar_processing/aws/sqs_manager.py +1 -1
- water_column_sonar_processing/cruise/create_empty_zarr_store.py +38 -97
- water_column_sonar_processing/cruise/datatree_manager.py +21 -0
- water_column_sonar_processing/cruise/resample_regrid.py +144 -129
- water_column_sonar_processing/geometry/__init__.py +10 -2
- water_column_sonar_processing/geometry/elevation_manager.py +111 -0
- water_column_sonar_processing/geometry/geometry_manager.py +60 -44
- water_column_sonar_processing/geometry/line_simplification.py +176 -0
- water_column_sonar_processing/geometry/pmtile_generation.py +242 -51
- water_column_sonar_processing/geometry/spatiotemporal.py +106 -0
- water_column_sonar_processing/index/index_manager.py +157 -27
- water_column_sonar_processing/model/zarr_manager.py +663 -258
- water_column_sonar_processing/processing/__init__.py +4 -0
- water_column_sonar_processing/processing/raw_to_netcdf.py +320 -0
- water_column_sonar_processing/processing/raw_to_zarr.py +341 -0
- water_column_sonar_processing/utility/__init__.py +9 -2
- water_column_sonar_processing/utility/cleaner.py +1 -0
- water_column_sonar_processing/utility/constants.py +69 -14
- water_column_sonar_processing/utility/pipeline_status.py +11 -15
- water_column_sonar_processing/utility/timestamp.py +3 -4
- water_column_sonar_processing-26.1.9.dist-info/METADATA +239 -0
- water_column_sonar_processing-26.1.9.dist-info/RECORD +34 -0
- {water_column_sonar_processing-0.0.6.dist-info → water_column_sonar_processing-26.1.9.dist-info}/WHEEL +1 -1
- {water_column_sonar_processing-0.0.6.dist-info → water_column_sonar_processing-26.1.9.dist-info/licenses}/LICENSE +1 -1
- water_column_sonar_processing/geometry/geometry_simplification.py +0 -82
- water_column_sonar_processing/process.py +0 -147
- water_column_sonar_processing-0.0.6.dist-info/METADATA +0 -123
- water_column_sonar_processing-0.0.6.dist-info/RECORD +0 -29
- {water_column_sonar_processing-0.0.6.dist-info → water_column_sonar_processing-26.1.9.dist-info}/top_level.txt +0 -0
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import json
|
|
2
|
-
import os
|
|
3
|
-
|
|
4
|
-
import numpy as np
|
|
5
|
-
|
|
6
|
-
from water_column_sonar_processing.aws.dynamodb_manager import DynamoDBManager
|
|
7
|
-
from water_column_sonar_processing.aws.s3_manager import S3Manager
|
|
8
|
-
from water_column_sonar_processing.aws.s3fs_manager import S3FSManager
|
|
9
|
-
from water_column_sonar_processing.aws.sns_manager import SNSManager
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
###########################################################
|
|
13
|
-
class Process:
|
|
14
|
-
#######################################################
|
|
15
|
-
def __init__(
|
|
16
|
-
self,
|
|
17
|
-
):
|
|
18
|
-
self.input_bucket_name = os.environ["INPUT_BUCKET_NAME"]
|
|
19
|
-
self.output_bucket_name = os.environ["OUTPUT_BUCKET_NAME"]
|
|
20
|
-
self.table_name = os.environ["TABLE_NAME"]
|
|
21
|
-
self.topic_arn = os.environ["TOPIC_ARN"]
|
|
22
|
-
# self.output_bucket_access_key = ?
|
|
23
|
-
# self.output_bucket_secret_access_key = ?
|
|
24
|
-
|
|
25
|
-
def execute(self):
|
|
26
|
-
input_s3_manager = (
|
|
27
|
-
S3Manager()
|
|
28
|
-
) # TODO: Need to allow passing in of credentials when writing to protected bucket
|
|
29
|
-
s3fs_manager = S3FSManager() # TODO: delete this
|
|
30
|
-
print(s3fs_manager) # TODO: delete this
|
|
31
|
-
output_s3_manager = S3Manager()
|
|
32
|
-
# TODO: s3fs?
|
|
33
|
-
sns_manager = SNSManager()
|
|
34
|
-
ddb_manager = DynamoDBManager()
|
|
35
|
-
|
|
36
|
-
# [1 of 5] Update Pipeline Status in DynamoDB
|
|
37
|
-
# self.dynamodb.update_ status ()
|
|
38
|
-
|
|
39
|
-
# [2 of 5] Download Object From Input Bucket
|
|
40
|
-
# return_value = input_s3_manager.download_file(
|
|
41
|
-
# bucket_name=self.input_bucket_name,
|
|
42
|
-
# key="the_input_key",
|
|
43
|
-
# file_name="the_input_key",
|
|
44
|
-
# )
|
|
45
|
-
# print(return_value)
|
|
46
|
-
|
|
47
|
-
# [3 of 5] Update Entry in DynamoDB
|
|
48
|
-
ship_name = "David_Starr_Jordan" # TODO: get this from input sns message
|
|
49
|
-
cruise_name = "DS0604"
|
|
50
|
-
sensor_name = "EK60"
|
|
51
|
-
file_name = "DSJ0604-D20060406-T113407.raw"
|
|
52
|
-
|
|
53
|
-
test_channels = [
|
|
54
|
-
"GPT 38 kHz 009072055a7f 2 ES38B",
|
|
55
|
-
"GPT 70 kHz 00907203400a 3 ES70-7C",
|
|
56
|
-
"GPT 120 kHz 009072034d52 1 ES120-7",
|
|
57
|
-
"GPT 200 kHz 0090720564e4 4 ES200-7C",
|
|
58
|
-
]
|
|
59
|
-
test_frequencies = [38_000, 70_000, 120_000, 200_000]
|
|
60
|
-
ddb_manager.update_item(
|
|
61
|
-
table_name=self.table_name,
|
|
62
|
-
key={
|
|
63
|
-
"FILE_NAME": {"S": file_name}, # Partition Key
|
|
64
|
-
"CRUISE_NAME": {"S": cruise_name}, # Sort Key
|
|
65
|
-
},
|
|
66
|
-
expression_attribute_names={
|
|
67
|
-
"#CH": "CHANNELS",
|
|
68
|
-
"#ET": "END_TIME",
|
|
69
|
-
"#ED": "ERROR_DETAIL",
|
|
70
|
-
"#FR": "FREQUENCIES",
|
|
71
|
-
"#MA": "MAX_ECHO_RANGE",
|
|
72
|
-
"#MI": "MIN_ECHO_RANGE",
|
|
73
|
-
"#ND": "NUM_PING_TIME_DROPNA",
|
|
74
|
-
"#PS": "PIPELINE_STATUS", # testing this updated
|
|
75
|
-
"#PT": "PIPELINE_TIME", # testing this updated
|
|
76
|
-
"#SE": "SENSOR_NAME",
|
|
77
|
-
"#SH": "SHIP_NAME",
|
|
78
|
-
"#ST": "START_TIME",
|
|
79
|
-
"#ZB": "ZARR_BUCKET",
|
|
80
|
-
"#ZP": "ZARR_PATH",
|
|
81
|
-
},
|
|
82
|
-
expression_attribute_values={
|
|
83
|
-
":ch": {"L": [{"S": i} for i in test_channels]},
|
|
84
|
-
":et": {"S": "2006-04-06T13:35:28.688Z"},
|
|
85
|
-
":ed": {"S": ""},
|
|
86
|
-
":fr": {"L": [{"N": str(i)} for i in test_frequencies]},
|
|
87
|
-
":ma": {"N": str(np.round(499.7653, 4))},
|
|
88
|
-
":mi": {"N": str(np.round(0.25, 4))},
|
|
89
|
-
":nd": {"N": str(2458)},
|
|
90
|
-
":ps": {"S": "SUCCESS_AGGREGATOR"},
|
|
91
|
-
":pt": {"S": "2023-10-02T08:54:43Z"},
|
|
92
|
-
":se": {"S": sensor_name},
|
|
93
|
-
":sh": {"S": ship_name},
|
|
94
|
-
":st": {"S": "2006-04-06T11:34:07.288Z"},
|
|
95
|
-
":zb": {"S": "r2d2-dev-echofish2-118234403147-echofish-dev-output"},
|
|
96
|
-
":zp": {
|
|
97
|
-
"S": "level_1/David_Starr_Jordan/DS0604/EK60/DSJ0604-D20060406-T113407.model"
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
update_expression=(
|
|
101
|
-
"SET "
|
|
102
|
-
"#CH = :ch, "
|
|
103
|
-
"#ET = :et, "
|
|
104
|
-
"#ED = :ed, "
|
|
105
|
-
"#FR = :fr, "
|
|
106
|
-
"#MA = :ma, "
|
|
107
|
-
"#MI = :mi, "
|
|
108
|
-
"#ND = :nd, "
|
|
109
|
-
"#PS = :ps, "
|
|
110
|
-
"#PT = :pt, "
|
|
111
|
-
"#SE = :se, "
|
|
112
|
-
"#SH = :sh, "
|
|
113
|
-
"#ST = :st, "
|
|
114
|
-
"#ZB = :zb, "
|
|
115
|
-
"#ZP = :zp"
|
|
116
|
-
),
|
|
117
|
-
)
|
|
118
|
-
|
|
119
|
-
# [4 of 5] Write Object to Output Bucket
|
|
120
|
-
output_s3_manager.put(
|
|
121
|
-
bucket_name=self.output_bucket_name, key="123", body="456"
|
|
122
|
-
)
|
|
123
|
-
|
|
124
|
-
# [_ of _] Read file-level Zarr store from bucket, Create GeoJSON, Write to bucket
|
|
125
|
-
# [_ of _] Create empty cruise-level Zarr store
|
|
126
|
-
# [_ of _] Resample and write to cruise-level Zarr Store
|
|
127
|
-
|
|
128
|
-
# [5 of 5] Publish Done Message
|
|
129
|
-
success_message = {
|
|
130
|
-
"default": {
|
|
131
|
-
"shipName": ship_name,
|
|
132
|
-
"cruiseName": cruise_name,
|
|
133
|
-
"sensorName": sensor_name,
|
|
134
|
-
"fileName": file_name,
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
sns_manager.publish(
|
|
138
|
-
topic_arn=self.topic_arn,
|
|
139
|
-
message=json.dumps(success_message),
|
|
140
|
-
)
|
|
141
|
-
print("done...")
|
|
142
|
-
|
|
143
|
-
#######################################################
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
###########################################################
|
|
147
|
-
###########################################################
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: water_column_sonar_processing
|
|
3
|
-
Version: 0.0.6
|
|
4
|
-
Summary: A processing tool for water column sonar data.
|
|
5
|
-
Author-email: Rudy Klucik <rudy.klucik@noaa.gov>
|
|
6
|
-
Project-URL: Homepage, https://github.com/CI-CMG/water-column-sonar-processing
|
|
7
|
-
Project-URL: Issues, https://github.com/CI-CMG/water-column-sonar-processing/issues
|
|
8
|
-
Classifier: Programming Language :: Python :: 3
|
|
9
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
-
Classifier: Operating System :: OS Independent
|
|
11
|
-
Requires-Python: >=3.10
|
|
12
|
-
Description-Content-Type: text/markdown
|
|
13
|
-
License-File: LICENSE
|
|
14
|
-
Requires-Dist: aiobotocore~=2.9.0
|
|
15
|
-
Requires-Dist: aiohttp~=3.10.10
|
|
16
|
-
Requires-Dist: boto3==1.33.13
|
|
17
|
-
Requires-Dist: botocore~=1.33.13
|
|
18
|
-
Requires-Dist: echopype==0.9.0
|
|
19
|
-
Requires-Dist: geopandas==1.0.1
|
|
20
|
-
Requires-Dist: mock~=5.1.0
|
|
21
|
-
Requires-Dist: moto~=5.0.18
|
|
22
|
-
Requires-Dist: numcodecs==0.13.1
|
|
23
|
-
Requires-Dist: numpy==1.26.4
|
|
24
|
-
Requires-Dist: pandas==2.2.3
|
|
25
|
-
Requires-Dist: pytest~=8.3.3
|
|
26
|
-
Requires-Dist: python-dotenv==1.0.0
|
|
27
|
-
Requires-Dist: requests==2.32.3
|
|
28
|
-
Requires-Dist: s3fs==2024.10.0
|
|
29
|
-
Requires-Dist: scipy==1.14.1
|
|
30
|
-
Requires-Dist: shapely==2.0.3
|
|
31
|
-
Requires-Dist: typing-extensions==4.10.0
|
|
32
|
-
Requires-Dist: xarray==2022.12.0
|
|
33
|
-
Requires-Dist: zarr==2.18.3
|
|
34
|
-
|
|
35
|
-
# Water Column Sonar Processing
|
|
36
|
-
Processing tool for converting L0 data to L1 and L2 as well as generating geospatial information
|
|
37
|
-
|
|
38
|
-
# Setting up the Python Environment
|
|
39
|
-
> Python 3.10.12
|
|
40
|
-
|
|
41
|
-
# MacOS Pyenv Installation Instructions
|
|
42
|
-
1. Install pyenv (https://github.com/pyenv/pyenv#set-up-your-shell-environment-for-pyenv)
|
|
43
|
-
1. ```brew update```
|
|
44
|
-
2. ```arch -arm64 brew install pyenv```
|
|
45
|
-
3. In ~/.bashrc add
|
|
46
|
-
1. ```export PYENV_ROOT="$HOME/.pyenv"```
|
|
47
|
-
2. ```export PATH="$PYENV_ROOT/bin:$PATH"```
|
|
48
|
-
3. ```eval "$(pyenv init -)"```
|
|
49
|
-
4. ```arch -arm64 brew install openssl readline sqlite3 xz zlib tcl-tk```
|
|
50
|
-
2. Install pyenv-virtualenv (https://github.com/pyenv/pyenv-virtualenv)
|
|
51
|
-
1. ```arch -arm64 brew install pyenv-virtualenv```
|
|
52
|
-
2. In ~/.bashrc add
|
|
53
|
-
1. ```eval "$(pyenv virtualenv-init -)"```
|
|
54
|
-
3. Open a new terminal
|
|
55
|
-
4. Install Python version
|
|
56
|
-
1. ```env CONFIGURE_OPTS='--enable-optimizations' arch -arm64 pyenv install 3.10.12```
|
|
57
|
-
5. Create virtual env (to delete 'pyenv uninstall 3.10.12/water-column-sonar-processing')
|
|
58
|
-
1. ```pyenv virtualenv 3.10.12 water-column-sonar-processing```
|
|
59
|
-
6. Set local version of python (if not done already)
|
|
60
|
-
1. change directory to root of project
|
|
61
|
-
2. ```pyenv local 3.10.12 water-column-sonar-processing```
|
|
62
|
-
3. ```pyenv activate water-column-sonar-processing```
|
|
63
|
-
|
|
64
|
-
# Setting up IntelliJ
|
|
65
|
-
|
|
66
|
-
1. Install the IntelliJ Python plugin
|
|
67
|
-
2. Set up pyenv
|
|
68
|
-
1. File -> Project Structure or CMD + ;
|
|
69
|
-
2. SDKs -> + -> Add Python SDK -> Virtual Environment
|
|
70
|
-
3. Select Existing Environment
|
|
71
|
-
4. Choose ~/.pyenv/versions/mocking_aws/bin/python
|
|
72
|
-
3. Set up Python Facet (not sure if this is required)
|
|
73
|
-
1. File -> Project Structure or CMD + ;
|
|
74
|
-
2. Facets -> + -> Python
|
|
75
|
-
3. Set interpreter
|
|
76
|
-
|
|
77
|
-
# Installing Dependencies
|
|
78
|
-
|
|
79
|
-
1. Add dependencies with versions to requirements.txt
|
|
80
|
-
2. ```pip install --upgrade pip && pip install -r requirements_dev.txt```
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
# Pytest
|
|
84
|
-
```commandline
|
|
85
|
-
pytest --disable-warnings
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
# Instructions
|
|
89
|
-
Following this tutorial:
|
|
90
|
-
https://packaging.python.org/en/latest/tutorials/packaging-projects/
|
|
91
|
-
|
|
92
|
-
# To Publish To TEST
|
|
93
|
-
```commandline
|
|
94
|
-
python -m build
|
|
95
|
-
# python -m build --sdist
|
|
96
|
-
# python -m build --wheel
|
|
97
|
-
python -m twine upload --repository testpypi dist/*
|
|
98
|
-
pytho -m pip install --index-url https://test.pypi.org/simple/ hello-pypi-rudy-klucik
|
|
99
|
-
python
|
|
100
|
-
```
|
|
101
|
-
```
|
|
102
|
-
from water-column-sonar-processing import ZarrManager
|
|
103
|
-
example.add_one(2)
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
# To Publish To PROD
|
|
107
|
-
```commandline
|
|
108
|
-
python -m build
|
|
109
|
-
python -m twine upload --repository pypi dist/*
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
# Pre Commit Hook
|
|
113
|
-
https://dev.to/rafaelherik/using-trufflehog-and-pre-commit-hook-to-prevent-secret-exposure-edo
|
|
114
|
-
```
|
|
115
|
-
pre-commit install --allow-missing-config
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
# Linting
|
|
119
|
-
Ruff
|
|
120
|
-
https://plugins.jetbrains.com/plugin/20574-ruff
|
|
121
|
-
|
|
122
|
-
# Colab Test
|
|
123
|
-
https://colab.research.google.com/drive/1KiLMueXiz9WVB9o4RuzYeGjNZ6PsZU7a#scrollTo=AayVyvpBdfIZ
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
water_column_sonar_processing/__init__.py,sha256=S11loSDNOmZRyiTMbTwiQ1PP59SSPq2q2P61e5gPrW4,295
|
|
2
|
-
water_column_sonar_processing/process.py,sha256=AHoCehc95XqGI1IZkvfcbnYpjr8J-OQfCBGs0-1O9_w,5439
|
|
3
|
-
water_column_sonar_processing/aws/__init__.py,sha256=u5J-TOEVgAQsMdc5LMo1igUESRclzV8gf-b0jUaJ9Gg,277
|
|
4
|
-
water_column_sonar_processing/aws/dynamodb_manager.py,sha256=sPa_5RlTNjcFavZ74LF0UINKSyrbgJNROXbe16hCz7U,5936
|
|
5
|
-
water_column_sonar_processing/aws/s3_manager.py,sha256=P-0ZFsa6D6obIy-iNnWF1BrcoHOfAvYM-Qn9cA0e5H0,13142
|
|
6
|
-
water_column_sonar_processing/aws/s3fs_manager.py,sha256=thVJPQKhbvF1g-Ue3BYgwazFOFDYOICIEJx4zkXBQ1E,2381
|
|
7
|
-
water_column_sonar_processing/aws/sns_manager.py,sha256=Dp9avG5VSugSWPR1dZ-askuAw1fCZkNUHbOUP65iR-k,1867
|
|
8
|
-
water_column_sonar_processing/aws/sqs_manager.py,sha256=NSUrWmnSC8h8Gf7gT0U8zFaQQ-yX89h0Q0mDLKGqp2Y,1597
|
|
9
|
-
water_column_sonar_processing/cruise/__init__.py,sha256=H5hW0JMORuaFvQk_R31B4VL8RnRyKeanOOiWmqEMZJk,156
|
|
10
|
-
water_column_sonar_processing/cruise/create_empty_zarr_store.py,sha256=w2lxfPS2HRVlNCr6OWBRxIyGaPUnxAnWrYgmu0EgOL0,7275
|
|
11
|
-
water_column_sonar_processing/cruise/resample_regrid.py,sha256=HeRN4EOZch-HhiK-s5LjX0bz4sKXKpea5YVIMEZOAGg,12356
|
|
12
|
-
water_column_sonar_processing/geometry/__init__.py,sha256=_ol5nI8AL30pYXeAh5rtP7YmQggitPC6LA_kuTfPJ0Q,231
|
|
13
|
-
water_column_sonar_processing/geometry/geometry_manager.py,sha256=RJ5pljMLqjNdJbc8Q0s-HGphMy6B7e_7R7ZZfdxEY-k,9913
|
|
14
|
-
water_column_sonar_processing/geometry/geometry_simplification.py,sha256=im1HG9nfYIerQv3w-PUHzphw2B7aGgnsA3Zcdy2oTmA,3016
|
|
15
|
-
water_column_sonar_processing/geometry/pmtile_generation.py,sha256=KI5y3CVBXSrxYoenQPHBUhPPAvcw1bkqCg1LZ9xvlzY,2772
|
|
16
|
-
water_column_sonar_processing/index/__init__.py,sha256=izEObsKiOoIJ0kZCFhvaYsBd6Ga71XJxnogjrNInw68,68
|
|
17
|
-
water_column_sonar_processing/index/index_manager.py,sha256=2D4mbWK2D3p0wsZqeoxieCtz9HsDkm5Mvt9u2t12BFI,11107
|
|
18
|
-
water_column_sonar_processing/model/__init__.py,sha256=FXaCdbPqxp0ogmZm9NplRirqpgMiYs1iRYgJbFbbX2Y,65
|
|
19
|
-
water_column_sonar_processing/model/zarr_manager.py,sha256=IvA2mTZ6YrfTKL3U6NVgmjeqYPUXMSI3V-HI5ESgAwg,13408
|
|
20
|
-
water_column_sonar_processing/utility/__init__.py,sha256=nyqPobcvwftr6T4MNxNtQtfbWzW9Kgpbp6JO7Gr5IZI,206
|
|
21
|
-
water_column_sonar_processing/utility/cleaner.py,sha256=jaNDHbZxqQv2I8VfFkbwlQoCtIHi1pQonqt3XtioVq0,585
|
|
22
|
-
water_column_sonar_processing/utility/constants.py,sha256=qSuxPg4dnyI4DDXWc1OYqTBTChxZ9iWdUrFfqLtH21c,1793
|
|
23
|
-
water_column_sonar_processing/utility/pipeline_status.py,sha256=O-0SySqdRGJ6bs3zQe1NV9vkOpmsRM7zj5QoHgzYioY,4395
|
|
24
|
-
water_column_sonar_processing/utility/timestamp.py,sha256=bO0oir7KxxoEHPGRkz9FCBfOligkocUyRiWRzAq8fnU,361
|
|
25
|
-
water_column_sonar_processing-0.0.6.dist-info/LICENSE,sha256=lz4IpJ5_adG3S0ali-WaIpQFVTnEAOucMDQPECUVEYw,1110
|
|
26
|
-
water_column_sonar_processing-0.0.6.dist-info/METADATA,sha256=nQW75RMHtE7D1faQBnzZ2L9IL7hlAITv_oHfnur8D0Y,4109
|
|
27
|
-
water_column_sonar_processing-0.0.6.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
|
|
28
|
-
water_column_sonar_processing-0.0.6.dist-info/top_level.txt,sha256=aRYU4A7RNBlNrL4vzjytFAir3BNnmOgsvIGKKA36tg4,30
|
|
29
|
-
water_column_sonar_processing-0.0.6.dist-info/RECORD,,
|
|
File without changes
|