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
88fee1ef
Commit
88fee1ef
authored
4 years ago
by
Lionel GUEZ
Browse files
Options
Downloads
Patches
Plain Diff
Rename `eddy_index_Matlab` to `node_index`
parent
72d378dd
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
Convert_Matlab/overlap_v6.py
+6
-6
6 additions, 6 deletions
Convert_Matlab/overlap_v6.py
with
6 additions
and
6 deletions
Convert_Matlab/overlap_v6.py
+
6
−
6
View file @
88fee1ef
...
...
@@ -10,7 +10,7 @@ import datetime
import
csv
import
sys
def
convert_id
(
cyclone
,
eddy
_index
_Matlab
):
def
convert_id
(
cyclone
,
node
_index
):
"""
Convert from Matlab eddy identification to eddy
identification in shapefiles.
...
...
@@ -21,15 +21,15 @@ def convert_id(cyclone, eddy_index_Matlab):
"""
k
=
(
eddy
_index
_Matlab
-
1
)
//
n_max
k
=
(
node
_index
-
1
)
//
n_max
date
=
datetime
.
date
.
fromordinal
(
date_num
[
k
]
-
366
)
-
datetime
.
date
(
1950
,
1
,
1
)
date
=
date
.
days
if
cyclone
:
eddy_index_F
=
Nanti
[
k
]
+
eddy
_index
_Matlab
-
k
*
n_max
eddy_index_F
=
Nanti
[
k
]
+
node
_index
-
k
*
n_max
else
:
eddy_index_F
=
eddy
_index
_Matlab
-
k
*
n_max
eddy_index_F
=
node
_index
-
k
*
n_max
return
date
,
eddy_index_F
...
...
@@ -42,9 +42,9 @@ def print_edgelist(id_child, cyclone):
try
:
# Try processing id_child_1 as an array:
for
eddy
_index
_Matlab
in
id_child_1
:
for
node
_index
in
id_child_1
:
writer
.
writerow
(
convert_id
(
*
predecessor
)
+
convert_id
(
cyclone
,
eddy
_index
_Matlab
))
+
convert_id
(
cyclone
,
node
_index
))
except
TypeError
:
# id_child_1 is a scalar int.
writer
.
writerow
(
convert_id
(
*
predecessor
)
...
...
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