Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
Oceano2python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
US191
Oceano2python
Commits
f4ce2551
Commit
f4ce2551
authored
3 years ago
by
Jacques Grelet
Browse files
Options
Downloads
Patches
Plain Diff
add max value from sqlite from each profile
parent
d9e03a4f
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Makefile
+1
-1
1 addition, 1 deletion
Makefile
ascii.py
+10
-1
10 additions, 1 deletion
ascii.py
file_extractor.py
+1
-0
1 addition, 0 deletions
file_extractor.py
oceano.py
+1
-0
1 addition, 0 deletions
oceano.py
with
13 additions
and
2 deletions
Makefile
+
1
−
1
View file @
f4ce2551
...
...
@@ -3,7 +3,7 @@ MAIN = $(PROJECT).py
PYTHON
=
python
PYLINT
=
pylint
TEST_PATH
=
tests
OPTIONS_CTD
=
data/CTD/cnv/dfr2900
[1-3]
.cnv
-i
CTD
-k
PRES ETDD TEMP PSAL DOX2 DENS SVEL FLU2 FLU3 TUR3 NAVG
OPTIONS_CTD
=
data/CTD/cnv/dfr2900
?
.cnv
-i
CTD
-k
PRES ETDD TEMP PSAL DOX2 DENS SVEL FLU2 FLU3 TUR3 NAVG
OPTIONS_XBT
=
data/XBT/T7_0000
*
.EDF
-i
XBT
-k
DEPTH TEMP SVEL
OPTIONS_LADCP
=
data/LADCP/
*
.lad
-i
LADCP
-k
DEPTH EWCT NSCT
...
...
This diff is collapsed.
Click to expand it.
ascii.py
+
10
−
1
View file @
f4ce2551
...
...
@@ -56,7 +56,16 @@ def writeHeader(hdrFile, cfg, device, fe, r):
print
(
f
"
{
fmt
}
"
%
(
fe
[
k
][
i
]),
end
=
''
)
f
.
write
(
f
"
{
fmt
}
"
%
(
fe
[
k
][
i
]))
# get max value for each profile
col
=
f
"
MAX(
{
fe
.
keys
[
0
]
}
)
"
query
=
fe
.
db
.
query
(
f
"
SELECT
{
col
}
FROM data WHERE station_id =
{
int
(
fe
[
'
PROFILE
'
][
i
])
}
"
)
for
idx
,
item
in
enumerate
(
query
):
dt
=
item
[
col
]
if
dt
==
None
:
pass
else
:
print
(
"
%6.1f
"
%
(
item
[
col
]))
f
.
write
(
"
%6.1f
"
%
(
item
[
col
]))
print
(
end
=
'
\n
'
)
f
.
write
(
'
\n
'
)
...
...
This diff is collapsed.
Click to expand it.
file_extractor.py
+
1
−
0
View file @
f4ce2551
...
...
@@ -427,6 +427,7 @@ if __name__ == "__main__":
for
file
in
args
.
files
:
files
+=
glob
(
file
)
# call fe with dbname='test.db' to create db file
fe
=
FileExtractor
(
files
,
Roscop
(
'
code_roscop.csv
'
),
args
.
keys
)
#print(f"File(s): {files}, Config: {args.config}")
cfg
=
toml
.
load
(
args
.
config
)
...
...
This diff is collapsed.
Click to expand it.
oceano.py
+
1
−
0
View file @
f4ce2551
...
...
@@ -247,6 +247,7 @@ def process(args, cfg, ti):
args
.
keys
=
cfg
[
'
split
'
][
device
.
lower
()].
keys
()
# extract header and data from files
#fe = FileExtractor(args.files, r, args.keys, dbname='test.db')
fe
=
FileExtractor
(
args
.
files
,
r
,
args
.
keys
)
# prepare (compile) each regular expression inside toml file under section [<device=ti>.header]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment