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
011e4023
Commit
011e4023
authored
5 years ago
by
jacques.grelet_ird.fr
Browse files
Options
Downloads
Patches
Plain Diff
move DEGREE to tools
parent
69605b52
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
file_extractor.py
+2
-4
2 additions, 4 deletions
file_extractor.py
with
2 additions
and
4 deletions
file_extractor.py
+
2
−
4
View file @
011e4023
...
@@ -11,8 +11,6 @@ import re
...
@@ -11,8 +11,6 @@ import re
from
datetime
import
datetime
from
datetime
import
datetime
import
tools
import
tools
DEGREE
=
176
class
FileExtractor
:
class
FileExtractor
:
'''
'''
...
@@ -251,7 +249,7 @@ class FileExtractor:
...
@@ -251,7 +249,7 @@ class FileExtractor:
(
lat_deg
,
lat_min
,
lat_hemi
)
=
self
.
__regex
[
k
].
search
(
line
).
groups
()
(
lat_deg
,
lat_min
,
lat_hemi
)
=
self
.
__regex
[
k
].
search
(
line
).
groups
()
# format latitude to string
# format latitude to string
latitude_str
=
"
%s%c%s %s
"
%
(
lat_deg
,
DEGREE
,
lat_min
,
lat_hemi
)
latitude_str
=
"
%s%c%s %s
"
%
(
lat_deg
,
tools
.
DEGREE
,
lat_min
,
lat_hemi
)
# transform to decimal using ternary operator
# transform to decimal using ternary operator
latitude
=
float
(
lat_deg
)
+
(
float
(
lat_min
)
/
60.
)
if
lat_hemi
==
'
N
'
else
\
latitude
=
float
(
lat_deg
)
+
(
float
(
lat_min
)
/
60.
)
if
lat_hemi
==
'
N
'
else
\
...
@@ -265,7 +263,7 @@ class FileExtractor:
...
@@ -265,7 +263,7 @@ class FileExtractor:
(
lon_deg
,
lon_min
,
lon_hemi
)
=
self
.
__regex
[
k
].
search
(
line
).
groups
()
(
lon_deg
,
lon_min
,
lon_hemi
)
=
self
.
__regex
[
k
].
search
(
line
).
groups
()
# format longitude to string
# format longitude to string
longitude_str
=
"
%s%c%s %s
"
%
(
lon_deg
,
DEGREE
,
lon_min
,
lon_hemi
)
longitude_str
=
"
%s%c%s %s
"
%
(
lon_deg
,
tools
.
DEGREE
,
lon_min
,
lon_hemi
)
# transform to decimal using ternary operator
# transform to decimal using ternary operator
longitude
=
float
(
lon_deg
)
+
(
float
(
lon_min
)
/
60.
)
if
lon_hemi
==
'
E
'
else
\
longitude
=
float
(
lon_deg
)
+
(
float
(
lon_min
)
/
60.
)
if
lon_hemi
==
'
E
'
else
\
...
...
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