forked from Ulises-ICM-UPC/UBathy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.py
88 lines (88 loc) · 3.63 KB
/
example.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#'''
# Created on 2022 by Gonzalo Simarro and Daniel Calvete
#'''
#
import os
import sys
#
sys.path.insert(0, 'ubathy')
import ubathy as ubathy
#
pathFolderMain = 'example' # USER DEFINED
#
#''' --------------------------------------------------------------------------
# Extraction of the videos
#''' --------------------------------------------------------------------------
#
pathFolderVideos = os.path.join(pathFolderMain, 'videos') # USER DEFINED
listOfVideos = [] # if [], takes all the available
FPS = 0.0 # if 0.0, FPS is the video time resolution
overwrite = False # USER DEFINED
#
print('Extraction of the videos')
ubathy.Video2Frames(pathFolderVideos, listOfVideos, FPS, overwrite)
#
#''' --------------------------------------------------------------------------
# Creation of the meshes
#''' --------------------------------------------------------------------------
#
pathFolderData = os.path.join(pathFolderMain, 'data')
#pathFolderVideos = os.path.join(pathFolderMain, 'videos') # USER DEFINED
pathFolderScratch = os.path.join(pathFolderMain, 'scratch')
listOfVideos = [] # if [], takes all the available
overwrite = False # USER DEFINED
verbosePlot = True # USER DEFINED
#
print('Creation of the meshes')
ubathy.CreateMeshes(pathFolderData, pathFolderVideos, pathFolderScratch, listOfVideos, overwrite, verbosePlot)
#
#''' --------------------------------------------------------------------------
# Decomposition of the videos
#''' --------------------------------------------------------------------------
#
#pathFolderData = os.path.join(pathFolderMain, 'data') # USER DEFINED
#pathFolderVideos = os.path.join(pathFolderMain, 'videos') # USER DEFINED
#pathFolderScratch = os.path.join(pathFolderMain, 'scratch') # USER DEFINED
#listOfVideos = [] # if [], takes all the available
overwrite = False # USER DEFINED
verbosePlot = True # USER DEFINED
#
print('Decomposition of the videos')
ubathy.ObtainWAndModes(pathFolderData, pathFolderVideos, pathFolderScratch, listOfVideos, overwrite, verbosePlot)
#
#''' --------------------------------------------------------------------------
# Obtaining the wavenumbers
#''' --------------------------------------------------------------------------
#
#pathFolderData = os.path.join(pathFolderMain, 'data') # USER DEFINED
#pathFolderScratch = os.path.join(pathFolderMain, 'scratch') # USER DEFINED
#listOfVideos = [] # if [], takes all the available # USER DEFINED
overwrite = False
verbosePlot = True
#
print('Obtaining the wavenumbers')
ubathy.ObtainK(pathFolderData, pathFolderScratch, listOfVideos, overwrite, verbosePlot)
#
#''' --------------------------------------------------------------------------
# Obtaining the bathymetry
#''' --------------------------------------------------------------------------
#
#pathFolderData = os.path.join(pathFolderMain, 'data') # USER DEFINED
#pathFolderScratch = os.path.join(pathFolderMain, 'scratch') # USER DEFINED
#pathFolderBathymetries = os.path.join(pathFolderMain, 'bathymetries') # USER DEFINED
overwrite = False # USER DEFINED
verbosePlot = True # USER DEFINED
#
print('Obtaining the bathymetry')
ubathy.ObtainB(pathFolderData, pathFolderScratch, pathFolderBathymetries, overwrite, verbosePlot)
#
#''' --------------------------------------------------------------------------
# Filtering (Kalman) the bathymetries
#''' --------------------------------------------------------------------------
#
#pathFolderData = os.path.join(pathFolderMain, 'data') # USER DEFINED
pathFolderBathymetries = os.path.join(pathFolderMain, 'bathymetries_Kalman') # USER DEFINED
verbosePlot = True
#
print('Filtering (Kalman) the bathymetry')
ubathy.PerformKalman(pathFolderData, pathFolderBathymetries, verbosePlot)