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
99be9747
Commit
99be9747
authored
1 year ago
by
tomrink
Browse files
Options
Downloads
Patches
Plain Diff
snapshot...
parent
32dd2aa1
Branches
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/pirep_goes.py
+54
-0
54 additions, 0 deletions
modules/icing/pirep_goes.py
with
54 additions
and
0 deletions
modules/icing/pirep_goes.py
+
54
−
0
View file @
99be9747
...
@@ -1399,6 +1399,60 @@ def apply_qc_icing_pireps_exp2(icing_alt, cld_top_hgt, cld_geo_dz, cld_phase, cl
...
@@ -1399,6 +1399,60 @@ def apply_qc_icing_pireps_exp2(icing_alt, cld_top_hgt, cld_geo_dz, cld_phase, cl
return
mask
,
idxs
,
num_tested
return
mask
,
idxs
,
num_tested
def
apply_qc_icing_pireps_new
(
icing_alt
,
cld_top_hgt
,
cld_geo_dz
,
cld_phase
,
cld_opd
,
cld_mask
,
bt_11um
,
solzen
,
satzen
,
cld_top_temp
,
day_night
=
'
ANY
'
,
cloudy_frac
=
0.5
):
closeness_top
=
200.0
# meters
max_cld_depth
=
1000.0
max_altitude
=
4000.0
max_cld_altitude
=
4000.0
num_obs
=
len
(
icing_alt
)
cld_mask
=
cld_mask
.
reshape
((
num_obs
,
-
1
))
cld_top_hgt
=
cld_top_hgt
.
reshape
((
num_obs
,
-
1
))
cld_geo_dz
=
cld_geo_dz
.
reshape
((
num_obs
,
-
1
))
bt_11um
=
bt_11um
.
reshape
((
num_obs
,
-
1
))
cld_top_temp
=
cld_top_temp
.
reshape
((
num_obs
,
-
1
))
mask
=
[]
idxs
=
[]
num_tested
=
[]
for
i
in
range
(
num_obs
):
if
not
check_oblique
(
satzen
[
i
,]):
continue
if
day_night
==
'
NIGHT
'
and
not
is_night
(
solzen
[
i
,]):
continue
elif
day_night
==
'
DAY
'
and
not
is_day
(
solzen
[
i
,]):
continue
elif
day_night
==
'
ANY
'
:
pass
# keep_0 = np.logical_or(cld_mask[i,] == 2, cld_mask[i,] == 3) # cloudy
keep_0
=
cld_mask
[
i
,
]
==
3
# Confident cloudy
keep_1
=
np
.
invert
(
np
.
isnan
(
cld_top_hgt
[
i
,]))
keep_2
=
np
.
invert
(
np
.
isnan
(
bt_11um
[
i
,]))
keep_3
=
np
.
invert
(
np
.
isnan
(
cld_geo_dz
[
i
,]))
keep
=
keep_0
&
keep_1
&
keep_2
&
keep_3
num_keep
=
np
.
sum
(
keep
)
if
num_keep
==
0
:
continue
if
num_keep
/
nx_x_ny
<
cloudy_frac
:
# At least this fraction cloudy
continue
cth_mean
=
np
.
nanmean
(
cld_top_hgt
[
i
,])
if
not
(
cth_mean
>
icing_alt
[
i
,]
>
cth_mean
-
1000.0
):
continue
keep
=
np
.
where
(
keep
,
np
.
logical_and
(
cld_top_hgt
[
i
,]
>
icing_alt
[
i
,],
(
cld_top_hgt
[
i
,]
-
3000.0
)
<
icing_alt
[
i
,]),
False
)
keep
=
np
.
where
(
keep
,
np
.
logical_and
(
cld_top_temp
[
i
,]
>
228.0
,
cld_top_temp
[
i
,]
<
274.0
),
False
)
mask
.
append
(
keep
)
idxs
.
append
(
i
)
num_tested
.
append
(
num_keep
)
return
mask
,
idxs
,
num_tested
def
apply_qc_no_icing_pireps
(
icing_alt
,
cld_top_hgt
,
cld_geo_dz
,
cld_phase
,
cld_opd
,
cld_mask
,
bt_11um
,
solzen
,
satzen
,
cld_top_temp
,
day_night
=
'
ANY
'
,
cloudy_frac
=
0.5
):
def
apply_qc_no_icing_pireps
(
icing_alt
,
cld_top_hgt
,
cld_geo_dz
,
cld_phase
,
cld_opd
,
cld_mask
,
bt_11um
,
solzen
,
satzen
,
cld_top_temp
,
day_night
=
'
ANY
'
,
cloudy_frac
=
0.5
):
if
day_night
==
'
DAY
'
:
if
day_night
==
'
DAY
'
:
...
...
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