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
Admin message
Authenticating with a password
with git over http
works again
. More information
here
.
Show more breadcrumbs
IPSL
LMD
DPAO
Detection eddies
Commits
ed16ca4a
Commit
ed16ca4a
authored
2 years ago
by
Lionel GUEZ
Browse files
Options
Downloads
Patches
Plain Diff
Move function `get_slice` to method of SHPC class
parent
4ad79fc0
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Common/util_eddies.py
+6
-0
6 additions, 0 deletions
Common/util_eddies.py
Trajectories/cost_function.py
+1
-7
1 addition, 7 deletions
Trajectories/cost_function.py
with
7 additions
and
7 deletions
Common/util_eddies.py
+
6
−
0
View file @
ed16ca4a
...
...
@@ -3,6 +3,7 @@ import math
from
os
import
path
import
numpy
as
np
import
sys
import
bisect
class
SHPC_class
:
def
__init__
(
self
,
SHPC_dir
,
def_orient
):
...
...
@@ -117,6 +118,11 @@ class SHPC_class:
"
ishape_last.txt
"
)
np
.
savetxt
(
fname
,
self
.
_ishape_last
[
i_slice
][
orientation
],
fmt
=
"
%.0d
"
)
def
get_slice
(
self
,
date_index
):
i_slice
=
bisect
.
bisect
(
self
.
d_init
,
date_index
)
-
1
assert
i_slice
>=
0
return
i_slice
def
comp_ishape
(
date
,
eddy_index
,
SHPC
,
i_slice
,
orientation
):
"""
Compute the location in the shapefiles.
"""
...
...
This diff is collapsed.
Click to expand it.
Trajectories/cost_function.py
+
1
−
7
View file @
ed16ca4a
...
...
@@ -23,7 +23,6 @@ import json
import
math
import
report_graph
import
util_eddies
import
bisect
import
argparse
Omega
=
2
*
math
.
pi
/
86164.
...
...
@@ -54,11 +53,6 @@ def calculate_radii_rossby(properties):
if
n_valid_Rossby
!=
0
:
avg_Rossby
/=
n_valid_Rossby
return
avg_rad
,
avg_Rossby
def
get_slice
(
array_d_init
,
date_index
):
i_slice
=
bisect
.
bisect
(
array_d_init
,
date_index
)
-
1
assert
i_slice
>=
0
return
i_slice
def
node_to_prop
(
node_list
,
e_overestim
,
SHPC
):
"""
node_list is a list of node identification numbers for
instantaneous eddies. This function returns some properties of the
...
...
@@ -72,7 +66,7 @@ def node_to_prop(node_list, e_overestim, SHPC):
for
n
in
node_list
:
date_index
,
eddy_index
=
report_graph
.
node_to_date_eddy
(
n
,
e_overestim
)
i_slice
=
get_slice
(
SHPC
.
d_init
,
date_index
)
i_slice
=
SHPC
.
get_slice
(
date_index
)
ishape
=
util_eddies
.
comp_ishape
(
date_index
,
eddy_index
,
SHPC
,
i_slice
,
SHPC
.
def_orient
)
shapeRec
=
SHPC
.
get_reader
(
i_slice
,
"
extremum
"
).
shapeRecord
(
ishape
)
...
...
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