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
95ecddad
Commit
95ecddad
authored
6 years ago
by
jacques.grelet_ird.fr
Browse files
Options
Downloads
Patches
Plain Diff
update for FR29 files
parent
3130ed94
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
+14
-15
14 additions, 15 deletions
ctd.py
with
14 additions
and
15 deletions
ctd.py
+
14
−
15
View file @
95ecddad
#!/usr/bin/python
#
# ctd
-fr24
.py
# ctd.py
# $Id$
"""
...
...
@@ -8,7 +8,7 @@ Python script for extracting data from SBE-processing files and write out
in various format used by datagui, ODV, Netcdf.
usage:
$ python ctd
-fr24
.py [options] <files>
$ python ctd.py [options] <files>
options are:
...
...
@@ -35,7 +35,7 @@ options are:
--type=<instrument_type>
example:
$ python ctd
-fr24
.py --cycle_mesure=PIRATA-FR2
4
--institut=IRD --plateforme=
"
LE SUROIT
"
--sn=09P
10828
--type=SBE911+ --pi=BOURLES --date_debut=0
9
/0
4
/201
4
--date_fin=
21
/0
5
/201
4
data/asc/fr2
4
???.hdr --echo --local --ascii
$ python ctd.py --cycle_mesure=PIRATA-FR2
9
--institut=IRD --plateforme=
"
THALASSA
"
--sn=09P
01263
--type=SBE911+ --pi=BOURLES --date_debut=0
1
/0
3
/201
9
--date_fin=
04
/0
4
/201
9
data/asc/fr2
9
???.hdr --echo --local --ascii
"""
import
sys
,
re
,
getopt
,
string
,
fileinput
...
...
@@ -45,11 +45,10 @@ from datetime import datetime
seasave_version
=
"
7.21b
"
# initialize constants
# --------------------
VERSION
=
"
V1.0 J Grelet - IRD - US191 IMAGO, Plouzane - may 2011
"
DEGREE
=
176
CODE
=
-
1
CONTEXTE
=
"
AMM
A
"
CONTEXTE
=
"
PIRAT
A
"
TIMEZONE
=
"
GMT
"
FORMAT_DATE
=
"
DMY
"
...
...
@@ -64,15 +63,15 @@ netcdf = False
dtd
=
True
debug
=
0
code_oopc
=
'
0A
'
cycle_mesure
=
'
PIRATA-FR2
4
'
plateforme
=
'
LE SUROIT
'
cycle_mesure
=
'
PIRATA-FR2
9
'
plateforme
=
'
THALASSA
'
institut
=
'
IRD
'
sn
=
'
09P
10828
'
sn
=
'
09P
01263
'
type
=
'
SBE911+
'
pi
=
'
BOURLES
'
date_debut
=
'
0
9
/0
4
/201
4
'
date_fin
=
'
21
/0
5
/201
4
'
output_file
=
'
pirata-fr2
4
'
date_debut
=
'
0
1
/0
3
/201
9
'
date_fin
=
'
04
/0
4
/201
9
'
output_file
=
'
pirata-fr2
9
'
latitude
=
0.
latitude_str
=
''
longitude
=
0.
...
...
@@ -91,7 +90,7 @@ dt = datetime
# extract station number
# -------------------------------------------------
re_station_number
=
re
.
compile
(
r
"
fr2
4
(\d{3})
"
)
re_station_number
=
re
.
compile
(
r
"
fr2
9
(\d{3})
"
)
# extract CTD station start date
# ------------------------------
...
...
@@ -126,7 +125,7 @@ def version():
#------------------------------------------------------------------------------
def
entete_xml
(
fd
):
#my $today = &dateFormat(undef,"%d/%m/%Y");
today
=
'
23
/03/201
2
'
today
=
'
06
/03/201
9
'
fd
.
write
(
"
<?xml version=
\"
1.0
\"
encoding=
\"
UTF-8
\"
?>
\n
"
)
# les commentaires ne sont pas acceptes par XML Toolbox Matlab de Geodise
...
...
@@ -406,8 +405,8 @@ for fileName in args:
# extract data
# ------------
(
scan
,
Pres
,
Depth
,
T0
,
T1
,
C0
,
C1
,
FlC
,
Xmiss
,
Ox0
,
Ox1
,
nbin
,
S0
,
S1
,
sigmateta0
,
\
sigmateta1
,
sndvel0
,
sndvel1
,
flag
)
=
line
.
split
()
(
scan
,
TimeJ
,
Pres
,
Depth
,
T0
,
T1
,
C0
,
C1
,
v1
,
v2
,
v1dt
,
v2dt
,
Xmiss
,
FlC
,
Aqua
,
Ox0
,
Ox1
,
S0
,
S1
,
sigmateta0
,
\
sigmateta1
,
sndvel0
,
sndvel1
,
nbin
,
flag
)
=
line
.
split
()
# write data to ascii file
# ------------------------
...
...
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