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
c52ce979
Commit
c52ce979
authored
1 year ago
by
tomrink
Browse files
Options
Downloads
Patches
Plain Diff
snapshot...
parent
00013b49
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/util/abi_surfrad.py
+16
-5
16 additions, 5 deletions
modules/util/abi_surfrad.py
with
16 additions
and
5 deletions
modules/util/abi_surfrad.py
+
16
−
5
View file @
c52ce979
...
@@ -70,10 +70,21 @@ def process_cld_prob(grd_k):
...
@@ -70,10 +70,21 @@ def process_cld_prob(grd_k):
def
process_cloud_frac
(
grd_k
):
def
process_cloud_frac
(
grd_k
):
pass
keep
=
np
.
invert
(
np
.
isnan
(
grd_k
))
num_keep
=
np
.
sum
(
keep
)
grd_by_cat
=
get_cloud_frac_5cat
(
grd_k
)
# if at least 20% mixed pass
keep_mix
=
np
.
where
(
keep
,
0
<
grd_by_cat
<
4
,
False
)
frac_mix
=
np
.
sum
(
keep_mix
)
/
num_keep
if
frac_mix
<
0.20
:
return
None
grd_k
=
np
.
where
(
np
.
invert
(
keep
),
0
,
grd_k
)
# Convert NaN to 0
return
grd_k
def
get_cloud_frac_5cat
(
grd_k
):
def
get_cloud_frac_5cat
(
grd_k
):
grd_k
=
grd_k
.
copy
()
grd_k
=
np
.
where
(
np
.
isnan
(
grd_k
),
0
,
grd_k
)
grd_k
=
np
.
where
(
np
.
isnan
(
grd_k
),
0
,
grd_k
)
grd_k
=
np
.
where
(
grd_k
<
0.5
,
0
,
1
)
grd_k
=
np
.
where
(
grd_k
<
0.5
,
0
,
1
)
...
@@ -82,11 +93,11 @@ def get_cloud_frac_5cat(grd_k):
...
@@ -82,11 +93,11 @@ def get_cloud_frac_5cat(grd_k):
grd_k
[:,
0
::
4
,
2
::
4
]
+
grd_k
[:,
1
::
4
,
2
::
4
]
+
grd_k
[:,
2
::
4
,
2
::
4
]
+
grd_k
[:,
3
::
4
,
2
::
4
]
+
\
grd_k
[:,
0
::
4
,
2
::
4
]
+
grd_k
[:,
1
::
4
,
2
::
4
]
+
grd_k
[:,
2
::
4
,
2
::
4
]
+
grd_k
[:,
3
::
4
,
2
::
4
]
+
\
grd_k
[:,
0
::
4
,
3
::
4
]
+
grd_k
[:,
1
::
4
,
3
::
4
]
+
grd_k
[:,
2
::
4
,
3
::
4
]
+
grd_k
[:,
3
::
4
,
3
::
4
]
grd_k
[:,
0
::
4
,
3
::
4
]
+
grd_k
[:,
1
::
4
,
3
::
4
]
+
grd_k
[:,
2
::
4
,
3
::
4
]
+
grd_k
[:,
3
::
4
,
3
::
4
]
cat_0
=
np
.
logical_and
(
s
>=
0
,
s
<
2
)
cat_0
=
np
.
logical_and
(
s
>=
0
,
s
<
1
)
cat_1
=
np
.
logical_and
(
s
>=
2
,
s
<
6
)
cat_1
=
np
.
logical_and
(
s
>=
1
,
s
<
6
)
cat_2
=
np
.
logical_and
(
s
>=
6
,
s
<
11
)
cat_2
=
np
.
logical_and
(
s
>=
6
,
s
<
11
)
cat_3
=
np
.
logical_and
(
s
>=
11
,
s
<
15
)
cat_3
=
np
.
logical_and
(
s
>=
11
,
s
<
=
15
)
cat_4
=
np
.
logical_and
(
s
>
=
15
,
s
<=
16
)
cat_4
=
np
.
logical_and
(
s
>
15
,
s
<=
16
)
s
[
cat_0
]
=
0
s
[
cat_0
]
=
0
s
[
cat_1
]
=
1
s
[
cat_1
]
=
1
...
...
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