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
f30cedb5
Commit
f30cedb5
authored
2 years ago
by
tomrink
Browse files
Options
Downloads
Patches
Plain Diff
nlcomp for VIIRS
parent
8f26d4f1
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/util.py
+41
-2
41 additions, 2 deletions
modules/util/util.py
with
41 additions
and
2 deletions
modules/util/util.py
+
41
−
2
View file @
f30cedb5
...
...
@@ -659,7 +659,26 @@ def make_for_full_domain_predict(h5f, name_list=None, satellite='GOES16', domain
return
grd_dct
,
ll
,
cc
def
make_for_full_domain_predict_viirs_clavrx
(
h5f
,
name_list
=
None
,
res_fac
=
1
):
rho_water
=
1.
rho_ice
=
0.917
def
compute_lwc_iwc
(
iphase
,
reff
,
opd
):
lwp_dcomp
=
np
.
zeros
(
reff
.
shape
[
0
])
iwp_dcomp
=
np
.
zeros
(
reff
.
shape
[
0
])
lwp_dcomp
[:]
=
np
.
nan
iwp_dcomp
[:]
=
np
.
nan
ice
=
iphase
==
1
no_ice
=
iphase
!=
1
iwp_dcomp
[
ice
]
=
0.667
*
opd
[
ice
]
*
rho_ice
*
reff
[
ice
]
lwp_dcomp
[
no_ice
]
=
0.55
*
opd
[
no_ice
]
*
rho_water
*
reff
[
no_ice
]
return
lwp_dcomp
,
iwp_dcomp
def
make_for_full_domain_predict_viirs_clavrx
(
h5f
,
name_list
=
None
,
res_fac
=
1
,
day_night
=
'
DAY
'
,
lunar
=
False
):
w_x
=
16
w_y
=
16
i_0
=
0
...
...
@@ -670,11 +689,23 @@ def make_for_full_domain_predict_viirs_clavrx(h5f, name_list=None, res_fac=1):
ylen
=
h5f
[
'
scan_lines_along_track_direction
'
].
shape
[
0
]
xlen
=
h5f
[
'
pixel_elements_along_scan_direction
'
].
shape
[
0
]
use_nl_comp
=
False
if
day_night
==
'
NIGHT
'
and
lunar
:
use_nl_comp
=
True
grd_dct
=
{
name
:
None
for
name
in
name_list
}
cnt_a
=
0
for
ds_name
in
name_list
:
gvals
=
get_grid_values
(
h5f
,
ds_name
,
j_0
,
i_0
,
None
,
num_j
=
ylen
,
num_i
=
xlen
)
name
=
ds_name
if
use_nl_comp
:
if
ds_name
==
'
cld_reff_dcomp
'
:
name
=
'
cld_reff_nlcomp
'
elif
ds_name
==
'
cld_opd_dcomp
'
:
name
=
'
cld_opd_nlcomp
'
gvals
=
get_grid_values
(
h5f
,
name
,
j_0
,
i_0
,
None
,
num_j
=
ylen
,
num_i
=
xlen
)
if
gvals
is
not
None
:
grd_dct
[
ds_name
]
=
gvals
cnt_a
+=
1
...
...
@@ -682,6 +713,14 @@ def make_for_full_domain_predict_viirs_clavrx(h5f, name_list=None, res_fac=1):
if
cnt_a
>
0
and
cnt_a
!=
len
(
name_list
):
raise
GenericException
(
'
weirdness
'
)
if
use_nl_comp
:
cld_phase
=
get_grid_values
(
h5f
,
'
cloud_phase
'
,
j_0
,
i_0
,
None
,
num_j
=
ylen
,
num_i
=
xlen
)
reff
=
grd_dct
[
'
cld_reff_dcomp
'
]
opd
=
grd_dct
[
'
cld_opd_dcomp
'
]
lwc_nlcomp
,
iwc_nlcomp
=
compute_lwc_iwc
(
cld_phase
,
reff
,
opd
)
grd_dct
[
'
iwc_dcomp
'
]
=
iwc_nlcomp
grd_dct
[
'
lwc_dcomp
'
]
=
lwc_nlcomp
grd_dct_n
=
{
name
:
[]
for
name
in
name_list
}
n_x
=
int
(
xlen
/
s_x
)
-
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