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
Gitlab has been updated. More info
here
and
there
.
Show more breadcrumbs
IPSL
LMD
DPAO
Detection eddies
Commits
dc04124d
Commit
dc04124d
authored
4 years ago
by
Lionel GUEZ
Browse files
Options
Downloads
Patches
Plain Diff
Do not re-compute `date_index`, just increment it
parent
42ac7a69
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
Convert_Matlab/inst_eddies_v6.py
+3
-2
3 additions, 2 deletions
Convert_Matlab/inst_eddies_v6.py
with
3 additions
and
2 deletions
Convert_Matlab/inst_eddies_v6.py
+
3
−
2
View file @
dc04124d
...
...
@@ -98,6 +98,8 @@ adt_file = sys.argv[1]
dirname
,
basename
=
path
.
split
(
adt_file
)
my_date
=
parser
.
parse
(
basename
,
yearfirst
=
True
,
dayfirst
=
False
,
fuzzy
=
True
).
date
()
date_index
=
my_date
-
datetime
.
date
(
1950
,
1
,
1
)
date_index
=
date_index
.
days
if
len
(
sys
.
argv
)
==
3
:
final_date
=
parser
.
parse
(
sys
.
argv
[
2
],
yearfirst
=
True
,
dayfirst
=
False
)
\
...
...
@@ -140,8 +142,6 @@ while True:
# matlab_data is a dictionary.
assert
datetime
.
date
.
fromordinal
(
matlab_data
[
"
date_num
"
]
-
366
)
==
my_date
date_index
=
my_date
-
datetime
.
date
(
1950
,
1
,
1
)
date_index
=
date_index
.
days
for
f
in
factories
:
write
(
f
[
"
writers
"
],
matlab_data
[
f
[
"
cell_name
"
]],
f
[
"
cyclone
"
])
...
...
@@ -149,6 +149,7 @@ while True:
os
.
remove
(
"
adt.mat
"
)
my_date
+=
datetime
.
timedelta
(
1
)
if
my_date
>
final_date
:
break
date_index
+=
1
basename
=
my_date
.
strftime
(
"
adt_%Y-%m-%d.mat
"
)
adt_file
=
path
.
join
(
dirname
,
basename
)
...
...
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