Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bw-bestperf
FuXi
Commits
cfe4af4c
Commit
cfe4af4c
authored
Aug 16, 2023
by
tpys
Browse files
add split param for save_like
parent
6dd8498d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
data_util.py
data_util.py
+7
-2
No files found.
data_util.py
View file @
cfe4af4c
...
@@ -25,10 +25,15 @@ def split_variable(ds, name):
...
@@ -25,10 +25,15 @@ def split_variable(ds, name):
return
v
return
v
def
save_like
(
output
,
input
,
step
,
save_dir
=
""
,
freq
=
6
,
split
=
False
):
def
save_like
(
output
,
input
,
step
,
input_type
=
"hres"
,
save_dir
=
""
,
freq
=
6
,
split
=
False
):
if
save_dir
:
if
save_dir
:
os
.
makedirs
(
save_dir
,
exist_ok
=
True
)
os
.
makedirs
(
save_dir
,
exist_ok
=
True
)
dtime
=
(
step
+
2
)
*
freq
#
if
input_type
==
"hres"
:
dtime
=
(
step
+
2
)
*
freq
elif
input_type
==
"gfs"
:
dtime
=
(
step
+
1
)
*
freq
init_time
=
pd
.
to_datetime
(
input
.
time
.
values
[
0
])
init_time
=
pd
.
to_datetime
(
input
.
time
.
values
[
0
])
ds
=
xr
.
DataArray
(
ds
=
xr
.
DataArray
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment