pyadps 0.1.1__tar.gz → 0.2.0b0__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.
- {pyadps-0.1.1 → pyadps-0.2.0b0}/PKG-INFO +24 -55
- {pyadps-0.1.1 → pyadps-0.2.0b0}/README.md +20 -51
- {pyadps-0.1.1 → pyadps-0.2.0b0}/pyproject.toml +10 -10
- pyadps-0.2.0b0/src/pyadps/Home_Page.py +42 -0
- {pyadps-0.1.1 → pyadps-0.2.0b0}/src/pyadps/pages/01_Read_File.py +17 -190
- pyadps-0.2.0b0/src/pyadps/pages/02_View_Raw_Data.py +128 -0
- {pyadps-0.1.1 → pyadps-0.2.0b0}/src/pyadps/pages/03_Download_Raw_File.py +61 -149
- pyadps-0.2.0b0/src/pyadps/pages/04_QC_Test.py +334 -0
- pyadps-0.2.0b0/src/pyadps/pages/05_Profile_Test.py +575 -0
- pyadps-0.2.0b0/src/pyadps/pages/06_Velocity_Test.py +341 -0
- pyadps-0.2.0b0/src/pyadps/pages/07_Write_File.py +452 -0
- {pyadps-0.1.1 → pyadps-0.2.0b0}/src/pyadps/utils/__init__.py +3 -3
- pyadps-0.2.0b0/src/pyadps/utils/autoprocess.py +282 -0
- pyadps-0.1.1/src/pyadps/utils/plotgen.py → pyadps-0.2.0b0/src/pyadps/utils/cutbin.py +14 -332
- {pyadps-0.1.1 → pyadps-0.2.0b0}/src/pyadps/utils/metadata/config.ini +4 -22
- pyadps-0.2.0b0/src/pyadps/utils/plotgen.py +229 -0
- pyadps-0.2.0b0/src/pyadps/utils/profile_test.py +187 -0
- {pyadps-0.1.1 → pyadps-0.2.0b0}/src/pyadps/utils/pyreadrdi.py +17 -27
- {pyadps-0.1.1 → pyadps-0.2.0b0}/src/pyadps/utils/readrdi.py +18 -164
- pyadps-0.1.1/src/pyadps/utils/__pycache__/regrid.cpython-312.pyc → pyadps-0.2.0b0/src/pyadps/utils/regrid.py +0 -0
- pyadps-0.2.0b0/src/pyadps/utils/script.py +155 -0
- pyadps-0.2.0b0/src/pyadps/utils/signal_quality.py +135 -0
- {pyadps-0.1.1 → pyadps-0.2.0b0}/src/pyadps/utils/velocity_test.py +31 -79
- {pyadps-0.1.1 → pyadps-0.2.0b0}/src/pyadps/utils/writenc.py +21 -155
- pyadps-0.1.1/src/pyadps/Home_Page.py +0 -48
- pyadps-0.1.1/src/pyadps/pages/02_View_Raw_Data.py +0 -164
- pyadps-0.1.1/src/pyadps/pages/04_Sensor_Health.py +0 -905
- pyadps-0.1.1/src/pyadps/pages/05_QC_Test.py +0 -476
- pyadps-0.1.1/src/pyadps/pages/06_Profile_Test.py +0 -971
- pyadps-0.1.1/src/pyadps/pages/07_Velocity_Test.py +0 -600
- pyadps-0.1.1/src/pyadps/pages/08_Write_File.py +0 -587
- pyadps-0.1.1/src/pyadps/pages/09_Auto_process.py +0 -64
- pyadps-0.1.1/src/pyadps/pages/__pycache__/__init__.cpython-312.pyc +0 -0
- pyadps-0.1.1/src/pyadps/utils/__pycache__/__init__.cpython-312.pyc +0 -0
- pyadps-0.1.1/src/pyadps/utils/__pycache__/autoprocess.cpython-312.pyc +0 -0
- pyadps-0.1.1/src/pyadps/utils/__pycache__/cutbin.cpython-312.pyc +0 -0
- pyadps-0.1.1/src/pyadps/utils/__pycache__/plotgen.cpython-312.pyc +0 -0
- pyadps-0.1.1/src/pyadps/utils/__pycache__/profile_test.cpython-312.pyc +0 -0
- pyadps-0.1.1/src/pyadps/utils/__pycache__/pyreadrdi.cpython-312.pyc +0 -0
- pyadps-0.1.1/src/pyadps/utils/__pycache__/readrdi.cpython-312.pyc +0 -0
- pyadps-0.1.1/src/pyadps/utils/__pycache__/script.cpython-312.pyc +0 -0
- pyadps-0.1.1/src/pyadps/utils/__pycache__/sensor_health.cpython-312.pyc +0 -0
- pyadps-0.1.1/src/pyadps/utils/__pycache__/signal_quality.cpython-312.pyc +0 -0
- pyadps-0.1.1/src/pyadps/utils/__pycache__/velocity_test.cpython-312.pyc +0 -0
- pyadps-0.1.1/src/pyadps/utils/__pycache__/writenc.cpython-312.pyc +0 -0
- pyadps-0.1.1/src/pyadps/utils/autoprocess.py +0 -548
- pyadps-0.1.1/src/pyadps/utils/metadata/demo.000 +0 -0
- pyadps-0.1.1/src/pyadps/utils/profile_test.py +0 -556
- pyadps-0.1.1/src/pyadps/utils/script.py +0 -205
- pyadps-0.1.1/src/pyadps/utils/sensor_health.py +0 -120
- pyadps-0.1.1/src/pyadps/utils/signal_quality.py +0 -455
- {pyadps-0.1.1 → pyadps-0.2.0b0}/LICENSE +0 -0
- {pyadps-0.1.1 → pyadps-0.2.0b0}/src/pyadps/__init__.py +0 -0
- {pyadps-0.1.1 → pyadps-0.2.0b0}/src/pyadps/__main__.py +0 -0
- {pyadps-0.1.1 → pyadps-0.2.0b0}/src/pyadps/pages/__init__.py +0 -0
- {pyadps-0.1.1 → pyadps-0.2.0b0}/src/pyadps/utils/metadata/flmeta.json +0 -0
- {pyadps-0.1.1 → pyadps-0.2.0b0}/src/pyadps/utils/metadata/vlmeta.json +0 -0
@@ -1,8 +1,8 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.1
|
2
2
|
Name: pyadps
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.2.0b0
|
4
4
|
Summary: A Python package for ADCP data processing
|
5
|
-
Home-page: https://
|
5
|
+
Home-page: https://example.com
|
6
6
|
License: MIT
|
7
7
|
Keywords: adcp,data-processing,oceanography
|
8
8
|
Author: P. Amol
|
@@ -22,30 +22,18 @@ Requires-Dist: numpy (>=1.26.4)
|
|
22
22
|
Requires-Dist: pandas (>=2.2.2)
|
23
23
|
Requires-Dist: plotly (>=5.22.0)
|
24
24
|
Requires-Dist: plotly-resampler (>=0.10.0)
|
25
|
-
Requires-Dist: pygeomag (>=1.1.0,<2.0.0)
|
26
25
|
Requires-Dist: scipy (>=1.14.0)
|
27
26
|
Requires-Dist: streamlit (>=1.36.0)
|
28
|
-
|
27
|
+
Requires-Dist: wmm2020 (>=1.1.1)
|
28
|
+
Project-URL: Documentation, https://example.com/docs
|
29
29
|
Project-URL: Repository, https://github.com/p-amol/pyadps
|
30
30
|
Description-Content-Type: text/markdown
|
31
31
|
|
32
32
|
# pyadps
|
33
33
|
|
34
|
-
`pyadps` is a Python package for processing moored Acoustic Doppler
|
35
|
-
Current Profiler (ADCP) data. It provides various functionalities
|
36
|
-
such as data reading, quality control tests, NetCDF file creation,
|
37
|
-
and visualization.
|
34
|
+
`pyadps` is a Python package for processing moored Acoustic Doppler Current Profiler (ADCP) data. It provides various functionalities such as data reading, quality control tests, NetCDF file creation, and visualization.
|
38
35
|
|
39
|
-
This software offers both a graphical interface (`Streamlit`) for
|
40
|
-
those new to Python and direct Python package access for experienced
|
41
|
-
users. Please note that `pyadps` is primarily designed for Teledyne
|
42
|
-
RDI workhorse ADCPs. Other company's ADCP files are not compatible,
|
43
|
-
and while some other RDI models may work, they might require additional
|
44
|
-
considerations.
|
45
|
-
|
46
|
-
- Documentation: <https://pyadps.readthedocs.io>
|
47
|
-
- Source code: <https://github.com/p-amol/pyadps>
|
48
|
-
- Bug reports: <https://github.com/p-amol/pyadps/issues>
|
36
|
+
This software offers both a graphical interface (`Streamlit`) for those new to Python and direct Python package access for experienced users. Please note that `pyadps` is primarily designed for Teledyne RDI workhorse ADCPs. Other company's ADCP files are not compatible, and while some other RDI models may work, they might require additional considerations.
|
49
37
|
|
50
38
|
## Table of Contents
|
51
39
|
|
@@ -55,49 +43,37 @@ considerations.
|
|
55
43
|
|
56
44
|
## Installation
|
57
45
|
|
58
|
-
We recommend installing the package within a virtual environment.
|
59
|
-
|
60
|
-
You can create a Python environment using tools like `venv` or `conda`.
|
61
|
-
Below are instructions for both methods.
|
46
|
+
We recommend installing the package within a virtual environment. At present, the package is compatible exclusively with Python version 3.12.
|
47
|
+
You can create a Python environment using tools like `venv` or `conda`. Below are instructions for both methods.
|
62
48
|
|
63
49
|
### 1. Using `venv` (Built-in Python Tool)
|
64
50
|
|
65
51
|
#### Step 1: Install Python version 3.12 (if not already installed)
|
66
|
-
|
67
52
|
Ensure you have Python installed. You can download the latest version from [python.org](https://www.python.org/downloads/).
|
68
53
|
|
69
|
-
#### Step 2: Create a Virtual Environment
|
70
|
-
|
54
|
+
#### Step 2: Create a Virtual Environment
|
71
55
|
- Open your terminal or command prompt.
|
72
56
|
- Navigate to your project folder:
|
73
|
-
|
74
57
|
```bash
|
75
58
|
cd /path/to/your/project
|
76
59
|
```
|
77
|
-
|
78
|
-
- Run the following command to create a virtual environment
|
79
|
-
(replace adpsenv with your preferred environment name):
|
60
|
+
- Run the following command to create a virtual environment (replace adpsenv with your preferred environment name):
|
80
61
|
|
81
62
|
```bash
|
82
63
|
python -m venv adpsenv
|
83
64
|
```
|
84
65
|
|
85
66
|
#### Step 3: Activate the Environment
|
86
|
-
|
87
67
|
- On Windows:
|
88
|
-
|
89
68
|
```bash
|
90
69
|
adpsenv\Scripts\activate
|
91
70
|
```
|
92
71
|
|
93
72
|
- On macOS/Linux:
|
94
|
-
|
95
73
|
```bash
|
96
74
|
source adpsenv/bin/activate
|
97
75
|
```
|
98
|
-
|
99
|
-
You’ll see the environment name in your terminal prompt
|
100
|
-
indicating the environment is active.
|
76
|
+
You’ll see the environment name in your terminal prompt indicating the environment is active.
|
101
77
|
|
102
78
|
#### Step 4: Install Dependencies
|
103
79
|
|
@@ -108,51 +84,44 @@ pip install pyadps
|
|
108
84
|
```
|
109
85
|
|
110
86
|
#### Step 5: Deactivate the Environment
|
111
|
-
|
112
87
|
When you’re done working in the environment, deactivate it by running:
|
113
88
|
|
114
89
|
```bash
|
115
90
|
deactivate
|
116
91
|
```
|
117
92
|
|
118
|
-
### 2. Using `conda` (Anaconda/Miniconda)
|
119
93
|
|
120
|
-
#### Step 1: Install Conda
|
121
94
|
|
95
|
+
|
96
|
+
### 2. Using `conda` (Anaconda/Miniconda):
|
97
|
+
|
98
|
+
#### Step 1: Install Conda
|
122
99
|
First, you need to have Conda installed on your system. You can either install:
|
123
100
|
|
124
101
|
- [Anaconda (Full Distribution)](https://www.anaconda.com/products/individual)
|
125
102
|
- [Miniconda (Lightweight Version)](https://docs.conda.io/en/latest/miniconda.html)
|
126
103
|
|
127
104
|
#### Step 2: Create a Conda Environment with Python 3.12
|
128
|
-
|
129
|
-
Once Conda is installed, open a terminal or command prompt and run
|
130
|
-
the following to create a new environment (replace `adpsenv` with
|
131
|
-
your preferred environment name):
|
105
|
+
Once Conda is installed, open a terminal or command prompt and run the following to create a new environment (replace `adpsenv` with your preferred environment name):
|
132
106
|
|
133
107
|
```bash
|
134
108
|
conda create --name adpsenv python=3.12
|
135
109
|
```
|
136
110
|
|
137
|
-
#### Step 3: Activate the
|
138
|
-
|
111
|
+
#### Step 3: Activate the Environment
|
139
112
|
```bash
|
140
113
|
conda activate adpsenv
|
141
114
|
```
|
142
115
|
|
143
|
-
#### Step 4: Install
|
144
|
-
|
145
|
-
You can install packages with pip inside Conda environments.
|
146
|
-
|
116
|
+
#### Step 4: Install Dependencies
|
117
|
+
You can install packages with pip inside Conda environments.
|
147
118
|
```bash
|
148
119
|
pip install pyadps
|
149
120
|
```
|
150
121
|
|
151
|
-
#### Step 5: Deactivate the
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
```bash
|
122
|
+
#### Step 5: Deactivate the Environment
|
123
|
+
When done, deactivate the environment by running:
|
124
|
+
```
|
156
125
|
conda deactivate
|
157
126
|
```
|
158
127
|
|
@@ -161,11 +130,11 @@ conda deactivate
|
|
161
130
|
### Streamlit web interface
|
162
131
|
|
163
132
|
Open a terminal or command prompt, activate the environment, and run the command.
|
164
|
-
|
165
133
|
```bash
|
166
134
|
run-pyadps
|
167
135
|
```
|
168
136
|
|
137
|
+
|
169
138
|
## License
|
170
139
|
|
171
140
|
This project is licensed under the MIT License. See the LICENSE file for details.
|
@@ -1,20 +1,8 @@
|
|
1
1
|
# pyadps
|
2
2
|
|
3
|
-
`pyadps` is a Python package for processing moored Acoustic Doppler
|
4
|
-
|
5
|
-
|
6
|
-
and visualization.
|
7
|
-
|
8
|
-
This software offers both a graphical interface (`Streamlit`) for
|
9
|
-
those new to Python and direct Python package access for experienced
|
10
|
-
users. Please note that `pyadps` is primarily designed for Teledyne
|
11
|
-
RDI workhorse ADCPs. Other company's ADCP files are not compatible,
|
12
|
-
and while some other RDI models may work, they might require additional
|
13
|
-
considerations.
|
14
|
-
|
15
|
-
- Documentation: <https://pyadps.readthedocs.io>
|
16
|
-
- Source code: <https://github.com/p-amol/pyadps>
|
17
|
-
- Bug reports: <https://github.com/p-amol/pyadps/issues>
|
3
|
+
`pyadps` is a Python package for processing moored Acoustic Doppler Current Profiler (ADCP) data. It provides various functionalities such as data reading, quality control tests, NetCDF file creation, and visualization.
|
4
|
+
|
5
|
+
This software offers both a graphical interface (`Streamlit`) for those new to Python and direct Python package access for experienced users. Please note that `pyadps` is primarily designed for Teledyne RDI workhorse ADCPs. Other company's ADCP files are not compatible, and while some other RDI models may work, they might require additional considerations.
|
18
6
|
|
19
7
|
## Table of Contents
|
20
8
|
|
@@ -24,49 +12,37 @@ considerations.
|
|
24
12
|
|
25
13
|
## Installation
|
26
14
|
|
27
|
-
We recommend installing the package within a virtual environment.
|
28
|
-
|
29
|
-
You can create a Python environment using tools like `venv` or `conda`.
|
30
|
-
Below are instructions for both methods.
|
15
|
+
We recommend installing the package within a virtual environment. At present, the package is compatible exclusively with Python version 3.12.
|
16
|
+
You can create a Python environment using tools like `venv` or `conda`. Below are instructions for both methods.
|
31
17
|
|
32
18
|
### 1. Using `venv` (Built-in Python Tool)
|
33
19
|
|
34
20
|
#### Step 1: Install Python version 3.12 (if not already installed)
|
35
|
-
|
36
21
|
Ensure you have Python installed. You can download the latest version from [python.org](https://www.python.org/downloads/).
|
37
22
|
|
38
|
-
#### Step 2: Create a Virtual Environment
|
39
|
-
|
23
|
+
#### Step 2: Create a Virtual Environment
|
40
24
|
- Open your terminal or command prompt.
|
41
25
|
- Navigate to your project folder:
|
42
|
-
|
43
26
|
```bash
|
44
27
|
cd /path/to/your/project
|
45
28
|
```
|
46
|
-
|
47
|
-
- Run the following command to create a virtual environment
|
48
|
-
(replace adpsenv with your preferred environment name):
|
29
|
+
- Run the following command to create a virtual environment (replace adpsenv with your preferred environment name):
|
49
30
|
|
50
31
|
```bash
|
51
32
|
python -m venv adpsenv
|
52
33
|
```
|
53
34
|
|
54
35
|
#### Step 3: Activate the Environment
|
55
|
-
|
56
36
|
- On Windows:
|
57
|
-
|
58
37
|
```bash
|
59
38
|
adpsenv\Scripts\activate
|
60
39
|
```
|
61
40
|
|
62
41
|
- On macOS/Linux:
|
63
|
-
|
64
42
|
```bash
|
65
43
|
source adpsenv/bin/activate
|
66
44
|
```
|
67
|
-
|
68
|
-
You’ll see the environment name in your terminal prompt
|
69
|
-
indicating the environment is active.
|
45
|
+
You’ll see the environment name in your terminal prompt indicating the environment is active.
|
70
46
|
|
71
47
|
#### Step 4: Install Dependencies
|
72
48
|
|
@@ -77,51 +53,44 @@ pip install pyadps
|
|
77
53
|
```
|
78
54
|
|
79
55
|
#### Step 5: Deactivate the Environment
|
80
|
-
|
81
56
|
When you’re done working in the environment, deactivate it by running:
|
82
57
|
|
83
58
|
```bash
|
84
59
|
deactivate
|
85
60
|
```
|
86
61
|
|
87
|
-
### 2. Using `conda` (Anaconda/Miniconda)
|
88
62
|
|
89
|
-
#### Step 1: Install Conda
|
90
63
|
|
64
|
+
|
65
|
+
### 2. Using `conda` (Anaconda/Miniconda):
|
66
|
+
|
67
|
+
#### Step 1: Install Conda
|
91
68
|
First, you need to have Conda installed on your system. You can either install:
|
92
69
|
|
93
70
|
- [Anaconda (Full Distribution)](https://www.anaconda.com/products/individual)
|
94
71
|
- [Miniconda (Lightweight Version)](https://docs.conda.io/en/latest/miniconda.html)
|
95
72
|
|
96
73
|
#### Step 2: Create a Conda Environment with Python 3.12
|
97
|
-
|
98
|
-
Once Conda is installed, open a terminal or command prompt and run
|
99
|
-
the following to create a new environment (replace `adpsenv` with
|
100
|
-
your preferred environment name):
|
74
|
+
Once Conda is installed, open a terminal or command prompt and run the following to create a new environment (replace `adpsenv` with your preferred environment name):
|
101
75
|
|
102
76
|
```bash
|
103
77
|
conda create --name adpsenv python=3.12
|
104
78
|
```
|
105
79
|
|
106
|
-
#### Step 3: Activate the
|
107
|
-
|
80
|
+
#### Step 3: Activate the Environment
|
108
81
|
```bash
|
109
82
|
conda activate adpsenv
|
110
83
|
```
|
111
84
|
|
112
|
-
#### Step 4: Install
|
113
|
-
|
114
|
-
You can install packages with pip inside Conda environments.
|
115
|
-
|
85
|
+
#### Step 4: Install Dependencies
|
86
|
+
You can install packages with pip inside Conda environments.
|
116
87
|
```bash
|
117
88
|
pip install pyadps
|
118
89
|
```
|
119
90
|
|
120
|
-
#### Step 5: Deactivate the
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
```bash
|
91
|
+
#### Step 5: Deactivate the Environment
|
92
|
+
When done, deactivate the environment by running:
|
93
|
+
```
|
125
94
|
conda deactivate
|
126
95
|
```
|
127
96
|
|
@@ -130,11 +99,11 @@ conda deactivate
|
|
130
99
|
### Streamlit web interface
|
131
100
|
|
132
101
|
Open a terminal or command prompt, activate the environment, and run the command.
|
133
|
-
|
134
102
|
```bash
|
135
103
|
run-pyadps
|
136
104
|
```
|
137
105
|
|
106
|
+
|
138
107
|
## License
|
139
108
|
|
140
109
|
This project is licensed under the MIT License. See the LICENSE file for details.
|
@@ -1,19 +1,19 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "pyadps"
|
3
|
-
version = "0.
|
3
|
+
version = "0.2.0-beta"
|
4
4
|
description = "A Python package for ADCP data processing"
|
5
5
|
authors = ["P. Amol <prakashamol@gmail.com>"]
|
6
6
|
readme = "README.md"
|
7
7
|
license = "MIT"
|
8
|
-
homepage = "https://
|
9
|
-
repository = "https://github.com/p-amol/pyadps"
|
10
|
-
documentation = "https://
|
8
|
+
homepage = "https://example.com" # You can add your homepage URL or GitHub URL here
|
9
|
+
repository = "https://github.com/p-amol/pyadps" # Replace with your repository link
|
10
|
+
documentation = "https://example.com/docs" # Optional documentation link
|
11
11
|
keywords = ["adcp", "data-processing", "oceanography"]
|
12
12
|
include = ["utils/metadata/*.json"]
|
13
13
|
classifiers = [
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
"Programming Language :: Python :: 3",
|
15
|
+
"License :: OSI Approved :: MIT License",
|
16
|
+
"Operating System :: OS Independent"
|
17
17
|
]
|
18
18
|
|
19
19
|
|
@@ -23,14 +23,13 @@ streamlit = ">=1.36.0"
|
|
23
23
|
numpy = ">=1.26.4"
|
24
24
|
matplotlib = ">=3.8.4"
|
25
25
|
scipy = ">=1.14.0"
|
26
|
+
wmm2020 = ">=1.1.1"
|
26
27
|
cmake = ">=3.30.2"
|
27
28
|
pandas = ">=2.2.2"
|
28
29
|
netCDF4 = ">=1.7.1"
|
29
30
|
plotly = ">=5.22.0"
|
30
31
|
plotly-resampler = ">=0.10.0"
|
31
32
|
meson = ">=1.4.1"
|
32
|
-
pygeomag = "^1.1.0"
|
33
|
-
|
34
33
|
|
35
34
|
[tool.poetry.extras]
|
36
35
|
tests = ["pytest"]
|
@@ -38,8 +37,9 @@ tests = ["pytest"]
|
|
38
37
|
[tool.poetry.scripts]
|
39
38
|
run-pyadps = "pyadps.__main__:main"
|
40
39
|
run-auto = "pyadps.utils.autoprocess:main"
|
41
|
-
run-script = "pyadps.utils.script:main"
|
42
40
|
|
43
41
|
[build-system]
|
44
42
|
requires = ["poetry-core>=1.0.0"]
|
45
43
|
build-backend = "poetry.core.masonry.api"
|
44
|
+
|
45
|
+
|
@@ -0,0 +1,42 @@
|
|
1
|
+
import streamlit as st
|
2
|
+
|
3
|
+
|
4
|
+
def main():
|
5
|
+
st.set_page_config(
|
6
|
+
page_title="ADCP Data Processing Software",
|
7
|
+
page_icon=":world_map:️",
|
8
|
+
layout="wide",
|
9
|
+
initial_sidebar_state="auto",
|
10
|
+
menu_items={
|
11
|
+
"Get Help": "http://github.com/p-amol/adps",
|
12
|
+
"Report a bug": "http://github.com/adps/issues",
|
13
|
+
"About": "# Python ADCP Data Processing Software (PyADPS)",
|
14
|
+
},
|
15
|
+
)
|
16
|
+
|
17
|
+
"""
|
18
|
+
# **Python ADCP Data Processing Software (pyadps)**
|
19
|
+
`pyadps` is a software for processing Teledyne RDI Acoustic Doppler Current Profiler (ADCP) PD0 files. Currently the software can process the data from Workhorse ADCPs.
|
20
|
+
|
21
|
+
## Features
|
22
|
+
|
23
|
+
* Access RDI ADCP binary files using Python 3
|
24
|
+
* Convert RDI binary files to netcdf
|
25
|
+
* Process ADCP data
|
26
|
+
|
27
|
+
## Contribute
|
28
|
+
Issue Tracker: http://github.com/adps/issues
|
29
|
+
Source Code: http://github.com/p-amol/adps
|
30
|
+
|
31
|
+
## Support
|
32
|
+
If you are having issues, please let us know.
|
33
|
+
We have a mailing list located at: adps-python@google-groups.com
|
34
|
+
|
35
|
+
## License
|
36
|
+
The project is licensed under the MIT license.
|
37
|
+
|
38
|
+
"""
|
39
|
+
|
40
|
+
|
41
|
+
if __name__ == "__main__":
|
42
|
+
main()
|
@@ -1,15 +1,12 @@
|
|
1
1
|
import os
|
2
2
|
import tempfile
|
3
3
|
|
4
|
-
import numpy as np
|
5
4
|
import pandas as pd
|
6
5
|
import streamlit as st
|
7
6
|
import utils.readrdi as rd
|
7
|
+
import utils.writenc as wr
|
8
|
+
from streamlit.runtime.state import session_state
|
8
9
|
from utils.signal_quality import default_mask
|
9
|
-
from utils.readrdi import ReadFile
|
10
|
-
|
11
|
-
# To make the page wider if the user presses the reload button.
|
12
|
-
st.set_page_config(layout="wide")
|
13
10
|
|
14
11
|
"""
|
15
12
|
Streamlit page to load ADCP binary file and display File Header
|
@@ -113,7 +110,7 @@ if uploaded_file is not None:
|
|
113
110
|
correlation = ds.correlation.data
|
114
111
|
echo = ds.echo.data
|
115
112
|
pgood = ds.percentgood.data
|
116
|
-
beamdir = ds.fixedleader.system_configuration()[
|
113
|
+
beamdir = ds.fixedleader.system_configuration()['Beam Direction']
|
117
114
|
|
118
115
|
st.session_state.fname = uploaded_file.name
|
119
116
|
st.session_state.head = ds.fileheader
|
@@ -124,14 +121,6 @@ if uploaded_file is not None:
|
|
124
121
|
st.session_state.correlation = ds.correlation.data
|
125
122
|
st.session_state.pgood = ds.percentgood.data
|
126
123
|
st.session_state.beam_direction = beamdir
|
127
|
-
st.session_state.sound_speed = ds.variableleader.speed_of_sound.data
|
128
|
-
st.session_state.depth = ds.variableleader.depth_of_transducer.data
|
129
|
-
st.session_state.temperature = (
|
130
|
-
ds.variableleader.temperature.data * ds.variableleader.temperature.scale
|
131
|
-
)
|
132
|
-
st.session_state.salinity = (
|
133
|
-
ds.variableleader.salinity.data * ds.variableleader.salinity.scale
|
134
|
-
)
|
135
124
|
|
136
125
|
# st.session_state.flead = flead
|
137
126
|
# st.session_state.vlead = vlead
|
@@ -145,9 +134,6 @@ if uploaded_file is not None:
|
|
145
134
|
elif "flead" in st.session_state:
|
146
135
|
st.write("You selected `%s`" % st.session_state.fname)
|
147
136
|
else:
|
148
|
-
# reset the cache and resources if the user press reload button.
|
149
|
-
st.cache_data.clear()
|
150
|
-
st.cache_resource.clear()
|
151
137
|
st.stop()
|
152
138
|
|
153
139
|
########## TIME AXIS ##############
|
@@ -180,159 +166,8 @@ date_df = pd.DataFrame(
|
|
180
166
|
)
|
181
167
|
|
182
168
|
st.session_state.date = pd.to_datetime(date_df)
|
183
|
-
|
184
|
-
|
185
|
-
st.session_state.date3 = pd.to_datetime(date_df)
|
186
|
-
st.session_state.ensemble_axis = np.arange(0, st.session_state.head.ensembles, 1)
|
187
|
-
st.session_state.axis_option = "time"
|
188
|
-
|
189
|
-
|
190
|
-
# ---------- Initialize all options -------------
|
191
|
-
# ------------------------
|
192
|
-
# Page: Download Raw File
|
193
|
-
# ------------------------
|
194
|
-
# Widgets
|
195
|
-
st.session_state.add_attributes_DRW = "No"
|
196
|
-
st.session_state.axis_option_DRW = "time"
|
197
|
-
st.session_state.rawnc_download_DRW = False
|
198
|
-
st.session_state.vleadnc_download_DRW = False
|
199
|
-
st.session_state.rawcsv_option_DRW = "Velocity"
|
200
|
-
st.session_state.rawcsv_beam_DRW = 1
|
201
|
-
st.session_state.rawcsv_download_DRW = False
|
202
|
-
|
203
|
-
# ------------------
|
204
|
-
# Page: Sensor Test
|
205
|
-
# ------------------
|
206
|
-
st.session_state.isSensorTest = False
|
207
|
-
st.session_state.isFirstSensorVisit = True
|
208
|
-
|
209
|
-
# -- Tab 1: Depth Correction
|
210
|
-
st.session_state.isDepthModified_ST = False
|
211
|
-
# Widgets
|
212
|
-
# Options: "Fixed Value", "File Upload"
|
213
|
-
st.session_state.depthoption_ST = "Fixed Value"
|
214
|
-
st.session_state.isFixedDepth_ST = False
|
215
|
-
st.session_state.fixeddepth_ST = 0
|
216
|
-
st.session_state.isUploadDepth_ST = False
|
217
|
-
|
218
|
-
# -- Tab 2: Salinity Correction
|
219
|
-
st.session_state.isSalinityModified_ST = False
|
220
|
-
# Widgets
|
221
|
-
st.session_state.salinityoption_ST = "Fixed Value"
|
222
|
-
st.session_state.isFixedSalinity_ST = False
|
223
|
-
st.session_state.fixedsalinity_ST = 35
|
224
|
-
st.session_state.isUploadSalinity_ST = False
|
225
|
-
|
226
|
-
# -- Tab 3: Temperature Correction
|
227
|
-
st.session_state.isTemperatureModified_ST = False
|
228
|
-
# Widgets
|
229
|
-
st.session_state.temperatureoption_ST = "Fixed Value"
|
230
|
-
st.session_state.isFixedTemperature_ST = False
|
231
|
-
st.session_state.fixedtemperature_ST = 0
|
232
|
-
st.session_state.isUploadTemperature_ST = False
|
233
|
-
|
234
|
-
# -- Tab 7: Pitch, Roll, Velocity Correction
|
235
|
-
st.session_state.isRollCheck_ST = False
|
236
|
-
st.session_state.isPitchCheck_ST = False
|
237
|
-
st.session_state.isVelocityModifiedSound_ST = False
|
238
|
-
# Widgets
|
239
|
-
st.session_state.roll_cutoff_ST = 359
|
240
|
-
st.session_state.pitch_cutoff_ST = 359
|
241
|
-
|
242
|
-
# ------------------
|
243
|
-
# Page: QC Test
|
244
|
-
# ------------------
|
245
|
-
# Global Test
|
246
|
-
st.session_state.isQCTest = False
|
247
|
-
st.session_state.isFirstQCVisit = True
|
248
|
-
|
249
|
-
# Tab 2: Apply QC
|
250
|
-
st.session_state.isQCCheck_QCT = False
|
251
|
-
# Widgets
|
252
|
-
st.session_state.ct_QCT = 64
|
253
|
-
st.session_state.et_QCT = 0
|
254
|
-
st.session_state.evt_QCT = 2000
|
255
|
-
st.session_state.ft_QCT = 50
|
256
|
-
st.session_state.is3beam_QCT = True
|
257
|
-
st.session_state.pgt_QCT = 0
|
258
|
-
|
259
|
-
# Data Modifications
|
260
|
-
st.session_state.isBeamModified_QCT = False
|
261
|
-
# Widgets
|
262
|
-
st.session_state.beam_direction_QCT = st.session_state.beam_direction
|
263
|
-
|
264
|
-
# ------------------
|
265
|
-
# Page: Profile Test
|
266
|
-
# ------------------
|
267
|
-
st.session_state.isProfileTest = False
|
268
|
-
st.session_state.isFirstProfileVisit = True
|
269
|
-
|
270
|
-
# Tab1: Trim Ends
|
271
|
-
st.session_state.isTrimEndsCheck_PT = False
|
272
|
-
# Widgets
|
273
|
-
st.session_state.start_ens_PT = 0
|
274
|
-
st.session_state.end_ens_PT = st.session_state.head.ensembles
|
275
|
-
|
276
|
-
# Tab2: Cutbins - Sidelobe
|
277
|
-
st.session_state.isCutBinSideLobeCheck_PT = False
|
278
|
-
st.session_state.extra_cells_PT = 0
|
279
|
-
st.session_state.water_depth_PT = 0
|
280
|
-
|
281
|
-
# Tab3: Cutbins - Manual
|
282
|
-
st.session_state.isCutBinManualCheck_PT = False
|
283
|
-
|
284
|
-
# Tab4: Regrid
|
285
|
-
st.session_state.isRegridCheck_PT = False
|
286
|
-
st.session_state.end_cell_option_PT = "Cell"
|
287
|
-
st.session_state.interpolate_PT = "nearest"
|
288
|
-
st.session_state.manualdepth_PT = 0
|
289
|
-
|
290
|
-
# ------------------
|
291
|
-
# Page: Velocity Test
|
292
|
-
# ------------------
|
293
|
-
# Global Test
|
294
|
-
st.session_state.isVelocityTest = False
|
295
|
-
# Check if visiting the page first time
|
296
|
-
st.session_state.isFirstVelocityVisit = True
|
297
|
-
# Local Tests:
|
298
|
-
# Tab1: Magnetic Declination
|
299
|
-
st.session_state.isMagnetCheck_VT = False
|
300
|
-
# OPTIONS: pygeomag, API, Manual
|
301
|
-
st.session_state.magnet_method_VT = "pygeomag"
|
302
|
-
st.session_state.magnet_lat_VT = 0
|
303
|
-
st.session_state.magnet_lon_VT = 0
|
304
|
-
st.session_state.magnet_year_VT = 2025
|
305
|
-
st.session_state.magnet_depth_VT = 0
|
306
|
-
st.session_state.magnet_user_input_VT = 0
|
307
|
-
|
308
|
-
# Tab2: Velocity Cutoff
|
309
|
-
st.session_state.isCutoffCheck_VT = False
|
310
|
-
st.session_state.maxuvel_VT = 250
|
311
|
-
st.session_state.maxvvel_VT = 250
|
312
|
-
st.session_state.maxwvel_VT = 15
|
313
|
-
|
314
|
-
# Tab3: Despike
|
315
|
-
st.session_state.isDespikeCheck_VT = False
|
316
|
-
st.session_state.despike_kernel_VT = 5
|
317
|
-
st.session_state.despike_cutoff_VT = 3
|
318
|
-
|
319
|
-
# Tab4: Flatline
|
320
|
-
st.session_state.isFlatlineCheck_VT = False
|
321
|
-
st.session_state.flatline_kernel_VT = 5
|
322
|
-
st.session_state.flatline_cutoff_VT = 3
|
323
|
-
|
324
|
-
# ------------------
|
325
|
-
# Page: Write File
|
326
|
-
# ------------------
|
327
|
-
st.session_state.isWriteFile = True
|
328
|
-
st.session_state.isAttributes = False
|
329
|
-
st.session_state.mask_data_WF = "Yes"
|
330
|
-
# FileTypes: NetCDF, CSV
|
331
|
-
st.session_state.file_type_WF = "NetCDF"
|
332
|
-
st.session_state.isProcessedNetcdfDownload_WF = True
|
333
|
-
st.session_state.isProcessedCSVDownload_WF = False
|
334
|
-
|
335
|
-
# MASK DATA
|
169
|
+
|
170
|
+
######### MASK DATA ##############
|
336
171
|
# The velocity data has missing values due to the cutoff
|
337
172
|
# criteria used before deployment. The `default_mask` uses
|
338
173
|
# the velocity to create a mask. This mask file is stored
|
@@ -341,17 +176,16 @@ st.session_state.isProcessedCSVDownload_WF = False
|
|
341
176
|
# WARNING: Never Change `st.session_state.orig_mask` in the code!
|
342
177
|
#
|
343
178
|
if "orig_mask" not in st.session_state:
|
344
|
-
|
345
|
-
|
179
|
+
st.session_state.orig_mask = default_mask(
|
180
|
+
st.session_state.flead, st.session_state.velocity
|
181
|
+
)
|
346
182
|
|
347
|
-
#
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
st.session_state.
|
352
|
-
st.session_state.
|
353
|
-
st.session_state.isProfilePageReturn = False
|
354
|
-
st.session_state.isVelocityPageReturn = False
|
183
|
+
# Checks if the following quality checks are carried out
|
184
|
+
st.session_state.isQCMask = False
|
185
|
+
st.session_state.isProfileMask = False
|
186
|
+
st.session_state.isGrid = False
|
187
|
+
st.session_state.isGridSave = False
|
188
|
+
st.session_state.isVelocityMask = False
|
355
189
|
|
356
190
|
########## FILE HEADER ###############
|
357
191
|
st.header("File Header", divider="blue")
|
@@ -428,18 +262,10 @@ if flead_check_button:
|
|
428
262
|
|
429
263
|
flead_button = st.button("Fixed Leader")
|
430
264
|
if flead_button:
|
431
|
-
# Pandas array should have all elements with same data type.
|
432
|
-
# Except Sl. no., which is np.uint64, rest are np.int64.
|
433
|
-
# Convert all datatype to uint64
|
434
|
-
fl_dict = st.session_state.flead.field().items()
|
435
|
-
new_dict = {}
|
436
|
-
for key, value in fl_dict:
|
437
|
-
new_dict[key] = value.astype(np.uint64)
|
438
|
-
|
439
265
|
df = pd.DataFrame(
|
440
266
|
{
|
441
|
-
"Fields":
|
442
|
-
"Values":
|
267
|
+
"Fields": st.session_state.flead.field().keys(),
|
268
|
+
"Values": st.session_state.flead.field().values(),
|
443
269
|
}
|
444
270
|
)
|
445
271
|
st.dataframe(df, use_container_width=True)
|
@@ -457,3 +283,4 @@ with right:
|
|
457
283
|
df = df.astype("str")
|
458
284
|
st.write((df.style.map(color_bool2)))
|
459
285
|
# st.dataframe(df)
|
286
|
+
|