Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
thopri
PyNEMO
Commits
3dce3e6b
Commit
3dce3e6b
authored
4 years ago
by
thopri
Browse files
Options
Download
Email Patches
Plain Diff
updated time_counter to use base year in bdy file
parent
8efb5139
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
pynemo/nemo_bdy_extr_tm3.py
pynemo/nemo_bdy_extr_tm3.py
+7
-7
No files found.
pynemo/nemo_bdy_extr_tm3.py
View file @
3dce3e6b
...
...
@@ -452,7 +452,7 @@ class Extract:
# define src/dst cals
sf
,
ed
=
self
.
cal_trans
(
sc_time
.
calendar
,
#sc_time[0].calendar
self
.
settings
[
'dst_calendar'
],
year
,
month
)
DstCal
=
utime
(
'seconds since %d-1-1'
%
year
,
DstCal
=
utime
(
'seconds since %d-1-1'
%
self
.
settings
[
'base_
year
'
]
,
self
.
settings
[
'dst_calendar'
])
dst_start
=
DstCal
.
date2num
(
datetime
(
year
,
month
,
1
))
dst_end
=
DstCal
.
date2num
(
datetime
(
year
,
month
,
ed
,
23
,
59
,
59
))
...
...
@@ -473,11 +473,11 @@ class Extract:
rev_seq
=
list
(
range
(
len
(
sc_time
.
time_counter
)))
rev_seq
.
reverse
()
for
date
in
rev_seq
:
if
src_date_seconds
[
date
]
<
dst_start
:
if
src_date_seconds
[
date
]
<
=
dst_start
:
first_date
=
date
break
for
date
in
range
(
len
(
sc_time
.
time_counter
)):
if
src_date_seconds
[
date
]
>
dst_end
:
if
src_date_seconds
[
date
]
>
=
dst_end
:
last_date
=
date
break
...
...
@@ -837,7 +837,7 @@ class Extract:
# we're grouping variables then they must all have the same date stamps
nt
=
len
(
self
.
d_bdy
[
self
.
var_nam
[
0
]][
'date'
])
time_counter
=
np
.
zeros
([
nt
])
tmp_cal
=
utime
(
'seconds since %d-1-1'
%
year
,
tmp_cal
=
utime
(
'seconds since %d-1-1'
%
self
.
settings
[
'base_
year
'
]
,
self
.
settings
[
'dst_calendar'
].
lower
())
for
t
in
range
(
nt
):
...
...
@@ -929,12 +929,12 @@ class Extract:
# for v in self.variables:
for
v
in
self
.
var_nam
:
if
self
.
isslab
==
True
:
# Calculate depth averaged velocity
if
self
.
isslab
==
True
:
tmp_var
=
np
.
where
(
np
.
isnan
(
self
.
d_bdy
[
v
][
year
][
'data'
][:,
:,
:]),
self
.
settings
[
'fv'
],
self
.
d_bdy
[
v
][
year
][
'data'
][:,
:,
:])
# remove depths from varible leaving surface layer
tmp_var
=
tmp_var
[:,
0
:
1
,:]
# Replace NaNs with specified fill value
else
:
tmp_var
=
np
.
where
(
np
.
isnan
(
self
.
d_bdy
[
v
][
year
][
'data'
][:,:,:]),
self
.
settings
[
'fv'
],
...
...
This diff is collapsed.
Click to expand it.
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