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
1a05b3d1
Commit
1a05b3d1
authored
5 years ago
by
jacques.grelet_ird.fr
Browse files
Options
Downloads
Patches
Plain Diff
add -r option for code_roscop.csv
parent
96ad81b7
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
+15
-3
15 additions, 3 deletions
oceano.py
with
15 additions
and
3 deletions
oceano.py
+
15
−
3
View file @
1a05b3d1
...
@@ -23,8 +23,12 @@ filesBrowsePosition_column = 1
...
@@ -23,8 +23,12 @@ filesBrowsePosition_column = 1
# initialize filename use to save GUI configuration
# initialize filename use to save GUI configuration
configfile
=
'
oceano.cfg
'
configfile
=
'
oceano.cfg
'
# move to main after tests
# default file name for ROSCOP csv
r
=
Roscop
(
"
code_roscop.csv
"
)
defaultRoscop
=
'
code_roscop.csv
'
# example, PIRATA cruises:
# FR30:
# python oceano.py /m/PIRATA-FR30/data-processing/CTD/data/cnv/d*.cnv -i CTD -k PRES TEMP PSAL DOX2 FLU2 -r code_roscop.csv
def
processArgs
():
def
processArgs
():
parser
=
argparse
.
ArgumentParser
(
parser
=
argparse
.
ArgumentParser
(
...
@@ -36,7 +40,7 @@ def processArgs():
...
@@ -36,7 +40,7 @@ def processArgs():
'
python oceano.py data/XBT/T7_0000*.EDF -i XBT -k DEPTH TEMP SVEL
\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
'
'
\n
'
,
'
\n
'
,
epilog
=
'
J. Grelet IRD US191 - March 2019
'
)
epilog
=
'
J. Grelet IRD US191 - March 2019
/ Feb 2020
'
)
parser
.
add_argument
(
'
-d
'
,
'
--debug
'
,
help
=
'
display debug informations
'
,
parser
.
add_argument
(
'
-d
'
,
'
--debug
'
,
help
=
'
display debug informations
'
,
action
=
'
store_true
'
)
action
=
'
store_true
'
)
parser
.
add_argument
(
'
--demo
'
,
nargs
=
'
?
'
,
choices
=
ti
.
keys
(),
parser
.
add_argument
(
'
--demo
'
,
nargs
=
'
?
'
,
choices
=
ti
.
keys
(),
...
@@ -45,6 +49,8 @@ def processArgs():
...
@@ -45,6 +49,8 @@ def processArgs():
default
=
'
tests/test.toml
'
)
default
=
'
tests/test.toml
'
)
parser
.
add_argument
(
'
-i
'
,
'
--instrument
'
,
nargs
=
'
?
'
,
choices
=
ti
.
keys
(),
parser
.
add_argument
(
'
-i
'
,
'
--instrument
'
,
nargs
=
'
?
'
,
choices
=
ti
.
keys
(),
help
=
'
specify the instrument that produce files, eg CTD, XBT, TSG, LADCP
'
)
help
=
'
specify the instrument that produce files, eg CTD, XBT, TSG, LADCP
'
)
parser
.
add_argument
(
'
-r
'
,
'
--roscop
'
,
nargs
=
'
?
'
,
help
=
'
specify location and ROSCOP file name, (default: code_roscop.csv)
'
)
parser
.
add_argument
(
'
-k
'
,
'
--keys
'
,
nargs
=
'
+
'
,
parser
.
add_argument
(
'
-k
'
,
'
--keys
'
,
nargs
=
'
+
'
,
help
=
'
display dictionary for key(s), (default: %(default)s)
'
)
help
=
'
display dictionary for key(s), (default: %(default)s)
'
)
parser
.
add_argument
(
'
-g
'
,
'
--gui
'
,
action
=
'
store_true
'
,
parser
.
add_argument
(
'
-g
'
,
'
--gui
'
,
action
=
'
store_true
'
,
...
@@ -174,6 +180,9 @@ if __name__ == "__main__":
...
@@ -174,6 +180,9 @@ if __name__ == "__main__":
if
args
.
debug
:
if
args
.
debug
:
logging
.
basicConfig
(
logging
.
basicConfig
(
format
=
'
%(levelname)s:%(message)s
'
,
level
=
logging
.
DEBUG
)
format
=
'
%(levelname)s:%(message)s
'
,
level
=
logging
.
DEBUG
)
# get roscop file
r
=
Roscop
(
"
code_roscop.csv
"
)
# read config Toml file and get the physical parameter list (Roscop code) for the specified instrument
# read config Toml file and get the physical parameter list (Roscop code) for the specified instrument
cfg
=
toml
.
load
(
args
.
config
)
cfg
=
toml
.
load
(
args
.
config
)
...
@@ -269,6 +278,9 @@ if __name__ == "__main__":
...
@@ -269,6 +278,9 @@ if __name__ == "__main__":
# print = sg.Print(size=(80,40))
# print = sg.Print(size=(80,40))
else
:
else
:
if
args
.
roscop
!=
None
:
defaultRoscop
=
args
.
roscop
r
=
Roscop
(
defaultRoscop
)
# demo mode, only in command line
# demo mode, only in command line
if
args
.
demo
!=
None
:
if
args
.
demo
!=
None
:
print
(
'
demo mode: {}
'
.
format
(
args
.
demo
))
print
(
'
demo mode: {}
'
.
format
(
args
.
demo
))
...
...
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