pyadps 0.1.2__py3-none-any.whl → 0.1.4__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.
- pyadps/pages/03_Download_Raw_File.py +19 -21
- pyadps/pages/05_QC_Test.py +20 -3
- pyadps/pages/08_Write_File.py +3 -1
- pyadps/pages/09_Add-Ons.py +168 -0
- pyadps/utils/__init__.py +2 -0
- pyadps/utils/autoprocess.py +10 -5
- pyadps/utils/logging_utils.py +269 -0
- pyadps/utils/metadata/flmeta.json +420 -420
- pyadps/utils/multifile.py +244 -0
- pyadps/utils/plotgen.py +1 -1
- pyadps/utils/pyreadrdi.py +112 -83
- pyadps/utils/readrdi.py +34 -3
- pyadps/utils/signal_quality.py +16 -4
- pyadps/utils/writenc.py +101 -52
- {pyadps-0.1.2.dist-info → pyadps-0.1.4.dist-info}/METADATA +1 -1
- pyadps-0.1.4.dist-info/RECORD +35 -0
- pyadps/pages/09_Auto_process.py +0 -64
- pyadps-0.1.2.dist-info/RECORD +0 -33
- {pyadps-0.1.2.dist-info → pyadps-0.1.4.dist-info}/LICENSE +0 -0
- {pyadps-0.1.2.dist-info → pyadps-0.1.4.dist-info}/WHEEL +0 -0
- {pyadps-0.1.2.dist-info → pyadps-0.1.4.dist-info}/entry_points.txt +0 -0
pyadps/utils/writenc.py
CHANGED
@@ -70,8 +70,8 @@ def flead_ncatt(fl_obj, ncfile_id, ens=0):
|
|
70
70
|
def rawnc(
|
71
71
|
infile,
|
72
72
|
outfile,
|
73
|
-
time,
|
74
|
-
|
73
|
+
axis_option="time",
|
74
|
+
fixensemble=True,
|
75
75
|
attributes=None,
|
76
76
|
t0="hours since 2000-01-01",
|
77
77
|
):
|
@@ -91,7 +91,12 @@ def rawnc(
|
|
91
91
|
|
92
92
|
outnc = nc4.Dataset(outfile, "w", format="NETCDF4")
|
93
93
|
|
94
|
-
|
94
|
+
ds = rd.ReadFile(infile)
|
95
|
+
if fixensemble and not ds.isFixedEnsemble:
|
96
|
+
ds.fixensemble()
|
97
|
+
|
98
|
+
head = ds.fileheader
|
99
|
+
flead = ds.fixedleader
|
95
100
|
cell_list = flead.fleader["Cells"]
|
96
101
|
beam_list = flead.fleader["Beams"]
|
97
102
|
|
@@ -102,8 +107,11 @@ def rawnc(
|
|
102
107
|
primary_axis = "ensemble"
|
103
108
|
ensemble = outnc.createVariable("ensemble", "i4", ("ensemble",))
|
104
109
|
ensemble.axis = "T"
|
110
|
+
# Add ensemble
|
111
|
+
total_ensembles = ds.ensembles
|
112
|
+
ensemble = np.arange(1, total_ensembles + 1, 1)
|
105
113
|
elif axis_option == "time":
|
106
|
-
tsize =
|
114
|
+
tsize = ds.ensembles
|
107
115
|
outnc.createDimension("time", tsize)
|
108
116
|
primary_axis = "time"
|
109
117
|
time_var = outnc.createVariable("time", "i4", ("time",))
|
@@ -112,6 +120,7 @@ def rawnc(
|
|
112
120
|
time_var.long_name = "time"
|
113
121
|
|
114
122
|
# Convert time_data to numerical format
|
123
|
+
time = ds.time
|
115
124
|
nctime = pd2nctime(time, t0)
|
116
125
|
time_var[:] = nctime
|
117
126
|
|
@@ -134,7 +143,7 @@ def rawnc(
|
|
134
143
|
cell[:] = np.arange(1, max(cell_list) + 1, 1)
|
135
144
|
beam[:] = np.arange(1, max(beam_list) + 1, 1)
|
136
145
|
|
137
|
-
varlist =
|
146
|
+
varlist = head.data_types(1)
|
138
147
|
varlist.remove("Fixed Leader")
|
139
148
|
varlist.remove("Variable Leader")
|
140
149
|
|
@@ -145,10 +154,8 @@ def rawnc(
|
|
145
154
|
varid[i] = outnc.createVariable(
|
146
155
|
item, "i2", (primary_axis, "cell", "beam"), fill_value=-32768
|
147
156
|
)
|
148
|
-
|
149
|
-
|
150
|
-
var = vel(infile).data
|
151
|
-
# var = rd.variables(infile, item)
|
157
|
+
vel = getattr(ds, item.lower())
|
158
|
+
var = vel.data
|
152
159
|
|
153
160
|
else:
|
154
161
|
# Unsigned integers might be assigned for future netcdf versions
|
@@ -156,14 +163,10 @@ def rawnc(
|
|
156
163
|
varid[i] = outnc.createVariable(
|
157
164
|
format_item, "i2", (primary_axis, "cell", "beam")
|
158
165
|
)
|
159
|
-
datatype = getattr(
|
160
|
-
var = np.array(datatype
|
161
|
-
# var = np.array(rd.variables(infile, item), dtype="int16")
|
166
|
+
datatype = getattr(ds, format_item.lower())
|
167
|
+
var = np.array(datatype.data, dtype="int16")
|
162
168
|
|
163
169
|
vshape = var.T.shape
|
164
|
-
if i == 0:
|
165
|
-
if primary_axis == "ensemble":
|
166
|
-
ensemble[:] = np.arange(1, vshape[0] + 1, 1)
|
167
170
|
|
168
171
|
varid[i][0 : vshape[0], 0 : vshape[1], 0 : vshape[2]] = var.T
|
169
172
|
|
@@ -179,11 +182,12 @@ def rawnc(
|
|
179
182
|
|
180
183
|
outnc.close()
|
181
184
|
|
185
|
+
|
182
186
|
def flead_nc(
|
183
187
|
infile,
|
184
188
|
outfile,
|
185
|
-
time,
|
186
|
-
|
189
|
+
axis_option="time",
|
190
|
+
fixensemble=True,
|
187
191
|
attributes=None,
|
188
192
|
t0="hours since 2000-01-01",
|
189
193
|
):
|
@@ -196,6 +200,11 @@ def flead_nc(
|
|
196
200
|
"""
|
197
201
|
outnc = nc4.Dataset(outfile, "w", format="NETCDF4")
|
198
202
|
|
203
|
+
# Read Binary File
|
204
|
+
ds = rd.ReadFile(infile)
|
205
|
+
if fixensemble:
|
206
|
+
ds.fixensemble()
|
207
|
+
flead = ds.fixedleader
|
199
208
|
# Dimensions
|
200
209
|
# Define the primary axis based on axis_option
|
201
210
|
if axis_option == "ensemble":
|
@@ -203,8 +212,12 @@ def flead_nc(
|
|
203
212
|
primary_axis = "ensemble"
|
204
213
|
ensemble = outnc.createVariable("ensemble", "i4", ("ensemble",))
|
205
214
|
ensemble.axis = "T"
|
215
|
+
# Add ensemble
|
216
|
+
total_ensembles = ds.ensembles
|
217
|
+
ensemble = np.arange(1, total_ensembles + 1, 1)
|
218
|
+
|
206
219
|
elif axis_option == "time":
|
207
|
-
tsize =
|
220
|
+
tsize = ds.ensembles
|
208
221
|
outnc.createDimension("time", tsize)
|
209
222
|
primary_axis = "time"
|
210
223
|
time_var = outnc.createVariable("time", "i4", ("time",))
|
@@ -213,6 +226,7 @@ def flead_nc(
|
|
213
226
|
time_var.long_name = "time"
|
214
227
|
|
215
228
|
# Convert time_data to numerical format
|
229
|
+
time = ds.time
|
216
230
|
nctime = pd2nctime(time, t0)
|
217
231
|
time_var[:] = nctime
|
218
232
|
|
@@ -220,8 +234,6 @@ def flead_nc(
|
|
220
234
|
raise ValueError(f"Invalid axis_option: {axis_option}.")
|
221
235
|
|
222
236
|
# Variables
|
223
|
-
|
224
|
-
flead = rd.FixedLeader(infile)
|
225
237
|
fdict = flead.fleader
|
226
238
|
varid = [0] * len(fdict)
|
227
239
|
|
@@ -234,9 +246,6 @@ def flead_nc(
|
|
234
246
|
)
|
235
247
|
var = values
|
236
248
|
vshape = var.shape
|
237
|
-
if i == 0:
|
238
|
-
if primary_axis == "ensemble":
|
239
|
-
ensemble[:] = np.arange(1, vshape[0] + 1, 1)
|
240
249
|
|
241
250
|
varid[i][0 : vshape[0]] = var
|
242
251
|
i += 1
|
@@ -248,11 +257,12 @@ def flead_nc(
|
|
248
257
|
|
249
258
|
outnc.close()
|
250
259
|
|
260
|
+
|
251
261
|
def vlead_nc(
|
252
262
|
infile,
|
253
263
|
outfile,
|
254
|
-
time,
|
255
|
-
|
264
|
+
axis_option="time",
|
265
|
+
fixensemble=True,
|
256
266
|
attributes=None,
|
257
267
|
t0="hours since 2000-01-01",
|
258
268
|
):
|
@@ -263,8 +273,14 @@ def vlead_nc(
|
|
263
273
|
infile (string): Input file path including filename
|
264
274
|
outfile (string): Output file path including filename
|
265
275
|
"""
|
276
|
+
# Create output NetCDF File
|
266
277
|
outnc = nc4.Dataset(outfile, "w", format="NETCDF4")
|
267
278
|
|
279
|
+
# Read Binary File
|
280
|
+
ds = rd.ReadFile(infile)
|
281
|
+
if fixensemble:
|
282
|
+
ds.fixensemble()
|
283
|
+
vlead = ds.variableleader
|
268
284
|
# Dimensions
|
269
285
|
# Define the primary axis based on axis_option
|
270
286
|
if axis_option == "ensemble":
|
@@ -272,8 +288,11 @@ def vlead_nc(
|
|
272
288
|
primary_axis = "ensemble"
|
273
289
|
ensemble = outnc.createVariable("ensemble", "i4", ("ensemble",))
|
274
290
|
ensemble.axis = "T"
|
291
|
+
# Add ensemble
|
292
|
+
total_ensembles = ds.ensembles
|
293
|
+
ensemble = np.arange(1, total_ensembles + 1, 1)
|
275
294
|
elif axis_option == "time":
|
276
|
-
tsize =
|
295
|
+
tsize = ds.ensembles
|
277
296
|
outnc.createDimension("time", tsize)
|
278
297
|
primary_axis = "time"
|
279
298
|
time_var = outnc.createVariable("time", "i4", ("time",))
|
@@ -282,15 +301,14 @@ def vlead_nc(
|
|
282
301
|
time_var.long_name = "time"
|
283
302
|
|
284
303
|
# Convert time_data to numerical format
|
304
|
+
time = ds.time
|
285
305
|
nctime = pd2nctime(time, t0)
|
286
306
|
time_var[:] = nctime
|
287
307
|
|
288
308
|
else:
|
289
309
|
raise ValueError(f"Invalid axis_option: {axis_option}.")
|
290
310
|
|
291
|
-
#
|
292
|
-
|
293
|
-
vlead = rd.VariableLeader(infile)
|
311
|
+
# Read Data
|
294
312
|
vdict = vlead.vleader
|
295
313
|
varid = [0] * len(vdict)
|
296
314
|
|
@@ -302,12 +320,10 @@ def vlead_nc(
|
|
302
320
|
format_item, "i4", primary_axis, fill_value=-32768
|
303
321
|
)
|
304
322
|
var = values
|
305
|
-
vshape = var.shape
|
306
|
-
if i == 0:
|
307
|
-
if primary_axis == "ensemble":
|
308
|
-
ensemble[:] = np.arange(1, vshape[0] + 1, 1)
|
323
|
+
# vshape = var.shape
|
309
324
|
|
310
|
-
varid[i][0 :
|
325
|
+
varid[i][0 : ds.ensembles] = var
|
326
|
+
# varid[i][0 : vshape[0]] = var
|
311
327
|
i += 1
|
312
328
|
|
313
329
|
# Add global attributes if provided
|
@@ -319,7 +335,16 @@ def vlead_nc(
|
|
319
335
|
|
320
336
|
|
321
337
|
def finalnc(
|
322
|
-
outfile,
|
338
|
+
outfile,
|
339
|
+
depth,
|
340
|
+
final_mask,
|
341
|
+
final_echo,
|
342
|
+
final_corr,
|
343
|
+
final_pgood,
|
344
|
+
time,
|
345
|
+
data,
|
346
|
+
t0="hours since 2000-01-01",
|
347
|
+
attributes=None,
|
323
348
|
):
|
324
349
|
"""
|
325
350
|
Function to create the processed NetCDF file.
|
@@ -345,9 +370,9 @@ def finalnc(
|
|
345
370
|
depth = depth[::-1]
|
346
371
|
data = data[:, ::-1, :]
|
347
372
|
final_mask = final_mask[::-1, :]
|
348
|
-
final_echo = final_echo[
|
349
|
-
final_corr = final_corr[
|
350
|
-
final_pgood = final_pgood[
|
373
|
+
final_echo = final_echo[:, ::-1, :]
|
374
|
+
final_corr = final_corr[:, ::-1, :]
|
375
|
+
final_pgood = final_pgood[:, ::-1, :]
|
351
376
|
|
352
377
|
ncfile = nc4.Dataset(outfile, mode="w", format="NETCDF4")
|
353
378
|
# Check if depth is scalar or array
|
@@ -390,41 +415,65 @@ def finalnc(
|
|
390
415
|
mvel = ncfile.createVariable("mask", np.float32, ("time", "depth"), fill_value=fill)
|
391
416
|
mvel.long_name = "Velocity Mask (1: bad value, 0: good value)"
|
392
417
|
|
393
|
-
echo1 = ncfile.createVariable(
|
418
|
+
echo1 = ncfile.createVariable(
|
419
|
+
"echo1", np.float32, ("time", "depth"), fill_value=-32768
|
420
|
+
)
|
394
421
|
echo1.long_name = "Echo intensity Beam 1"
|
395
422
|
|
396
|
-
echo2 = ncfile.createVariable(
|
423
|
+
echo2 = ncfile.createVariable(
|
424
|
+
"echo2", np.float32, ("time", "depth"), fill_value=-32768
|
425
|
+
)
|
397
426
|
echo2.long_name = "Echo intensity Beam 2"
|
398
427
|
|
399
|
-
echo3 = ncfile.createVariable(
|
428
|
+
echo3 = ncfile.createVariable(
|
429
|
+
"echo3", np.float32, ("time", "depth"), fill_value=-32768
|
430
|
+
)
|
400
431
|
echo3.long_name = "Echo intensity Beam 3"
|
401
432
|
|
402
|
-
echo4 = ncfile.createVariable(
|
433
|
+
echo4 = ncfile.createVariable(
|
434
|
+
"echo4", np.float32, ("time", "depth"), fill_value=-32768
|
435
|
+
)
|
403
436
|
echo4.long_name = "Echo intensity Beam 4"
|
404
437
|
|
405
|
-
corr1 = ncfile.createVariable(
|
438
|
+
corr1 = ncfile.createVariable(
|
439
|
+
"corr1", np.float32, ("time", "depth"), fill_value=-32768
|
440
|
+
)
|
406
441
|
corr1.long_name = "Beam 1 correlation"
|
407
442
|
|
408
|
-
corr2 = ncfile.createVariable(
|
443
|
+
corr2 = ncfile.createVariable(
|
444
|
+
"corr2", np.float32, ("time", "depth"), fill_value=-32768
|
445
|
+
)
|
409
446
|
corr2.long_name = "Beam 2 correlation"
|
410
447
|
|
411
|
-
corr3 = ncfile.createVariable(
|
448
|
+
corr3 = ncfile.createVariable(
|
449
|
+
"corr3", np.float32, ("time", "depth"), fill_value=-32768
|
450
|
+
)
|
412
451
|
corr3.long_name = "Beam 3 correlation"
|
413
452
|
|
414
|
-
corr4 = ncfile.createVariable(
|
415
|
-
|
453
|
+
corr4 = ncfile.createVariable(
|
454
|
+
"corr4", np.float32, ("time", "depth"), fill_value=-32768
|
455
|
+
)
|
456
|
+
corr4.long_name = "Beam 4 correlation"
|
416
457
|
|
417
|
-
pgd1 = ncfile.createVariable(
|
458
|
+
pgd1 = ncfile.createVariable(
|
459
|
+
"pgd1", np.float32, ("time", "depth"), fill_value=-32768
|
460
|
+
)
|
418
461
|
pgd1.long_name = "Percent Good Beam 1"
|
419
462
|
|
420
|
-
pgd2 = ncfile.createVariable(
|
463
|
+
pgd2 = ncfile.createVariable(
|
464
|
+
"pgd2", np.float32, ("time", "depth"), fill_value=-32768
|
465
|
+
)
|
421
466
|
pgd2.long_name = "Percent Good Beam 2"
|
422
467
|
|
423
|
-
pgd3 = ncfile.createVariable(
|
468
|
+
pgd3 = ncfile.createVariable(
|
469
|
+
"pgd3", np.float32, ("time", "depth"), fill_value=-32768
|
470
|
+
)
|
424
471
|
pgd3.long_name = "Percent Good Beam 3"
|
425
472
|
|
426
|
-
pgd4 = ncfile.createVariable(
|
427
|
-
|
473
|
+
pgd4 = ncfile.createVariable(
|
474
|
+
"pgd4", np.float32, ("time", "depth"), fill_value=-32768
|
475
|
+
)
|
476
|
+
pgd4.long_name = "Percent Good Beam 4"
|
428
477
|
|
429
478
|
nctime = pd2nctime(time, t0)
|
430
479
|
# write data
|
@@ -0,0 +1,35 @@
|
|
1
|
+
pyadps/Home_Page.py,sha256=j_-3fsp1hkhpNEl5jE-CEQvClDGpMi1H3ZQPXfuKWBg,1782
|
2
|
+
pyadps/__init__.py,sha256=bNCm6_WIhiwvaUeOZhRkyLZyzzUKfSH80Fslg0JPJyk,232
|
3
|
+
pyadps/__main__.py,sha256=cIFUayxPnKl00oIR99L6IUEvc8trW7dijtfBQCAen5c,356
|
4
|
+
pyadps/pages/01_Read_File.py,sha256=swujYGZvQX30zcccWhn5MiFVY_MBUYXuZ9_8GtvpQI4,14421
|
5
|
+
pyadps/pages/02_View_Raw_Data.py,sha256=AhT7gvDbcMRPf-WIBzTQ0o-nn9_q7NH6plTlpMtgzaY,6170
|
6
|
+
pyadps/pages/03_Download_Raw_File.py,sha256=ebZu17STL3HhM8ExQvSWNfquI2CrmdJPxOeNjV-lvvU,12214
|
7
|
+
pyadps/pages/04_Sensor_Health.py,sha256=2Qnwl7D46H-f8LmXLVZj5X36h8MjRwmVRK6Bs_wuB_k,33905
|
8
|
+
pyadps/pages/05_QC_Test.py,sha256=6YjQTg_t0_Qll9xQ3SYieCBS2cDEMz9znovW3olPFwc,16566
|
9
|
+
pyadps/pages/06_Profile_Test.py,sha256=Vir91oRIWApbO2elBm4I59rdf83NtspUmtzAyWdsIiY,34891
|
10
|
+
pyadps/pages/07_Velocity_Test.py,sha256=K4vEiLPMXrU4JMLj-mIA1G4H5ORozMbHMiMov3ZZXP0,23008
|
11
|
+
pyadps/pages/08_Write_File.py,sha256=dehT7x68b0bzDDiTSE7W0cav4JdvoB1Awicip711hGY,23079
|
12
|
+
pyadps/pages/09_Add-Ons.py,sha256=lweofAxcvKLxzfCJl6vybmUmxWgcm4jEn5DjFaTHbpI,5986
|
13
|
+
pyadps/pages/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
14
|
+
pyadps/utils/__init__.py,sha256=JDIy5Yx6meDGxfLGyB5135TFWQc0lyNxu_cWrfSEDhU,485
|
15
|
+
pyadps/utils/autoprocess.py,sha256=r6SZwx-FPV9Fp1DzuLfH06X5zStWVIi94182juebxfA,20374
|
16
|
+
pyadps/utils/logging_utils.py,sha256=-b6rwnpF-g6ZSIj3PVyxiz4-blBKvKqh1HW1KRKpmyY,8492
|
17
|
+
pyadps/utils/metadata/config.ini,sha256=TC7htzGwUukIXt_u3JR5ycyvOoDj_JxWgGY6khjNeck,2154
|
18
|
+
pyadps/utils/metadata/demo.000,sha256=qxB3sgjABrpv4DNXkwjpbSxk5sc4UwAI8kgQX0--PM8,234468
|
19
|
+
pyadps/utils/metadata/flmeta.json,sha256=eGw1lM5IKhZ6IuSkj7PiKQ-MpNtH446HaRmcby8rBIY,12673
|
20
|
+
pyadps/utils/metadata/vlmeta.json,sha256=_dkQlGkkUvpAIM7S6kEUenSaiCpOrwXg8n1aU3dDF3s,22535
|
21
|
+
pyadps/utils/multifile.py,sha256=NKSbikp6k98pHgT-5tciAyykYCTyWfPH1JFA9F8eiUs,8747
|
22
|
+
pyadps/utils/plotgen.py,sha256=c7TUA9unErUxppYc14LZ2o_stzNMmmZ5X542iI5v1tA,26346
|
23
|
+
pyadps/utils/profile_test.py,sha256=gnbS6ZsqKvv2tcHTj-Fi_VNOszbxDcPxl77_n4dLzSo,29237
|
24
|
+
pyadps/utils/pyreadrdi.py,sha256=VwypCpKGfjTO0h0j_Vl1-JMhXooiaXnmQHmEFVPifGo,36886
|
25
|
+
pyadps/utils/readrdi.py,sha256=CfmZns5W8OZVE7u_PzdwpsFrjf8dmACg1_9OM6woPyk,51251
|
26
|
+
pyadps/utils/script.py,sha256=TKMCYe0HEz-2GFpNxKVzpg0p4MM-Cu2rcMZc51GgLn4,6534
|
27
|
+
pyadps/utils/sensor_health.py,sha256=aHRaU4kMJZ9dGmYypKpCCgq-owWoNjvcl1I_9I7dG68,3973
|
28
|
+
pyadps/utils/signal_quality.py,sha256=BYPAbXrAPGQBEfEyG4PFktYpqxuvhoafsWM172TVn08,16737
|
29
|
+
pyadps/utils/velocity_test.py,sha256=O8dgjv_5pxhJq6QuWHxysMjNzxSnob_2KPLInmO1kHI,6112
|
30
|
+
pyadps/utils/writenc.py,sha256=KDolQ11Whh2bi4L2wfrgjXym5BWL8ikp0xvo4Pa0r4E,14455
|
31
|
+
pyadps-0.1.4.dist-info/LICENSE,sha256=sfY_7DzQF5FxnO2T6ek74dfm5uBmwEp1oEg_WlzNsb8,1092
|
32
|
+
pyadps-0.1.4.dist-info/METADATA,sha256=M9Qsr-K3w1VHOMajGLAw8CVlhJzD2gz7oqW_er-Jwak,4518
|
33
|
+
pyadps-0.1.4.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
|
34
|
+
pyadps-0.1.4.dist-info/entry_points.txt,sha256=-oZhbbJq8Q29uNVh5SmzOLp9OeFM9VUzHVxovfI4LXA,126
|
35
|
+
pyadps-0.1.4.dist-info/RECORD,,
|
pyadps/pages/09_Auto_process.py
DELETED
@@ -1,64 +0,0 @@
|
|
1
|
-
import os
|
2
|
-
import tempfile
|
3
|
-
|
4
|
-
import configparser
|
5
|
-
import json
|
6
|
-
import streamlit as st
|
7
|
-
from utils.autoprocess import autoprocess
|
8
|
-
|
9
|
-
# To make the page wider if the user presses the reload button.
|
10
|
-
st.set_page_config(layout="wide")
|
11
|
-
|
12
|
-
@st.cache_data
|
13
|
-
def file_access(uploaded_file):
|
14
|
-
"""
|
15
|
-
Function creates temporary directory to store the uploaded file.
|
16
|
-
The path of the file is returned
|
17
|
-
|
18
|
-
Args:
|
19
|
-
uploaded_file (string): Name of the uploaded file
|
20
|
-
|
21
|
-
Returns:
|
22
|
-
path (string): Path of the uploaded file
|
23
|
-
"""
|
24
|
-
temp_dir = tempfile.mkdtemp()
|
25
|
-
path = os.path.join(temp_dir, uploaded_file.name)
|
26
|
-
with open(path, "wb") as f:
|
27
|
-
f.write(uploaded_file.getvalue())
|
28
|
-
return path
|
29
|
-
|
30
|
-
|
31
|
-
def display_config_as_json(config_file):
|
32
|
-
config = configparser.ConfigParser()
|
33
|
-
config.read_string(config_file.getvalue().decode("utf-8"))
|
34
|
-
st.json({section: dict(config[section]) for section in config.sections()})
|
35
|
-
|
36
|
-
|
37
|
-
def main():
|
38
|
-
st.title("ADCP Data Auto Processing Tool")
|
39
|
-
st.write("Upload a binary input file and config.ini file for processing.")
|
40
|
-
|
41
|
-
# File Upload Section
|
42
|
-
uploaded_binary_file = st.file_uploader(
|
43
|
-
"Upload ADCP Binary File", type=["000", "bin"]
|
44
|
-
)
|
45
|
-
uploaded_config_file = st.file_uploader(
|
46
|
-
"Upload Config File (config.ini)", type=["ini"]
|
47
|
-
)
|
48
|
-
|
49
|
-
if uploaded_binary_file and uploaded_config_file:
|
50
|
-
st.success("Files uploaded successfully!")
|
51
|
-
|
52
|
-
# Display config.ini file content as JSON
|
53
|
-
display_config_as_json(uploaded_config_file)
|
54
|
-
|
55
|
-
fpath = file_access(uploaded_binary_file)
|
56
|
-
# Process files
|
57
|
-
with st.spinner("Processing files. Please wait..."):
|
58
|
-
autoprocess(uploaded_config_file, binary_file_path=fpath)
|
59
|
-
st.success("Processing completed successfully!")
|
60
|
-
st.write("Processed file written.")
|
61
|
-
|
62
|
-
|
63
|
-
if __name__ == "__main__":
|
64
|
-
main()
|
pyadps-0.1.2.dist-info/RECORD
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
pyadps/Home_Page.py,sha256=j_-3fsp1hkhpNEl5jE-CEQvClDGpMi1H3ZQPXfuKWBg,1782
|
2
|
-
pyadps/__init__.py,sha256=bNCm6_WIhiwvaUeOZhRkyLZyzzUKfSH80Fslg0JPJyk,232
|
3
|
-
pyadps/__main__.py,sha256=cIFUayxPnKl00oIR99L6IUEvc8trW7dijtfBQCAen5c,356
|
4
|
-
pyadps/pages/01_Read_File.py,sha256=swujYGZvQX30zcccWhn5MiFVY_MBUYXuZ9_8GtvpQI4,14421
|
5
|
-
pyadps/pages/02_View_Raw_Data.py,sha256=AhT7gvDbcMRPf-WIBzTQ0o-nn9_q7NH6plTlpMtgzaY,6170
|
6
|
-
pyadps/pages/03_Download_Raw_File.py,sha256=XF25xog8bkdsm3s1MFA10ZxbvqgDmvxBDOo6OPBHQwQ,12382
|
7
|
-
pyadps/pages/04_Sensor_Health.py,sha256=2Qnwl7D46H-f8LmXLVZj5X36h8MjRwmVRK6Bs_wuB_k,33905
|
8
|
-
pyadps/pages/05_QC_Test.py,sha256=8wt7h-RHLOf3GZ8-B_kXA0IqzHTBwW_H7YQFEk5EM6E,15904
|
9
|
-
pyadps/pages/06_Profile_Test.py,sha256=Vir91oRIWApbO2elBm4I59rdf83NtspUmtzAyWdsIiY,34891
|
10
|
-
pyadps/pages/07_Velocity_Test.py,sha256=K4vEiLPMXrU4JMLj-mIA1G4H5ORozMbHMiMov3ZZXP0,23008
|
11
|
-
pyadps/pages/08_Write_File.py,sha256=SUHGvOTN2hnwhxGucmTtclU6BhaJKWO2qGV4zS-JsPU,22954
|
12
|
-
pyadps/pages/09_Auto_process.py,sha256=SRtQVD9_kodlSvYdF9-02ur6EaWG2zMvN6-BcWdzYV8,1874
|
13
|
-
pyadps/pages/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
14
|
-
pyadps/utils/__init__.py,sha256=nCqRp-OT_1BC7RnL3ARUIldlw9sWyr1XqQvQid-B4ts,407
|
15
|
-
pyadps/utils/autoprocess.py,sha256=8KAg5-7uC7dsMHrCPfvM5icPzle3MU1gpFNcC-eZrkM,20086
|
16
|
-
pyadps/utils/metadata/config.ini,sha256=TC7htzGwUukIXt_u3JR5ycyvOoDj_JxWgGY6khjNeck,2154
|
17
|
-
pyadps/utils/metadata/demo.000,sha256=qxB3sgjABrpv4DNXkwjpbSxk5sc4UwAI8kgQX0--PM8,234468
|
18
|
-
pyadps/utils/metadata/flmeta.json,sha256=diIB9nht_0uw9YJNSFGdZYGzeVbR-07zIZS9Nf4VPSE,14245
|
19
|
-
pyadps/utils/metadata/vlmeta.json,sha256=_dkQlGkkUvpAIM7S6kEUenSaiCpOrwXg8n1aU3dDF3s,22535
|
20
|
-
pyadps/utils/plotgen.py,sha256=-A5fN2WoCZevt_SLT5OKSeYCzfv3rGG4tw7p1qzFjeA,26344
|
21
|
-
pyadps/utils/profile_test.py,sha256=gnbS6ZsqKvv2tcHTj-Fi_VNOszbxDcPxl77_n4dLzSo,29237
|
22
|
-
pyadps/utils/pyreadrdi.py,sha256=2xBg9v7wvxywfvJK1E0hrjR9XSqiiNwpA9ELfcSsuhM,35303
|
23
|
-
pyadps/utils/readrdi.py,sha256=ullqqWL-tvK3V9fjX8kpPwRpWhmRZy-CyA240gmcdr4,50012
|
24
|
-
pyadps/utils/script.py,sha256=TKMCYe0HEz-2GFpNxKVzpg0p4MM-Cu2rcMZc51GgLn4,6534
|
25
|
-
pyadps/utils/sensor_health.py,sha256=aHRaU4kMJZ9dGmYypKpCCgq-owWoNjvcl1I_9I7dG68,3973
|
26
|
-
pyadps/utils/signal_quality.py,sha256=dohaMtJT_MCeyxF__zMRy36_rMmVZqU5vCdW1AYH35s,16239
|
27
|
-
pyadps/utils/velocity_test.py,sha256=O8dgjv_5pxhJq6QuWHxysMjNzxSnob_2KPLInmO1kHI,6112
|
28
|
-
pyadps/utils/writenc.py,sha256=fgE0qpxCy_uk5hsYCeN5l77jWgj-vLxpjx-4hEJDJU0,13955
|
29
|
-
pyadps-0.1.2.dist-info/LICENSE,sha256=sfY_7DzQF5FxnO2T6ek74dfm5uBmwEp1oEg_WlzNsb8,1092
|
30
|
-
pyadps-0.1.2.dist-info/METADATA,sha256=h4npMIrAf5Tngry5d_wZPiW0Bpq-zizzLmSsfAGl_Vk,4518
|
31
|
-
pyadps-0.1.2.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
|
32
|
-
pyadps-0.1.2.dist-info/entry_points.txt,sha256=-oZhbbJq8Q29uNVh5SmzOLp9OeFM9VUzHVxovfI4LXA,126
|
33
|
-
pyadps-0.1.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|