Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
python
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
Tom Rink
python
Commits
7a17e48c
Commit
7a17e48c
authored
1 year ago
by
tomrink
Browse files
Options
Downloads
Patches
Plain Diff
snapshot...
parent
a4b404b7
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
modules/util/infer_cloud_fraction.py
+2
-17
2 additions, 17 deletions
modules/util/infer_cloud_fraction.py
with
2 additions
and
17 deletions
modules/util/infer_cloud_fraction.py
+
2
−
17
View file @
7a17e48c
...
@@ -2,27 +2,12 @@ from util.geos_nav import get_navigation
...
@@ -2,27 +2,12 @@ from util.geos_nav import get_navigation
from
util.setup_cloud_fraction
import
model_path
from
util.setup_cloud_fraction
import
model_path
from
aeolus.datasource
import
CLAVRx
from
aeolus.datasource
import
CLAVRx
import
os
import
os
from
deeplearning.cloud_fraction_fcn_abi
import
SRCNN
,
run_evaluate_static
,
run_evaluate_static_full_disk
from
deeplearning.cloud_fraction_fcn_abi
import
SRCNN
from
util.util
import
get_cartopy_crs
,
write_cld_frac_file_nc4
from
util.util
import
get_cartopy_crs
,
write_cld_frac_file_nc4
import
numpy
as
np
import
numpy
as
np
def
infer_cloud_fraction
(
clvrx_path
,
output_dir
,
full_disk
=
True
):
def
infer_cloud_fraction
(
clvrx_path
,
output_dir
,
full_disk
=
True
,
satellite
=
'
GOES16
'
,
domain
=
'
FD
'
):
ckpt_dir_s
=
os
.
listdir
(
model_path
)
ckpt_dir
=
model_path
+
ckpt_dir_s
[
0
]
clvrx_ds
=
CLAVRx
(
clvrx_path
)
for
fname
,
t_start
,
t_stop
in
clvrx_ds
:
dto
=
clvrx_ds
.
get_datetime
(
fname
)
clvrx_str_time
=
dto
.
strftime
(
'
%Y-%m-%d_%H:%M
'
)
out_file
=
output_dir
+
'
cloud_fraction_
'
+
clvrx_str_time
if
full_disk
:
run_evaluate_static_full_disk
(
fname
,
out_file
,
ckpt_dir
)
else
:
run_evaluate_static
(
fname
,
out_file
,
ckpt_dir
)
def
infer_cloud_fraction_new
(
clvrx_path
,
output_dir
,
full_disk
=
True
,
satellite
=
'
GOES16
'
,
domain
=
'
FD
'
):
# location of the trained model
# location of the trained model
ckpt_dir_s
=
os
.
listdir
(
model_path
)
ckpt_dir_s
=
os
.
listdir
(
model_path
)
ckpt_dir
=
model_path
+
ckpt_dir_s
[
0
]
ckpt_dir
=
model_path
+
ckpt_dir_s
[
0
]
...
...
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