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
a7ee893f
Commit
a7ee893f
authored
6 years ago
by
jacques Grelet
Browse files
Options
Downloads
Patches
Plain Diff
add bottom depth detection and display, echo only now
parent
3452bec2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ctd.py
+15
-4
15 additions, 4 deletions
ctd.py
with
15 additions
and
4 deletions
ctd.py
+
15
−
4
View file @
a7ee893f
...
...
@@ -80,6 +80,7 @@ longitude_str = ''
julian
=
0
epic_date
=
''
Pres
=
0
bottom_depth
=
0
# initialize datetime object
# --------------------------
...
...
@@ -106,6 +107,10 @@ re_latitude = re.compile(r"NMEA\s+Latitude\s*[:=]\s*(\d+)\s+(\d+.\d+)\s+(\w)")
# -----------------------------
re_longitude
=
re
.
compile
(
r
"
NMEA\s+Longitude\s*[:=]\s*(\d+)\s+(\d+.\d+)\s+(\w)
"
)
# extract bottom depth at station position from echo sounder
# ------------------------------------------------------------
re_bottom_depth
=
re
.
compile
(
r
"
Bottom\sDepth\s*[:=]\s*(\d+)
"
)
# ---------------------------------------------------------------
# display help using text inside """ """" at the beginning of the
# script with special attribute __doc__ and quit
...
...
@@ -271,7 +276,7 @@ if ascii:
# ---------------------------------
hdr_file
.
write
(
"
//%s %s %s %s %s %s
\n
"
%
\
(
cycle_mesure
,
plateforme
,
institut
,
type
,
sn
,
pi
))
hdr_file
.
write
(
"
St Date
Heur
e Latitude Longitude
Profondeur
\n
"
)
hdr_file
.
write
(
"
St Date
Tim
e Latitude Longitude
Depth
\n
"
)
ascii_file
.
write
(
"
//%s %s %s %s %s %s
\n
"
%
\
(
cycle_mesure
,
plateforme
,
institut
,
type
,
sn
,
pi
))
ascii_file
.
write
(
"
PRFL PRES TEMP PSAL DENS SVEL DOX2 FLU2 TUR3 NAVG
\n
"
)
...
...
@@ -298,7 +303,7 @@ if echo:
# --------------
print
(
"
\n
//%s %s %s %s %s %s
"
%
\
(
cycle_mesure
,
plateforme
,
institut
,
type
,
sn
,
pi
))
print
(
"
File St Date
Heur
e Latitude Longitude
Profondeur
"
,
end
=
''
)
print
(
"
File
St Date
Tim
e Latitude Longitude
Depth Bottom
"
,
end
=
''
)
# iterate over file list getting with getopt.gnu_getopt
# ----------------------------------------------------
...
...
@@ -379,14 +384,20 @@ for fileName in args:
longitude
=
float
(
lon_deg
)
+
(
float
(
lon_min
)
/
60.
)
if
lon_hemi
==
'
E
'
\
else
(
float
(
lon_deg
)
+
(
float
(
lon_min
)
/
60.
))
*
-
1
# extract bottom depth
# --------------------------------------------
if
re_bottom_depth
.
search
(
line
):
bottom_depth
=
re_bottom_depth
.
search
(
line
).
group
(
1
)
# close header file
# -----------------
file
.
close
()
# display header information in console
# -------------------------------------
if
echo
:
print
(
"
%03d %s %s %s %5.0f
"
%
\
(
station
,
dateTime
,
latitude_str
,
longitude_str
,
float
(
Pres
)),
end
=
''
)
if
echo
:
print
(
"
%03d %s %s %s %5.0f %5.0f
"
%
\
(
station
,
dateTime
,
latitude_str
,
longitude_str
,
float
(
Pres
),
float
(
bottom_depth
)),
end
=
''
)
# write station header to ascii files
# -----------------------------------
...
...
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