Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Grid SEPTREFHUM
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
VIPS
Models
GRID
Grid SEPTREFHUM
Commits
364d1dfb
Commit
364d1dfb
authored
1 year ago
by
Tor-Einar Skog
Browse files
Options
Downloads
Patches
Plain Diff
Change weather data file name
parent
dab3e09f
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
SEPTREFHUM.py
+3
-2
3 additions, 2 deletions
SEPTREFHUM.py
with
3 additions
and
2 deletions
SEPTREFHUM.py
+
3
−
2
View file @
364d1dfb
...
...
@@ -11,6 +11,7 @@ import pytz
import
netCDF4
as
nc
### Config TODO: Make part of config file?
# TODO: Figure out where files will be collected from and stored to.
infile_path
=
"
in/
"
outfile_path
=
"
out/
"
...
...
@@ -25,11 +26,11 @@ local_timezone = pytz.timezone("Europe/Oslo")
# Empty the tmpfile folder
subprocess
.
run
(
"
rm %s*
"
%
tmpfile_path
,
shell
=
True
)
weatherdata_files
=
glob
.
glob
(
"
%s
analysis
-*.nc
"
%
infile_path
)
weatherdata_files
=
glob
.
glob
(
"
%s
weather
-*.nc
"
%
infile_path
)
# Iterate the set of hourly weather data files
for
file
in
weatherdata_files
:
file_date
=
file
[
file
.
index
(
"
analysis
"
)
+
9
:
file
.
index
(
"
analysis
"
)
+
1
9
]
file_date
=
file
[
file
.
index
(
"
weather
"
)
+
8
:
file
.
index
(
"
weather
"
)
+
1
8
]
# Assuming we're in the summer
wh_sum_date
=
datetime
.
fromisoformat
(
"
%sT00:00:00%s
"
%
(
file_date
,
utc_offset
))
#print(wh_sum_date)
...
...
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