Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
enstools-feature
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
Christoph.Fischer
enstools-feature
Commits
1c78d728
Commit
1c78d728
authored
3 years ago
by
Christoph.Fischer
Browse files
Options
Downloads
Patches
Plain Diff
support for data with scalar time
parent
b54fcf4a
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
enstools/feature/identification/identification.py
+8
-1
8 additions, 1 deletion
enstools/feature/identification/identification.py
with
8 additions
and
1 deletion
enstools/feature/identification/identification.py
+
8
−
1
View file @
1c78d728
...
@@ -153,6 +153,11 @@ class IdentificationTechnique(ABC):
...
@@ -153,6 +153,11 @@ class IdentificationTechnique(ABC):
time_dim_in_input
=
(
time_dim
is
not
None
)
time_dim_in_input
=
(
time_dim
is
not
None
)
if
time_dim_in_input
and
time_dim
in
dataset
.
dims
:
if
time_dim_in_input
and
time_dim
in
dataset
.
dims
:
split_dimensions
.
append
(
time_dim
)
split_dimensions
.
append
(
time_dim
)
time_var_value
=
None
if
not
time_dim_in_input
and
'
time
'
in
dataset
.
variables
:
# time dimension as scalar in dataset, also remember it
time_var_value
=
dataset
.
variables
[
'
time
'
].
data
time_var_value
=
str
(
np
.
datetime_as_string
(
time_var_value
,
unit
=
'
s
'
))
time_dim_len
=
len
(
dataset
.
coords
[
time_dim
].
values
)
if
time_dim_in_input
else
1
time_dim_len
=
len
(
dataset
.
coords
[
time_dim
].
values
)
if
time_dim_in_input
else
1
# search init_time
# search init_time
...
@@ -210,8 +215,10 @@ class IdentificationTechnique(ABC):
...
@@ -210,8 +215,10 @@ class IdentificationTechnique(ABC):
valid_time
=
dataset
.
coords
[
time_dim
].
data
[
t
]
valid_time
=
dataset
.
coords
[
time_dim
].
data
[
t
]
timestep
.
valid_time
=
str
(
np
.
datetime_as_string
(
valid_time
,
unit
=
'
s
'
))
timestep
.
valid_time
=
str
(
np
.
datetime_as_string
(
valid_time
,
unit
=
'
s
'
))
cur_indices
[
time_dim
]
=
valid_time
cur_indices
[
time_dim
]
=
valid_time
elif
time_var_value
is
not
None
:
timestep
.
valid_time
=
time_var_value
# ID to access this object block in protobuf set
# ID to access this object block in protobuf set
sets_id
=
len
(
self
.
pb_dataset
.
sets
)
-
1
sets_id
=
len
(
self
.
pb_dataset
.
sets
)
-
1
tl_id
=
len
(
s_i
.
timesteps
)
-
1
tl_id
=
len
(
s_i
.
timesteps
)
-
1
index_field
.
loc
[
cur_indices
]
=
(
sets_id
,
tl_id
)
index_field
.
loc
[
cur_indices
]
=
(
sets_id
,
tl_id
)
...
...
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