Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
PyFVCOM
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
4
Issues
4
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
FVCOM
PyFVCOM
Commits
f574ade5
Commit
f574ade5
authored
Feb 20, 2018
by
Pierre Cazenave
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Save the header line so we can find the indices for the time and position information.
parent
38bb97fe
Pipeline
#799
failed with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
PyFVCOM/ctd/__init__.py
PyFVCOM/ctd/__init__.py
+10
-9
No files found.
PyFVCOM/ctd/__init__.py
View file @
f574ade5
...
...
@@ -811,7 +811,8 @@ class CTD(object):
self
.
header
[
'names'
].
append
(
line_list
)
# Get the first line of data so we can check the header is in order. Once we've got that,
# we can begin extracting data.
# we can begin extracting data. Save the header list so we can find indices for data.
header_list
=
line_list
line
=
next
(
f
)
line_list
=
_split_wco_lines
(
line
)
...
...
@@ -842,14 +843,14 @@ class CTD(object):
# In order to make the header vaguely usable, grab the initial time and position for this
# cast.
lon_idx
,
lat_idx
,
date_idx
,
time_idx
=
None
,
None
,
None
,
None
if
'Longitude'
in
line
_list
:
lon_idx
=
line
_list
.
index
(
'Longitude'
)
if
'Latitude'
in
line
_list
:
lat_idx
=
line
_list
.
index
(
'Latitude'
)
if
'mm_dd_yyyy'
in
line
_list
:
date_idx
=
line
_list
.
index
(
'mm_dd_yyyy'
)
if
'hh_mm_ss'
in
line
_list
:
time_idx
=
line
_list
.
index
(
'hh_mm_ss'
)
if
'Longitude'
in
header
_list
:
lon_idx
=
header
_list
.
index
(
'Longitude'
)
if
'Latitude'
in
header
_list
:
lat_idx
=
header
_list
.
index
(
'Latitude'
)
if
'mm_dd_yyyy'
in
header
_list
:
date_idx
=
header
_list
.
index
(
'mm_dd_yyyy'
)
if
'hh_mm_ss'
in
header
_list
:
time_idx
=
header
_list
.
index
(
'hh_mm_ss'
)
if
lon_idx
is
None
and
lat_idx
is
None
:
# Assume some file format for the data and use that for the position.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment