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
33b034d5
Commit
33b034d5
authored
2 years ago
by
Jacques Grelet
Browse files
Options
Downloads
Patches
Plain Diff
add database option
parent
e11a61f6
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
oceano.py
+12
-3
12 additions, 3 deletions
oceano.py
with
12 additions
and
3 deletions
oceano.py
+
12
−
3
View file @
33b034d5
...
...
@@ -45,7 +45,7 @@ def processArgs():
'
python oceano.py data/CTD/cnv/dfr2900[1-3].cnv -i CTD -k PRES TEMP PSAL DOX2 DENS
\n
'
'
python oceano.py data/CTD/cnv/dfr29*.cnv -i CTD -d
\n
'
'
python oceano.py data/XBT/T7_0000*.EDF -i XBT -k DEPTH TEMP SVEL
\n
'
'
python oceano.py data/LADCP/*.lad -
i LADCP -
k DEPTH EWCT NSCT
\n
'
'
python oceano.py data/LADCP/*.lad -i LADCP -k DEPTH EWCT NSCT
\n
'
'
python oceano.py data/CTD/btl/fr290*.btl -i BTL -k BOTL PRES DEPTH ETDD TE01 TE02 PSA1 PSA2 DO11 DO12 DO21 DO22 FLU2
'
'
\n
'
,
epilog
=
'
J. Grelet IRD US191 - March 2019 / Feb 2020
'
)
...
...
@@ -63,6 +63,8 @@ def processArgs():
help
=
'
display dictionary for key(s), (default: %(default)s)
'
)
parser
.
add_argument
(
'
-g
'
,
'
--gui
'
,
action
=
'
store_true
'
,
help
=
'
use GUI interface
'
)
parser
.
add_argument
(
'
--database
'
,
help
=
'
save sqlite3 database in test.db instead of memory
'
,
action
=
'
store_true
'
)
# type=argparse.FileType('r') don't work with under DOS
parser
.
add_argument
(
'
files
'
,
nargs
=
'
*
'
,
help
=
'
ASCII file(s) to parse
'
)
...
...
@@ -251,8 +253,10 @@ 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
)
if
args
.
database
:
fe
=
FileExtractor
(
args
.
files
,
r
,
args
.
keys
,
dbname
=
'
test.db
'
)
else
:
fe
=
FileExtractor
(
args
.
files
,
r
,
args
.
keys
)
fe
.
create_tables
()
# prepare (compile) each regular expression inside toml file under section [<device=ti>.header]
...
...
@@ -267,6 +271,11 @@ if __name__ == "__main__":
usage:
> python oceano.py data/CTD/cnv/dfr2900[1-3].cnv -i CTD
> python oceano.py data/CTD/cnv/dfr29*.cnv -i CTD -k PRES TEMP PSAL DOX2 DENS -d
> python oceano.py data/CTD/cnv/dfr2900[1-3].cnv -i CTD -k PRES TEMP PSAL DOX2 DENS
> python oceano.py data/CTD/cnv/dfr29*.cnv -i CTD -d
> python oceano.py data/XBT/T7_0000*.EDF -i XBT -k DEPTH TEMP SVEL
> python oceano.py data/LADCP/*.lad -i LADCP - k DEPTH EWCT NSCT
> python oceano.py data/CTD/btl/fr290*.btl -i BTL -k BOTL PRES DEPTH ETDD TE01 TE02 PSA1 PSA2 DO11 DO12 DO21 DO22 FLU2
'''
# recover and process line arguments
parser
=
processArgs
()
...
...
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