Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
Detection eddies
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
IPSL
LMD
DPAO
Detection eddies
Commits
d95e4619
Commit
d95e4619
authored
1 year ago
by
Lionel GUEZ
Browse files
Options
Downloads
Patches
Plain Diff
Add new scripts
parent
6e74f389
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Trajectories/search_segment.py
+21
-0
21 additions, 0 deletions
Trajectories/search_segment.py
Trajectories/search_traj.py
+21
-0
21 additions, 0 deletions
Trajectories/search_traj.py
with
42 additions
and
0 deletions
Trajectories/search_segment.py
0 → 100755
+
21
−
0
View file @
d95e4619
#!/usr/bin/env python3
"""
This script reads a graph of segments (with or without cost values)
and searches the segment containing a given instantaneous eddy.
"""
import
sys
import
json
import
graph_tool
g
=
graph_tool
.
load_graph
(
sys
.
argv
[
1
])
node
=
int
(
sys
.
argv
[
2
])
for
v
in
g
.
vertices
():
if
node
in
g
.
vp
.
inst_eddies
[
v
]:
print
(
"
segment =
"
,
g
.
vp
.
inst_eddies
[
v
])
break
else
:
sys
.
exit
(
"
Node not found
"
)
This diff is collapsed.
Click to expand it.
Trajectories/search_traj.py
0 → 100755
+
21
−
0
View file @
d95e4619
#!/usr/bin/env python3
"""
This script reads a Json file containing trajectories as lists of
segments, and searches the trajectory which contains a given segment.
"""
import
sys
import
json
with
open
(
sys
.
argv
[
1
])
as
f_obj
:
traj_segm
=
json
.
load
(
f_obj
)
segment
=
int
(
sys
.
argv
[
2
])
for
traj
in
traj_segm
:
if
segment
in
traj
:
print
(
f
"
{
traj
=
}
"
)
break
else
:
sys
.
exit
(
"
Trajectory not found
"
)
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