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
028c8fff
Commit
028c8fff
authored
2 years ago
by
Lionel GUEZ
Browse files
Options
Downloads
Patches
Plain Diff
Change the arborescence of files
Adapt to the new definition of an SHPC.
parent
1e8f0da2
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/inst_eddies_v6.py
+13
-17
13 additions, 17 deletions
Convert_Matlab/inst_eddies_v6.py
with
13 additions
and
17 deletions
Convert_Matlab/inst_eddies_v6.py
+
13
−
17
View file @
028c8fff
...
@@ -172,29 +172,33 @@ else:
...
@@ -172,29 +172,33 @@ else:
# There are two factories, one for cyclones and one for anticyclones:
# There are two factories, one for cyclones and one for anticyclones:
factories
=
[
dict
(
writers
=
{},
cell_name
=
"
Anticyclonic_Cell
"
,
factories
=
[
dict
(
writers
=
{},
cell_name
=
"
Anticyclonic_Cell
"
,
cyclone
=
False
,
SHPC
=
"
SHPC_anti
"
,
id
=
"
id_anti_cell
"
),
cyclone
=
False
,
orientation
=
"
Anticyclones
"
,
id
=
"
id_anti_cell
"
),
dict
(
writers
=
{},
cell_name
=
"
Cyclonic_Cell
"
,
cyclone
=
True
,
dict
(
writers
=
{},
cell_name
=
"
Cyclonic_Cell
"
,
cyclone
=
True
,
SHPC
=
"
SHPC_c
yclo
"
,
id
=
"
id_cyclo_cell
"
)]
orientation
=
"
C
yclo
nes
"
,
id
=
"
id_cyclo_cell
"
)]
for
factory
in
factories
:
for
factory
in
factories
:
fname
=
path
.
join
(
factory
[
"
SHPC
"
],
"
extremum
"
)
fname
=
path
.
join
(
"
SHPC
"
,
"
Slice_0
"
,
factory
[
"
orientation
"
],
"
extremum
"
)
factory
[
"
writers
"
][
"
extr
"
]
=
shapefile
.
Writer
(
fname
,
factory
[
"
writers
"
][
"
extr
"
]
=
shapefile
.
Writer
(
fname
,
shapeType
=
shapefile
.
POINT
)
shapeType
=
shapefile
.
POINT
)
fname
=
path
.
join
(
factory
[
"
SHPC
"
],
"
centroid
"
)
fname
=
path
.
join
(
"
SHPC
"
,
"
Slice_0
"
,
factory
[
"
orientation
"
],
"
centroid
"
)
factory
[
"
writers
"
][
"
centroid
"
]
\
factory
[
"
writers
"
][
"
centroid
"
]
\
=
shapefile
.
Writer
(
fname
,
shapeType
=
shapefile
.
POINT
)
=
shapefile
.
Writer
(
fname
,
shapeType
=
shapefile
.
POINT
)
fname
=
path
.
join
(
factory
[
"
SHPC
"
],
"
outermost_contour
"
)
fname
=
path
.
join
(
"
SHPC
"
,
"
Slice_0
"
,
factory
[
"
orientation
"
],
"
outermost_contour
"
)
factory
[
"
writers
"
][
"
outer
"
]
\
factory
[
"
writers
"
][
"
outer
"
]
\
=
shapefile
.
Writer
(
fname
,
shapeType
=
shapefile
.
POLYGON
)
=
shapefile
.
Writer
(
fname
,
shapeType
=
shapefile
.
POLYGON
)
fname
=
path
.
join
(
factory
[
"
SHPC
"
],
"
max_speed_contour
"
)
fname
=
path
.
join
(
"
SHPC
"
,
"
Slice_0
"
,
factory
[
"
orientation
"
],
"
max_speed_contour
"
)
factory
[
"
writers
"
][
"
max_speed
"
]
\
factory
[
"
writers
"
][
"
max_speed
"
]
\
=
shapefile
.
Writer
(
fname
,
shapeType
=
shapefile
.
POLYGON
)
=
shapefile
.
Writer
(
fname
,
shapeType
=
shapefile
.
POLYGON
)
define_fields
(
factory
[
"
writers
"
])
define_fields
(
factory
[
"
writers
"
])
fname
=
path
.
join
(
factory
[
"
SHPC
"
],
"
ishape_last.txt
"
)
fname
=
path
.
join
(
"
SHPC
"
,
"
Slice_0
"
,
factory
[
"
orientation
"
],
"
ishape_last.txt
"
)
factory
[
"
writers
"
][
"
ishape_last
"
]
=
open
(
fname
,
"
w
"
)
factory
[
"
writers
"
][
"
ishape_last
"
]
=
open
(
fname
,
"
w
"
)
...
@@ -250,16 +254,8 @@ nml["grid_nml"] = dict(corner_deg = [matlab_data["X"][0], matlab_data["Y"][0]],
...
@@ -250,16 +254,8 @@ nml["grid_nml"] = dict(corner_deg = [matlab_data["X"][0], matlab_data["Y"][0]],
nlat
=
matlab_data
[
"
Y
"
].
size
,
nlat
=
matlab_data
[
"
Y
"
].
size
,
step_deg
=
[
matlab_data
[
"
X
"
][
1
]
-
matlab_data
[
"
X
"
][
0
],
step_deg
=
[
matlab_data
[
"
X
"
][
1
]
-
matlab_data
[
"
X
"
][
0
],
matlab_data
[
"
Y
"
][
1
]
-
matlab_data
[
"
Y
"
][
0
]])
matlab_data
[
"
Y
"
][
1
]
-
matlab_data
[
"
Y
"
][
0
]])
fname
=
path
.
join
(
"
SHPC
"
,
"
grid_nml.txt
"
)
nml
.
write
(
fname
,
force
=
True
)
for
factory
in
factories
:
for
factory
in
factories
:
fname
=
path
.
join
(
factory
[
"
SHPC
"
],
"
grid_nml.txt
"
)
nml
.
write
(
fname
,
force
=
True
)
fname
=
path
.
join
(
factory
[
"
SHPC
"
],
"
orientation.txt
"
)
with
open
(
fname
,
"
w
"
)
as
f
:
if
factory
[
"
cyclone
"
]:
f
.
write
(
"
cyclones
\n
"
)
else
:
f
.
write
(
"
anticyclones
\n
"
)
for
key
,
v
in
factory
[
"
writers
"
].
items
():
v
.
close
()
for
key
,
v
in
factory
[
"
writers
"
].
items
():
v
.
close
()
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