Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Grid PSILARTEMP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
Show more breadcrumbs
VIPS
Models
GRID
Grid PSILARTEMP
Commits
48449958
Commit
48449958
authored
1 year ago
by
Lene Wasskog
Browse files
Options
Downloads
Patches
Plain Diff
feat: Include year as env variable, update year references in script
parent
ed3d2910
No related branches found
No related tags found
1 merge request
!1
Include year in .env, update references in script
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
PSILARTEMP.py
+2
-1
2 additions, 1 deletion
PSILARTEMP.py
env-sample
+2
-0
2 additions, 0 deletions
env-sample
with
4 additions
and
1 deletion
PSILARTEMP.py
+
2
−
1
View file @
48449958
...
...
@@ -31,6 +31,7 @@ load_dotenv()
config
=
configparser
.
ConfigParser
()
config
.
read
(
"
PSILARTEMP.cfg
"
)
year
=
os
.
getenv
(
"
YEAR
"
)
weatherdata_path
=
os
.
getenv
(
"
WEATHER_DATA_DIR
"
)
tmp_path
=
"
tmp/
"
out_path
=
os
.
getenv
(
"
DATA_DIR
"
)
...
...
@@ -42,7 +43,7 @@ local_timezone = pytz.timezone("Europe/Oslo")
# Calculate cumulated degree days above 5 degrees after 1st of April
# Remove all values before April 1st
subprocess
.
run
(
f
"
cdo -selname,TM -seldate,
2023
-04-01T00:00:00,
2023
-12-31T00:00:00
{
weatherdata_path
}
met_1_0km_nordic-
2023
.nc
{
tmp_path
}
TM_from_april.nc
"
,
f
"
cdo -selname,TM -seldate,
{
year
}
-04-01T00:00:00,
{
year
}
-12-31T00:00:00
{
weatherdata_path
}
met_1_0km_nordic-
{
year
}
.nc
{
tmp_path
}
TM_from_april.nc
"
,
shell
=
True
,
)
# Subtracting 5 deg C from all cells
...
...
This diff is collapsed.
Click to expand it.
env-sample
+
2
−
0
View file @
48449958
# Use this as an example to create your own .env file
# Year to run for
YEAR=2024
# Where your application resides
HOME_DIR=/home/foo/
# Path to the weather data
...
...
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