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
904f0871
Commit
904f0871
authored
2 years ago
by
tomrink
Browse files
Options
Downloads
Patches
Plain Diff
snapshot...
parent
0fa82351
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
+55
-0
55 additions, 0 deletions
modules/util/util.py
with
55 additions
and
0 deletions
modules/util/util.py
+
55
−
0
View file @
904f0871
...
@@ -615,6 +615,61 @@ def make_for_full_domain_predict(h5f, name_list=None, satellite='GOES16', domain
...
@@ -615,6 +615,61 @@ def make_for_full_domain_predict(h5f, name_list=None, satellite='GOES16', domain
return
grd_dct
,
ll
,
cc
return
grd_dct
,
ll
,
cc
def
make_for_full_domain_predict_viirs_clavrx
(
h5f
,
name_list
=
None
,
res_fac
=
1
):
w_x
=
16
w_y
=
16
i_0
=
0
j_0
=
0
s_x
=
int
(
w_x
/
res_fac
)
s_y
=
int
(
w_y
/
res_fac
)
ylen
=
h5f
[
'
scan_lines_along_track_direction
'
].
shape
[
0
]
xlen
=
h5f
[
'
pixel_elements_along_scan_direction
'
].
shape
[
0
]
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
)
if
gvals
is
not
None
:
grd_dct
[
ds_name
]
=
gvals
cnt_a
+=
1
if
cnt_a
>
0
and
cnt_a
!=
len
(
name_list
):
raise
GenericException
(
'
weirdness
'
)
grd_dct_n
=
{
name
:
[]
for
name
in
name_list
}
n_x
=
int
(
xlen
/
s_x
)
-
1
n_y
=
int
(
ylen
/
s_y
)
-
1
r_x
=
xlen
-
(
n_x
*
s_x
)
x_d
=
0
if
r_x
>=
w_x
else
int
((
w_x
-
r_x
)
/
s_x
)
n_x
-=
x_d
r_y
=
ylen
-
(
n_y
*
s_y
)
y_d
=
0
if
r_y
>=
w_y
else
int
((
w_y
-
r_y
)
/
s_y
)
n_y
-=
y_d
ll
=
[
j_0
+
j
*
s_y
for
j
in
range
(
n_y
)]
cc
=
[
i_0
+
i
*
s_x
for
i
in
range
(
n_x
)]
for
ds_name
in
name_list
:
for
j
in
range
(
n_y
):
j_ul
=
j
*
s_y
j_ul_b
=
j_ul
+
w_y
for
i
in
range
(
n_x
):
i_ul
=
i
*
s_x
i_ul_b
=
i_ul
+
w_x
grd_dct_n
[
ds_name
].
append
(
grd_dct
[
ds_name
][
j_ul
:
j_ul_b
,
i_ul
:
i_ul_b
])
grd_dct
=
{
name
:
None
for
name
in
name_list
}
for
ds_name
in
name_list
:
grd_dct
[
ds_name
]
=
np
.
stack
(
grd_dct_n
[
ds_name
])
return
grd_dct
,
ll
,
cc
def
make_for_full_domain_predict2
(
h5f
,
satellite
=
'
GOES16
'
,
domain
=
'
FD
'
,
res_fac
=
1
):
def
make_for_full_domain_predict2
(
h5f
,
satellite
=
'
GOES16
'
,
domain
=
'
FD
'
,
res_fac
=
1
):
w_x
=
16
w_x
=
16
w_y
=
16
w_y
=
16
...
...
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