Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Grid ADASMELIAE
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 ADASMELIAE
Commits
7723227c
Commit
7723227c
authored
1 year ago
by
Lene Wasskog
Browse files
Options
Downloads
Patches
Plain Diff
fix: Filename bug
parent
4e6b2f44
No related branches found
No related tags found
No related merge requests found
Pipeline
#4025
passed
1 year ago
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ADASMELIAE.py
+27
-27
27 additions, 27 deletions
ADASMELIAE.py
with
27 additions
and
27 deletions
ADASMELIAE.py
+
27
−
27
View file @
7723227c
...
@@ -233,33 +233,33 @@ if __name__ == "__main__":
...
@@ -233,33 +233,33 @@ if __name__ == "__main__":
filename
=
os
.
path
.
basename
(
file
)
filename
=
os
.
path
.
basename
(
file
)
current_file_date_str
=
filename
.
split
(
"
_
"
)[
1
].
split
(
"
.
"
)[
0
]
current_file_date_str
=
filename
.
split
(
"
_
"
)[
1
].
split
(
"
.
"
)[
0
]
current_file_date
=
datetime
.
strptime
(
current_file_date_str
,
"
%Y-%m-%d
"
).
date
()
current_file_date
=
datetime
.
strptime
(
current_file_date_str
,
"
%Y-%m-%d
"
).
date
()
with
open
(
"
/dev/null
"
,
"
w
"
)
as
devnull
:
warning_status_lcc
=
(
f
"
{
tmp_dir
}
result_WARNING_STATUS_
{
current_file_date_str
}
_lcc.tif
"
)
result_lcc
=
f
"
{
tmp_dir
}
result_
{
current_file_date_str
}
_lcc.tif
"
warning_status
=
(
f
"
{
result_tif_dir
}
result_WARNING_STATUS_
{
current_file_date_str
}
.tif
"
)
result
=
f
"
{
result_tif_dir
}
result_
{
current_file_date_str
}
.tif
"
logging
.
debug
(
f
"
Calculate result for
{
current_file_date_str
}
"
)
# Ensure warning status 0 for all points on first day after model end date, mask if mask file is given
if
current_file_date
>
model_end_date
:
# Ensure warning status 0 for all points on first day after model end date, mask if mask file is given
original_file
=
file
if
current_file_date
>
model_end_date
:
tmp_file
=
f
"
{
tmp_dir
}
day_with_warning_status_0.nc
"
tmp_file
=
"
tmp
"
+
file
run_command
(
os
.
rename
(
file
,
tmp_file
)
command
=
f
'
cdo -s -aexpr,
"
WARNING_STATUS = 0
"
{
original_file
}
{
tmp_file
}
'
,
)
if
mask_file_path
is
not
None
:
logging
.
info
(
f
"
Mask
{
tmp_file
}
with
{
os
.
path
.
basename
(
mask_file_path
)
}
"
)
run_command
(
run_command
(
command
=
f
'
cdo -
s -aexpr,
"
WARNING_STATUS = 0
"
{
tmp_file
}
{
file
}
'
,
command
=
f
"
cdo -
P 6 -maskregion,
{
mask_file_path
}
{
tmp_file
}
{
original_
file
}
"
,
)
)
os
.
rename
(
file
,
tmp_file
)
else
:
if
mask_file_path
is
not
None
:
os
.
rename
(
tmp_file
,
original_file
)
logging
.
info
(
f
"
Mask
{
file
}
with
{
os
.
path
.
basename
(
mask_file_path
)
}
"
)
run_command
(
warning_status_lcc
=
(
command
=
f
"
cdo -P 6 -maskregion,
{
mask_file_path
}
{
tmp_file
}
{
file
}
"
,
f
"
{
tmp_dir
}
result_WARNING_STATUS_
{
current_file_date_str
}
_lcc.tif
"
)
)
else
:
result_lcc
=
f
"
{
tmp_dir
}
result_
{
current_file_date_str
}
_lcc.tif
"
os
.
rename
(
tmp_file
,
file
)
warning_status
=
(
f
"
{
result_tif_dir
}
result_WARNING_STATUS_
{
current_file_date_str
}
.tif
"
)
result
=
f
"
{
result_tif_dir
}
result_
{
current_file_date_str
}
.tif
"
logging
.
debug
(
f
"
Calculate result for
{
current_file_date_str
}
"
)
with
open
(
"
/dev/null
"
,
"
w
"
)
as
devnull
:
# For warning status:
# For warning status:
run_command
(
run_command
(
...
@@ -281,9 +281,9 @@ if __name__ == "__main__":
...
@@ -281,9 +281,9 @@ if __name__ == "__main__":
stdout
=
devnull
,
stdout
=
devnull
,
)
)
# Should not generate grey files for more than one day after model end date
# Should not generate grey files for more than one day after model end date
if
current_file_date
>
model_end_date
:
if
current_file_date
>
model_end_date
:
break
break
# Generate mapfile
# Generate mapfile
# Building data sets for language specific legends
# Building data sets for language specific legends
...
...
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