Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
skais
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Raphael Sturgis
skais
Commits
2874e51c
Commit
2874e51c
authored
3 years ago
by
Raphael Sturgis
Browse files
Options
Downloads
Patches
Plain Diff
fixed circular import
parent
0065d12e
No related branches found
No related tags found
1 merge request
!6
Develop
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
skais/ais/ais_points.py
+0
-14
0 additions, 14 deletions
skais/ais/ais_points.py
skais/process/ais_operations.py
+14
-0
14 additions, 0 deletions
skais/process/ais_operations.py
skais/tests/ais/test_ais_points.py
+0
-32
0 additions, 32 deletions
skais/tests/ais/test_ais_points.py
with
14 additions
and
46 deletions
skais/ais/ais_points.py
+
0
−
14
View file @
2874e51c
...
...
@@ -2,8 +2,6 @@ import numpy as np
import
pandas
as
pd
from
scipy.stats
import
stats
from
skais.ais.ais_trajectory
import
AISTrajectory
# def compute_trajectories(df, time_gap, min_size=50, size_limit=500, interpolation_time=None):
# n_sample = len(df.index)
...
...
@@ -108,18 +106,6 @@ class AISPoints:
self
.
df
[
"
drift
"
]
=
self
.
df
.
apply
(
lambda
x
:
180
-
abs
(
abs
(
x
[
'
heading
'
]
-
x
[
'
cog
'
])
-
180
),
axis
=
1
)
# Trajectories
"""
Separates AISPoints into individual trajectories
"""
def
get_trajectories
(
self
):
trajectories
=
[]
for
mmsi
in
self
.
df
.
mmsi
.
unique
():
trajectories
.
append
(
AISTrajectory
(
self
.
df
[
self
.
df
[
'
mmsi
'
]
==
mmsi
].
reset_index
(
drop
=
True
)))
return
trajectories
# Static methods
@staticmethod
def
fuse
(
*
args
):
...
...
This diff is collapsed.
Click to expand it.
skais/process/ais_operations.py
0 → 100644
+
14
−
0
View file @
2874e51c
from
skais.ais.ais_trajectory
import
AISTrajectory
# Trajectories
"""
Separates AISPoints into individual trajectories
"""
def
get_trajectories
(
ais_points
):
trajectories
=
[]
for
mmsi
in
ais_points
.
df
.
mmsi
.
unique
():
trajectories
.
append
(
AISTrajectory
(
ais_points
.
df
[
ais_points
.
df
[
'
mmsi
'
]
==
mmsi
].
reset_index
(
drop
=
True
)))
return
trajectories
This diff is collapsed.
Click to expand it.
skais/tests/ais/test_ais_points.py
+
0
−
32
View file @
2874e51c
...
...
@@ -179,38 +179,6 @@ class TestAISPositions(unittest.TestCase):
40
,
30
,
20
,
10
,
0
,
10
,
20
,
30
,
40
,
50
,
60
,
70
,
80
,
90
,
100
,
110
,
120
,
130
,
140
,
150
,
160
,
170
]))
def
test_get_trajectories
(
self
):
ais_points
=
AISPoints
(
pd
.
DataFrame
(
{
"
mmsi
"
:
[
123456789
for
_
in
range
(
10
)]
+
[
987654321
for
_
in
range
(
10
)],
"
ts_sec
"
:
[
i
for
i
in
range
(
20
)]
}
)
)
expected
=
[
AISTrajectory
(
pd
.
DataFrame
(
{
"
mmsi
"
:
[
123456789
for
_
in
range
(
10
)],
"
ts_sec
"
:
[
i
for
i
in
range
(
10
)]
}
)
),
AISTrajectory
(
pd
.
DataFrame
(
{
"
mmsi
"
:
[
987654321
for
_
in
range
(
10
)],
"
ts_sec
"
:
[
10
+
i
for
i
in
range
(
10
)]
}
)
)
]
for
expected_trajectory
,
result_trajectory
in
zip
(
expected
,
ais_points
.
get_trajectories
()):
pd
.
testing
.
assert_frame_equal
(
expected_trajectory
.
df
,
result_trajectory
.
df
)
# def test_histogram_no_label_simple(self):
# result = np.histogramdd(self.ais_points.df[["sog", "diff"]].to_numpy(), 3, [[0, 30], [0, 180]])[0]
#
...
...
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