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
61832776
Commit
61832776
authored
1 year ago
by
tomrink
Browse files
Options
Downloads
Patches
Plain Diff
snapshot...
parent
f92ccdcd
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/icing/util.py
+18
-2
18 additions, 2 deletions
modules/icing/util.py
with
18 additions
and
2 deletions
modules/icing/util.py
+
18
−
2
View file @
61832776
...
...
@@ -434,21 +434,37 @@ def run_icing_predict_image(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', output
satzen
=
ancil_data_dct
[
'
sensor_zenith_angle
'
]
solzen
=
ancil_data_dct
[
'
solar_zenith_angle
'
]
cth
=
ancil_data_dct
[
'
cld_height_acha
'
]
day_idxs
=
[]
nght_idxs
=
[]
day_cth_max
=
[]
nght_cth_max
=
[]
for
j
in
range
(
num_lines
):
for
i
in
range
(
num_elems
):
k
=
i
+
j
*
num_elems
c
=
cth
[
k
].
flatten
()
c_m
=
np
.
mean
(
np
.
sort
(
c
[
np
.
invert
(
np
.
isnan
(
c
))])[
-
2
:])
c_m
=
0
if
2000
>
c_m
>=
0
else
c_m
c_m
=
1
if
4000
>
c_m
>=
2000
else
c_m
c_m
=
2
if
6000
>
c_m
>=
4000
else
c_m
c_m
=
3
if
8000
>
c_m
>=
6000
else
c_m
c_m
=
4
if
15000
>
c_m
>=
8000
else
c_m
if
not
check_oblique
(
satzen
[
k
]):
continue
if
is_day
(
solzen
[
k
]):
day_idxs
.
append
(
k
)
day_cth_max
.
append
(
c_m
)
else
:
nght_idxs
.
append
(
k
)
nght_cth_max
.
append
(
c_m
)
num_tiles
=
num_lines
*
num_elems
num_day_tiles
=
len
(
day_idxs
)
num_nght_tiles
=
len
(
nght_idxs
)
day_cth_max
=
np
.
array
(
day_cth_max
)
nght_cth_max
=
np
.
array
(
nght_cth_max
)
# initialize output arrays
probs_2d_dct
=
{
flvl
:
None
for
flvl
in
flight_levels
}
...
...
@@ -471,7 +487,7 @@ def run_icing_predict_image(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', output
for
ds_name
in
day_train_params
:
day_grd_dct
[
ds_name
]
=
np
.
stack
(
day_data_dct
[
ds_name
])
preds_day_dct
,
probs_day_dct
=
model_module
.
run_evaluate_static_2
(
day_model
,
day_grd_dct
,
num_day_tiles
,
preds_day_dct
,
probs_day_dct
=
model_module
.
run_evaluate_static_2
(
day_model
,
day_grd_dct
,
num_day_tiles
,
day_cth_max
,
day_night
=
'
DAY
'
,
l1b_or_l2
=
l1b_andor_l2
,
prob_thresh
=
prob_thresh
,
use_flight_altitude
=
use_flight_altitude
,
...
...
@@ -496,7 +512,7 @@ def run_icing_predict_image(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', output
for
ds_name
in
nght_train_params
:
nght_grd_dct
[
ds_name
]
=
np
.
stack
(
nght_data_dct
[
ds_name
])
preds_nght_dct
,
probs_nght_dct
=
model_module
.
run_evaluate_static_2
(
night_model
,
nght_grd_dct
,
num_nght_tiles
,
preds_nght_dct
,
probs_nght_dct
=
model_module
.
run_evaluate_static_2
(
night_model
,
nght_grd_dct
,
num_nght_tiles
,
nght_cth_max
,
day_night
=
'
NIGHT
'
,
l1b_or_l2
=
l1b_andor_l2
,
prob_thresh
=
prob_thresh
,
use_flight_altitude
=
use_flight_altitude
,
...
...
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