Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
synergy
o3skim
Commits
8338a806
Commit
8338a806
authored
Dec 09, 2020
by
BorjaEst
Browse files
mock time coord input "end" optional, def==start
parent
a09497b6
Changes
2
Hide whitespace changes
Inline
Side-by-side
tests/mockup/coordinate.py
View file @
8338a806
...
...
@@ -3,7 +3,9 @@
import
datetime
def
__timeline
(
start
,
end
,
step
=
10
):
def
__timeline
(
start
,
end
=
None
,
step
=
10
):
if
not
end
:
end
=
start
start
=
datetime
.
datetime
(
start
,
1
,
1
)
end
=
datetime
.
datetime
(
end
,
12
,
31
)
step
=
datetime
.
timedelta
(
days
=
step
)
...
...
tests/mockup_data.py
View file @
8338a806
...
...
@@ -17,13 +17,13 @@ with utils.cd(model1_dir):
mockup
.
Dataset
(
var_coords
=
{
'toz'
:
[
coordinate
.
time
(
year
,
year
),
coordinate
.
time
(
year
),
coordinate
.
lat
(),
coordinate
.
lon
()
]
},
coords
=
[
coordinate
.
time
(
year
,
year
),
coordinate
.
time
(
year
),
coordinate
.
plev
(),
coordinate
.
lat
(),
coordinate
.
lon
()
...
...
@@ -37,14 +37,14 @@ with utils.cd(model1_dir):
mockup
.
Dataset
(
var_coords
=
{
'vmro3'
:
[
coordinate
.
time
(
year
,
year
),
coordinate
.
time
(
year
),
coordinate
.
plev
(),
coordinate
.
lat
(),
coordinate
.
lon
()
]
},
coords
=
[
coordinate
.
time
(
year
,
year
),
coordinate
.
time
(
year
),
coordinate
.
plev
(),
coordinate
.
lat
(),
coordinate
.
lon
()
...
...
@@ -60,22 +60,22 @@ with utils.cd(model2_dir):
mockup
.
Dataset
(
var_coords
=
{
'toz'
:
[
coordinate
.
time
(
year
,
year
),
coordinate
.
time
(
year
),
coordinate
.
lat
(),
coordinate
.
lon
()
],
'vmro3'
:
[
coordinate
.
time
(
year
,
year
),
coordinate
.
time
(
year
),
coordinate
.
plev
(),
coordinate
.
lat
(),
coordinate
.
lon
()
]
},
coords
=
[
coordinate
.
time
(
year
,
year
),
coordinate
.
time
(
year
),
coordinate
.
plev
(),
coordinate
.
lat
(),
coordinate
.
lon
()
]
).
to_netcdf
(
"
toz
_"
+
str
(
year
)
+
".nc"
)
).
to_netcdf
(
"
all
_"
+
str
(
year
)
+
".nc"
)
Write
Preview
Supports
Markdown
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