Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Climax
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
earth_observation_public
Climax
Commits
105a90b4
Commit
105a90b4
authored
3 years ago
by
Frisinghelli Daniel
Browse files
Options
Downloads
Patches
Plain Diff
Added slope and aspect parameters to file naming convention.
parent
c815032c
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
climax/core/dataset.py
+5
-2
5 additions, 2 deletions
climax/core/dataset.py
climax/main/downscale_infer.py
+3
-3
3 additions, 3 deletions
climax/main/downscale_infer.py
climax/main/downscale_train.py
+3
-3
3 additions, 3 deletions
climax/main/downscale_train.py
with
11 additions
and
8 deletions
climax/core/dataset.py
+
5
−
2
View file @
105a90b4
...
...
@@ -104,7 +104,7 @@ class EoDataset(torch.utils.data.Dataset):
@staticmethod
def
state_file
(
model
,
predictand
,
predictors
,
plevels
,
dem
=
False
,
doy
=
False
):
dem_features
=
False
,
doy
=
False
):
# naming convention:
# <model>_<predictand>_<Ppredictors>_<plevels>_<Spredictors>.pt
...
...
@@ -116,8 +116,11 @@ class EoDataset(torch.utils.data.Dataset):
state_file
=
'
_
'
.
join
([
model
.
__name__
,
str
(
predictand
),
Ppredictors
,
*
plevels
,
Spredictors
])
# check whether digital elevation model and day of year were used
# check whether digital elevation model, slope and aspect, and the day
# of year were used
state_file
=
'
_
'
.
join
([
state_file
,
'
dem
'
])
if
dem
else
state_file
state_file
=
(
'
_
'
.
join
([
state_file
,
'
sa
'
])
if
dem_features
else
state_file
)
state_file
=
'
_
'
.
join
([
state_file
,
'
doy
'
])
if
doy
else
state_file
# add file extension: .pt
...
...
This diff is collapsed.
Click to expand it.
climax/main/downscale_infer.py
+
3
−
3
View file @
105a90b4
...
...
@@ -11,14 +11,13 @@ from datetime import timedelta
from
logging.config
import
dictConfig
# externals
import
numpy
as
np
import
xarray
as
xr
# locals
from
pysegcnn.core.trainer
import
LogConfig
from
pysegcnn.core.models
import
Network
from
pysegcnn.core.logging
import
log_conf
from
pysegcnn.core.utils
import
img2np
,
search_files
from
pysegcnn.core.utils
import
search_files
from
climax.core.dataset
import
ERA5Dataset
from
climax.core.predict
import
predict_ERA5
from
climax.core.utils
import
split_date_range
...
...
@@ -38,7 +37,8 @@ if __name__ == '__main__':
# filename of pretrained model
state_file
=
ERA5Dataset
.
state_file
(
NET
,
PREDICTAND
,
ERA5_PREDICTORS
,
ERA5_PLEVELS
,
dem
=
DEM
,
doy
=
DOY
)
NET
,
PREDICTAND
,
ERA5_PREDICTORS
,
ERA5_PLEVELS
,
dem
=
DEM
,
dem_features
=
DEM_FEATURES
,
doy
=
DOY
)
state_file
=
MODEL_PATH
.
joinpath
(
state_file
)
# initialize logging
...
...
This diff is collapsed.
Click to expand it.
climax/main/downscale_train.py
+
3
−
3
View file @
105a90b4
...
...
@@ -11,13 +11,12 @@ from logging.config import dictConfig
# externals
import
torch
import
numpy
as
np
import
xarray
as
xr
from
sklearn.model_selection
import
train_test_split
from
torch.utils.data
import
DataLoader
# locals
from
pysegcnn.core.utils
import
search_files
,
img2np
from
pysegcnn.core.utils
import
search_files
from
pysegcnn.core.trainer
import
NetworkTrainer
,
LogConfig
from
pysegcnn.core.models
import
Network
from
pysegcnn.core.logging
import
log_conf
...
...
@@ -39,7 +38,8 @@ if __name__ == '__main__':
# initialize network filename
state_file
=
ERA5Dataset
.
state_file
(
NET
,
PREDICTAND
,
ERA5_PREDICTORS
,
ERA5_PLEVELS
,
dem
=
DEM
,
doy
=
DOY
)
NET
,
PREDICTAND
,
ERA5_PREDICTORS
,
ERA5_PLEVELS
,
dem
=
DEM
,
dem_features
=
DEM_FEATURES
,
doy
=
DOY
)
state_file
=
MODEL_PATH
.
joinpath
(
state_file
)
# initialize logging
...
...
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